mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 21:56:42 +00:00
xf86-video-intel:
- add some patches from moblin
This commit is contained in:
parent
6101808931
commit
99b54f4289
183
packages/x11/driver/xf86-video-intel/patches/copy-fb.diff
Normal file
183
packages/x11/driver/xf86-video-intel/patches/copy-fb.diff
Normal file
@ -0,0 +1,183 @@
|
|||||||
|
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
|
||||||
|
index a469f6c..8c14b25 100644
|
||||||
|
--- a/src/drmmode_display.c
|
||||||
|
+++ b/src/drmmode_display.c
|
||||||
|
@@ -35,6 +35,8 @@
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
+#include <sys/ioctl.h>
|
||||||
|
+
|
||||||
|
#include "xorgVersion.h"
|
||||||
|
|
||||||
|
#include "i830.h"
|
||||||
|
@@ -911,6 +913,13 @@ drmmode_output_dpms(xf86OutputPtr output, int mode)
|
||||||
|
drmmode_ptr drmmode = drmmode_output->drmmode;
|
||||||
|
int i;
|
||||||
|
drmModePropertyPtr props;
|
||||||
|
+ intel_screen_private *intel = intel_get_screen_private(output->scrn);
|
||||||
|
+
|
||||||
|
+ /* xf86Crtc.c calls dpms off in set desired modes, so ignore
|
||||||
|
+ * the request if we're starting up. */
|
||||||
|
+
|
||||||
|
+ if (intel->starting)
|
||||||
|
+ return;
|
||||||
|
|
||||||
|
for (i = 0; i < koutput->count_props; i++) {
|
||||||
|
props = drmModeGetProperty(drmmode->fd, koutput->props[i]);
|
||||||
|
@@ -1412,6 +1421,8 @@ Bool drmmode_pre_init(ScrnInfoPtr scrn, int fd, int cpp)
|
||||||
|
|
||||||
|
xf86InitialConfiguration(scrn, TRUE);
|
||||||
|
|
||||||
|
+ scrn->canDoBGNoneRoot = TRUE;
|
||||||
|
+
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1446,3 +1457,96 @@ void drmmode_closefb(ScrnInfoPtr scrn)
|
||||||
|
drmModeRmFB(drmmode->fd, drmmode->fb_id);
|
||||||
|
drmmode->fb_id = 0;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+static PixmapPtr
|
||||||
|
+drmmode_create_pixmap_for_fbcon(ScrnInfoPtr scrn)
|
||||||
|
+{
|
||||||
|
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
|
||||||
|
+ drmmode_crtc_private_ptr drmmode_crtc = xf86_config->crtc[0]->driver_private;
|
||||||
|
+ ScreenPtr pScreen = screenInfo.screens[scrn->scrnIndex];
|
||||||
|
+ drmmode_ptr drmmode = drmmode_crtc->drmmode;
|
||||||
|
+ intel_screen_private *intel = intel_get_screen_private(scrn);
|
||||||
|
+ drmModeFBPtr fbcon = NULL;
|
||||||
|
+ struct drm_gem_flink flink;
|
||||||
|
+ drm_intel_bo *bo;
|
||||||
|
+ PixmapPtr pixmap = NULL;
|
||||||
|
+ int i;
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < drmmode->mode_res->count_crtcs; i++) {
|
||||||
|
+ drmmode_crtc = xf86_config->crtc[i]->driver_private;
|
||||||
|
+ if (drmmode_crtc->mode_crtc->buffer_id == 0)
|
||||||
|
+ continue;
|
||||||
|
+ fbcon = drmModeGetFB(drmmode->fd,
|
||||||
|
+ drmmode_crtc->mode_crtc->buffer_id);
|
||||||
|
+ if (fbcon != NULL)
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ if (i == drmmode->mode_res->count_crtcs)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
+ flink.handle = fbcon->handle;
|
||||||
|
+ if (ioctl(drmmode->fd, DRM_IOCTL_GEM_FLINK, &flink) < 0) {
|
||||||
|
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
|
||||||
|
+ "Couldn't flink fbcon handle\n");
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ bo = drm_intel_bo_gem_create_from_name(intel->bufmgr,
|
||||||
|
+ "fbcon", flink.name);
|
||||||
|
+ if (bo == NULL) {
|
||||||
|
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
|
||||||
|
+ "Couldn't allocate bo for fbcon handle\n");
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ pixmap = GetScratchPixmapHeader(pScreen,
|
||||||
|
+ fbcon->width, fbcon->height,
|
||||||
|
+ fbcon->depth, fbcon->bpp,
|
||||||
|
+ fbcon->pitch, NULL);
|
||||||
|
+ if (pixmap == NULL) {
|
||||||
|
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
|
||||||
|
+ "Couldn't allocate pixmap fbcon contents\n");
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ i830_set_pixmap_bo(pixmap, bo);
|
||||||
|
+ drm_intel_bo_unreference(bo);
|
||||||
|
+ drmModeFreeFB(fbcon);
|
||||||
|
+
|
||||||
|
+ return pixmap;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void drmmode_copy_fb(ScrnInfoPtr scrn)
|
||||||
|
+{
|
||||||
|
+ ScreenPtr pScreen = screenInfo.screens[scrn->scrnIndex];
|
||||||
|
+ intel_screen_private *intel = intel_get_screen_private(scrn);
|
||||||
|
+ PixmapPtr src, dst;
|
||||||
|
+ unsigned int pitch = scrn->displayWidth * intel->cpp;
|
||||||
|
+
|
||||||
|
+ src = drmmode_create_pixmap_for_fbcon(scrn);
|
||||||
|
+ if (src == NULL) {
|
||||||
|
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
|
||||||
|
+ "Couldn't create pixmap for fbcon\n");
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* We dont have a screen Pixmap yet */
|
||||||
|
+ dst = GetScratchPixmapHeader(pScreen,
|
||||||
|
+ scrn->virtualX, scrn->virtualY,
|
||||||
|
+ scrn->depth, scrn->bitsPerPixel,
|
||||||
|
+ pitch,
|
||||||
|
+ NULL);
|
||||||
|
+ i830_set_pixmap_bo(dst, intel->front_buffer->bo);
|
||||||
|
+
|
||||||
|
+ intel->uxa_driver->prepare_copy(src, dst, -1, -1, GXcopy, FB_ALLONES);
|
||||||
|
+
|
||||||
|
+ intel->uxa_driver->copy(dst, 0, 0, 0, 0,
|
||||||
|
+ scrn->virtualX, scrn->virtualY);
|
||||||
|
+
|
||||||
|
+ intel->uxa_driver->done_copy(dst);
|
||||||
|
+
|
||||||
|
+ intel_sync(scrn);
|
||||||
|
+
|
||||||
|
+ (*pScreen->DestroyPixmap)(src);
|
||||||
|
+ (*pScreen->DestroyPixmap)(dst);
|
||||||
|
+}
|
||||||
|
diff --git a/src/i830.h b/src/i830.h
|
||||||
|
index a66038a..d0df26e 100644
|
||||||
|
--- a/src/i830.h
|
||||||
|
+++ b/src/i830.h
|
||||||
|
@@ -376,6 +376,7 @@ typedef struct intel_screen_private {
|
||||||
|
OptionInfoPtr Options;
|
||||||
|
|
||||||
|
/* Driver phase/state information */
|
||||||
|
+ Bool starting;
|
||||||
|
Bool suspended;
|
||||||
|
|
||||||
|
enum last_3d last_3d;
|
||||||
|
@@ -432,6 +433,7 @@ extern int drmmode_get_pipe_from_crtc_id(drm_intel_bufmgr * bufmgr,
|
||||||
|
extern int drmmode_output_dpms_status(xf86OutputPtr output);
|
||||||
|
extern int drmmode_crtc_id(xf86CrtcPtr crtc);
|
||||||
|
void drmmode_crtc_set_cursor_bo(xf86CrtcPtr crtc, dri_bo * cursor);
|
||||||
|
+extern void drmmode_copy_fb(ScrnInfoPtr scrn);
|
||||||
|
|
||||||
|
extern Bool i830_crtc_on(xf86CrtcPtr crtc);
|
||||||
|
extern int i830_crtc_to_pipe(xf86CrtcPtr crtc);
|
||||||
|
diff --git a/src/i830_driver.c b/src/i830_driver.c
|
||||||
|
index e94a60c..da3230c 100644
|
||||||
|
--- a/src/i830_driver.c
|
||||||
|
+++ b/src/i830_driver.c
|
||||||
|
@@ -1276,6 +1276,8 @@ I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
|
||||||
|
|
||||||
|
i830_fixup_mtrrs(scrn);
|
||||||
|
|
||||||
|
+ intel->starting = TRUE;
|
||||||
|
+
|
||||||
|
miClearVisualTypes();
|
||||||
|
if (!miSetVisualTypes(scrn->depth,
|
||||||
|
miGetDefaultVisualMask(scrn->depth),
|
||||||
|
@@ -1423,6 +1425,7 @@ I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
|
||||||
|
if (serverGeneration == 1)
|
||||||
|
xf86ShowUnusedOptions(scrn->scrnIndex, scrn->options);
|
||||||
|
|
||||||
|
+ intel->starting = FALSE;
|
||||||
|
intel->suspended = FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
@@ -1507,6 +1510,8 @@ static Bool I830EnterVT(int scrnIndex, int flags)
|
||||||
|
if (IS_I965G(intel))
|
||||||
|
gen4_render_state_init(scrn);
|
||||||
|
|
||||||
|
+ drmmode_copy_fb(scrn);
|
||||||
|
+
|
||||||
|
if (!xf86SetDesiredModes(scrn))
|
||||||
|
return FALSE;
|
||||||
|
|
23
packages/x11/driver/xf86-video-intel/patches/dump-tools.diff
Normal file
23
packages/x11/driver/xf86-video-intel/patches/dump-tools.diff
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
diff --git a/src/bios_reader/Makefile.am b/src/bios_reader/Makefile.am
|
||||||
|
index f2f9dc0..4be476e 100644
|
||||||
|
--- a/src/bios_reader/Makefile.am
|
||||||
|
+++ b/src/bios_reader/Makefile.am
|
||||||
|
@@ -1,7 +1,7 @@
|
||||||
|
AM_CFLAGS = @CWARNFLAGS@ @XORG_CFLAGS@ @PCIACCESS_CFLAGS@ \
|
||||||
|
-DREG_DUMPER
|
||||||
|
|
||||||
|
-noinst_PROGRAMS = bios_reader $(BIOS_DUMPER) $(SWF_DUMPER)
|
||||||
|
+bin_PROGRAMS = bios_reader $(BIOS_DUMPER) $(SWF_DUMPER)
|
||||||
|
|
||||||
|
BIOS_DUMPER = bios_dumper
|
||||||
|
|
||||||
|
diff --git a/src/reg_dumper/Makefile.am b/src/reg_dumper/Makefile.am
|
||||||
|
index 8f00abe..1634a4f 100644
|
||||||
|
--- a/src/reg_dumper/Makefile.am
|
||||||
|
+++ b/src/reg_dumper/Makefile.am
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-noinst_PROGRAMS = \
|
||||||
|
+bin_PROGRAMS = \
|
||||||
|
intel_gtt \
|
||||||
|
intel_statuspage \
|
||||||
|
intel_hotplug \
|
146
packages/x11/driver/xf86-video-intel/patches/uevent.diff
Normal file
146
packages/x11/driver/xf86-video-intel/patches/uevent.diff
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
diff -up xf86-video-intel-2.10.0/src/i830_driver.c.dave xf86-video-intel-2.10.0/src/i830_driver.c
|
||||||
|
--- xf86-video-intel-2.10.0/src/i830_driver.c.dave 2010-01-13 18:48:49.000000000 +1000
|
||||||
|
+++ xf86-video-intel-2.10.0/src/i830_driver.c 2010-01-13 18:51:09.000000000 +1000
|
||||||
|
@@ -83,6 +83,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
#include "i915_drm.h"
|
||||||
|
#include <xf86drmMode.h>
|
||||||
|
|
||||||
|
+#include "libudev.h"
|
||||||
|
+
|
||||||
|
#define BIT(x) (1 << (x))
|
||||||
|
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||||
|
#define NB_OF(x) (sizeof (x) / sizeof (*x))
|
||||||
|
@@ -1167,6 +1169,80 @@ int i830_crtc_to_pipe(xf86CrtcPtr crtc)
|
||||||
|
return drmmode_get_pipe_from_crtc_id(intel->bufmgr, crtc);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void
|
||||||
|
+I830HandleUEvents(int fd, void *closure)
|
||||||
|
+{
|
||||||
|
+ ScrnInfoPtr scrn = closure;
|
||||||
|
+ intel_screen_private *intel = intel_get_screen_private(scrn);
|
||||||
|
+ struct udev_device *dev;
|
||||||
|
+
|
||||||
|
+ dev = udev_monitor_receive_device(intel->uevent_monitor);
|
||||||
|
+ if (!dev)
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * technically we should inspect the event to see that it's a hotplug.
|
||||||
|
+ * but we know it's a hotplug, we don't get events for anything else.
|
||||||
|
+ * XXX but we should definitely trim by drm node
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+ RRGetInfo(screenInfo.screens[scrn->scrnIndex], TRUE);
|
||||||
|
+
|
||||||
|
+ udev_device_unref(dev);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
+I830UeventInit(ScrnInfoPtr scrn)
|
||||||
|
+{
|
||||||
|
+ intel_screen_private *intel = intel_get_screen_private(scrn);
|
||||||
|
+ struct udev *u;
|
||||||
|
+ struct udev_monitor *mon;
|
||||||
|
+
|
||||||
|
+ u = udev_new();
|
||||||
|
+ if (!u)
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ mon = udev_monitor_new_from_netlink(u, "udev");
|
||||||
|
+
|
||||||
|
+ if (!mon) {
|
||||||
|
+ udev_unref(u);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (udev_monitor_filter_add_match_subsystem_devtype(mon,
|
||||||
|
+ "drm",
|
||||||
|
+ "drm_minor") < 0 ||
|
||||||
|
+ udev_monitor_enable_receiving(mon) < 0)
|
||||||
|
+ {
|
||||||
|
+ udev_monitor_unref(mon);
|
||||||
|
+ udev_unref(u);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ intel->uevent_handler =
|
||||||
|
+ xf86AddGeneralHandler(udev_monitor_get_fd(mon),
|
||||||
|
+ I830HandleUEvents,
|
||||||
|
+ scrn);
|
||||||
|
+
|
||||||
|
+ intel->uevent_monitor = mon;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
+I830UeventFini(ScrnInfoPtr scrn)
|
||||||
|
+{
|
||||||
|
+ intel_screen_private *intel = intel_get_screen_private(scrn);
|
||||||
|
+
|
||||||
|
+ if (intel->uevent_handler)
|
||||||
|
+ {
|
||||||
|
+ struct udev *u = udev_monitor_get_udev(intel->uevent_monitor);
|
||||||
|
+
|
||||||
|
+ xf86RemoveGeneralHandler(intel->uevent_handler);
|
||||||
|
+
|
||||||
|
+ udev_monitor_unref(intel->uevent_monitor);
|
||||||
|
+ udev_unref(u);
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static Bool
|
||||||
|
I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
|
||||||
|
{
|
||||||
|
@@ -1425,6 +1501,8 @@ I830ScreenInit(int scrnIndex, ScreenPtr
|
||||||
|
|
||||||
|
intel->suspended = FALSE;
|
||||||
|
|
||||||
|
+ I830UeventInit(scrn);
|
||||||
|
+
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1529,7 +1607,8 @@ static Bool I830CloseScreen(int scrnInde
|
||||||
|
{
|
||||||
|
ScrnInfoPtr scrn = xf86Screens[scrnIndex];
|
||||||
|
intel_screen_private *intel = intel_get_screen_private(scrn);
|
||||||
|
-
|
||||||
|
+
|
||||||
|
+ I830UeventFini(scrn);
|
||||||
|
if (scrn->vtSema == TRUE) {
|
||||||
|
I830LeaveVT(scrnIndex, 0);
|
||||||
|
}
|
||||||
|
diff -up xf86-video-intel-2.10.0/src/i830.h.dave xf86-video-intel-2.10.0/src/i830.h
|
||||||
|
--- xf86-video-intel-2.10.0/src/i830.h.dave 2010-01-13 18:48:50.000000000 +1000
|
||||||
|
+++ xf86-video-intel-2.10.0/src/i830.h 2010-01-13 18:50:01.000000000 +1000
|
||||||
|
@@ -47,6 +47,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
#ifndef _I830_H_
|
||||||
|
#define _I830_H_
|
||||||
|
|
||||||
|
+#include "libudev.h"
|
||||||
|
+
|
||||||
|
#include "xf86_OSproc.h"
|
||||||
|
#include "compiler.h"
|
||||||
|
#include "xf86PciInfo.h"
|
||||||
|
@@ -385,6 +387,9 @@ typedef struct intel_screen_private {
|
||||||
|
*/
|
||||||
|
Bool fallback_debug;
|
||||||
|
unsigned debug_flush;
|
||||||
|
+
|
||||||
|
+ struct udev_monitor *uevent_monitor;
|
||||||
|
+ InputHandlerProc uevent_handler;
|
||||||
|
} intel_screen_private;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
diff -up xf86-video-intel-2.10.0/src/Makefile.am.dave xf86-video-intel-2.10.0/src/Makefile.am
|
||||||
|
--- xf86-video-intel-2.10.0/src/Makefile.am.dave 2010-01-05 08:09:52.000000000 +1000
|
||||||
|
+++ xf86-video-intel-2.10.0/src/Makefile.am 2010-01-13 18:49:14.000000000 +1000
|
||||||
|
@@ -32,7 +32,7 @@ AM_CFLAGS = @CWARNFLAGS@ @XORG_CFLAGS@ @
|
||||||
|
intel_drv_la_LTLIBRARIES = intel_drv.la
|
||||||
|
intel_drv_la_LDFLAGS = -module -avoid-version
|
||||||
|
intel_drv_ladir = @moduledir@/drivers
|
||||||
|
-intel_drv_la_LIBADD = -lm @DRM_LIBS@ -ldrm_intel ../uxa/libuxa.la
|
||||||
|
+intel_drv_la_LIBADD = -lm @DRM_LIBS@ -ldrm_intel ../uxa/libuxa.la -ludev
|
||||||
|
intel_drv_la_LIBADD += @PCIACCESS_LIBS@
|
||||||
|
|
||||||
|
INTEL_DRI_SRCS = \
|
Loading…
x
Reference in New Issue
Block a user