diff --git a/0001-dix-allow-pixmap-dirty-helper-to-be-used-for-non-sha.patch b/0001-dix-allow-pixmap-dirty-helper-to-be-used-for-non-sha.patch new file mode 100644 index 0000000..e524142 --- /dev/null +++ b/0001-dix-allow-pixmap-dirty-helper-to-be-used-for-non-sha.patch @@ -0,0 +1,40 @@ +From 73fc15d94136a87807c1ce69d56fb8a34c09fe4f Mon Sep 17 00:00:00 2001 +From: Fedora X Ninjas +Date: Tue, 8 Jan 2013 09:41:36 +1000 +Subject: [PATCH] dix: allow pixmap dirty helper to be used for non-shared + pixmaps + +this allows the pixmap dirty helper to be used for reverse optimus +--- + dix/pixmap.c | 2 ++ + fb/fbpixmap.c | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/dix/pixmap.c b/dix/pixmap.c +index 2418812..fe92147 100644 +--- a/dix/pixmap.c ++++ b/dix/pixmap.c +@@ -243,6 +243,8 @@ Bool PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty, RegionPtr dirty_region) + } + + dst = dirty->slave_dst->master_pixmap; ++ if (!dst) ++ dst = dirty->slave_dst; + + RegionTranslate(dirty_region, -dirty->x, -dirty->y); + n = RegionNumRects(dirty_region); +diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c +index fbcdca9..0824b64 100644 +--- a/fb/fbpixmap.c ++++ b/fb/fbpixmap.c +@@ -67,6 +67,7 @@ fbCreatePixmapBpp(ScreenPtr pScreen, int width, int height, int depth, int bpp, + pPixmap->devKind = paddedWidth; + pPixmap->refcnt = 1; + pPixmap->devPrivate.ptr = (pointer) ((char *) pPixmap + base + adjust); ++ pPixmap->master_pixmap = NULL; + + #ifdef FB_DEBUG + pPixmap->devPrivate.ptr = +-- +1.8.1 + diff --git a/0001-xf86crtc-don-t-use-display-for-vx-vy-for-gpu-screens.patch b/0001-xf86crtc-don-t-use-display-for-vx-vy-for-gpu-screens.patch index 1d88c5b..36b6a4c 100644 --- a/0001-xf86crtc-don-t-use-display-for-vx-vy-for-gpu-screens.patch +++ b/0001-xf86crtc-don-t-use-display-for-vx-vy-for-gpu-screens.patch @@ -1,17 +1,17 @@ -From 0c05db308881b3b462dae4101312c0034e6288ba Mon Sep 17 00:00:00 2001 +From 2bd6a8491ad3dbd42db66be7ae48f4b6e9c698f2 Mon Sep 17 00:00:00 2001 From: Fedora X Ninjas Date: Wed, 12 Dec 2012 14:02:54 +1000 Subject: [PATCH] xf86crtc: don't use display for vx/vy for gpu screens --- - hw/xfree86/modes/xf86Crtc.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) + hw/xfree86/modes/xf86Crtc.c | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c -index ba84e6b..61119b3 100644 +index 6975d2f..2828ee0 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c -@@ -2420,11 +2420,11 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow) +@@ -2425,11 +2425,11 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow) config->debug_modes = xf86ReturnOptValBool(config->options, OPTION_MODEDEBUG, FALSE); @@ -25,6 +25,41 @@ index ba84e6b..61119b3 100644 height = scrn->display->virtualY; else height = config->maxHeight; +@@ -2497,8 +2497,10 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow) + + /* XXX override xf86 common frame computation code */ + +- scrn->display->frameX0 = 0; +- scrn->display->frameY0 = 0; ++ if (!scrn->is_gpu) { ++ scrn->display->frameX0 = 0; ++ scrn->display->frameY0 = 0; ++ } + + for (c = 0; c < config->num_crtc; c++) { + xf86CrtcPtr crtc = config->crtc[c]; +@@ -2546,7 +2548,7 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow) + } + } + +- if (scrn->display->virtualX == 0) { ++ if (scrn->display->virtualX == 0 || scrn->is_gpu) { + /* + * Expand virtual size to cover the current config and potential mode + * switches, if the driver can't enlarge the screen later. +@@ -2561,8 +2563,10 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow) + } + } + +- scrn->display->virtualX = width; +- scrn->display->virtualY = height; ++ if (!scrn->is_gpu) { ++ scrn->display->virtualX = width; ++ scrn->display->virtualY = height; ++ } + } + + if (width > scrn->virtualX) -- -1.8.0.1 +1.8.1 diff --git a/0001-xserver-call-CSR-for-gpus.patch b/0001-xserver-call-CSR-for-gpus.patch new file mode 100644 index 0000000..297d056 --- /dev/null +++ b/0001-xserver-call-CSR-for-gpus.patch @@ -0,0 +1,26 @@ +From de313f7537071d72626ffbf64ab0cb5fff5dd5a0 Mon Sep 17 00:00:00 2001 +From: Fedora X Ninjas +Date: Tue, 8 Jan 2013 09:42:44 +1000 +Subject: [PATCH] xserver: call CSR for gpus + +--- + dix/main.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/dix/main.c b/dix/main.c +index fb935c9..e558d70 100644 +--- a/dix/main.c ++++ b/dix/main.c +@@ -211,6 +211,9 @@ main(int argc, char *argv[], char *envp[]) + ScreenPtr pScreen = screenInfo.gpuscreens[i]; + if (!CreateScratchPixmapsForScreen(pScreen)) + FatalError("failed to create scratch pixmaps"); ++ if (pScreen->CreateScreenResources && ++ !(*pScreen->CreateScreenResources) (pScreen)) ++ FatalError("failed to create screen resources"); + } + + for (i = 0; i < screenInfo.numScreens; i++) { +-- +1.8.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 9ed57a0..8cb5592 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -43,7 +43,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.13.1 -Release: 2%{?gitdate:.%{gitdate}}%{dist} +Release: 3%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -120,6 +120,10 @@ Patch7066: 0001-xf86crtc-don-t-use-display-for-vx-vy-for-gpu-screens.patch # autoconfig: send events Patch7067: 0001-autoconfig-fixup-tell-changed-so-randr-clients-can-t.patch +# on way upstream: fixes for reverse optimus +Patch8000: 0001-dix-allow-pixmap-dirty-helper-to-be-used-for-non-sha.patch +Patch8001: 0001-xserver-call-CSR-for-gpus.patch + %global moduledir %{_libdir}/xorg/modules %global drimoduledir %{_libdir}/dri %global sdkdir %{_includedir}/xorg @@ -592,6 +596,9 @@ rm -rf $RPM_BUILD_ROOT %{xserver_source_dir} %changelog +* Tue Jan 08 2013 Dave Airlie 1.13.1-3 +- fixes for reverse optimus support + * Mon Jan 07 2013 Dave Airlie 1.13.1-2 - fix bugs with autobinding output/offload slave from same driver