Xext/panoramiXprocs.c | 4 Xext/saver.c | 2 Xext/shm.c | 17 Xi/exevents.c | 3 configure.ac | 28 - debian/changelog | 9 debian/patches/randr-adjust-masters-last-set-time.diff | 39 + debian/patches/randr-do-not-check-the-screen-size.diff | 87 +++ debian/patches/series | 2 dix/cursor.c | 23 dix/devices.c | 3 dix/enterleave.c | 20 dix/ptrveloc.c | 10 exa/exa_glyphs.c | 8 exa/exa_render.c | 3 glamor/glamor.c | 45 + glamor/glamor.h | 1 glamor/glamor_composite_glyphs.c | 5 glamor/glamor_compositerects.c | 18 glamor/glamor_copy.c | 8 glamor/glamor_dash.c | 3 glamor/glamor_egl.c | 11 glamor/glamor_fbo.c | 4 glamor/glamor_priv.h | 28 + glamor/glamor_program.c | 8 glamor/glamor_render.c | 94 ++- glamor/glamor_spans.c | 3 glamor/glamor_text.c | 13 glamor/glamor_transfer.c | 3 glamor/glamor_transform.c | 12 glamor/glamor_transform.h | 4 glx/glxext.c | 6 hw/kdrive/linux/keyboard.c | 441 ----------------- hw/xfree86/common/xf86Config.c | 68 +- hw/xfree86/common/xf86Configure.c | 2 hw/xfree86/common/xf86Init.c | 4 hw/xfree86/common/xf86Privstr.h | 1 hw/xfree86/drivers/modesetting/Makefile.am | 2 hw/xfree86/drivers/modesetting/driver.c | 85 ++- hw/xfree86/drivers/modesetting/drmmode_display.c | 99 ++- hw/xfree86/drivers/modesetting/drmmode_display.h | 2 hw/xfree86/drivers/modesetting/present.c | 9 hw/xfree86/drivers/modesetting/sh3224.c | 140 +++++ hw/xfree86/drivers/modesetting/sh3224.h | 7 hw/xfree86/int10/xf86x86emu.c | 2 hw/xfree86/man/xorg.conf.man | 4 hw/xfree86/modes/xf86Crtc.c | 3 hw/xfree86/os-support/linux/lnx_init.c | 10 hw/xfree86/x86emu/x86emu/regs.h | 8 hw/xquartz/bundle/Info.plist.cpp | 23 hw/xquartz/bundle/Makefile.am | 6 hw/xwayland/xwayland-cursor.c | 15 hw/xwayland/xwayland-glamor-xv.c | 2 hw/xwayland/xwayland-glamor.c | 3 hw/xwayland/xwayland-output.c | 17 hw/xwayland/xwayland-shm.c | 10 hw/xwayland/xwayland.h | 2 include/xkbsrv.h | 4 os/access.c | 44 + present/present.c | 33 - randr/rrprovider.c | 2 render/picture.h | 2 xkb/xkb.c | 5 xkb/xkbEvents.c | 2 xkb/xkbLEDs.c | 2 65 files changed, 902 insertions(+), 681 deletions(-)
New commits: commit 08ac7a85d7dd1b1ea19ee6632a6ccd7c744f1745 Author: Timo Aaltonen <[email protected]> Date: Thu Sep 1 10:08:35 2016 +0300 release to xenial diff --git a/debian/changelog b/debian/changelog index 7053a70..4b59371 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,11 @@ -xorg-server (2:1.18.4-0ubuntu0.1) UNRELEASED; urgency=medium +xorg-server (2:1.18.4-0ubuntu0.1) xenial; urgency=medium - * New upstream bugfix release. + * New upstream bugfix release. (LP: #1619142) * randr-adjust-masters-last-set-time.diff, randr-do-not-check-the-screen-size.diff: Fix issues changing display mode on prime setups. (LP: #1586260) - -- Timo Aaltonen <[email protected]> Mon, 01 Aug 2016 14:36:15 +0300 + -- Timo Aaltonen <[email protected]> Thu, 01 Sep 2016 10:07:28 +0300 xorg-server (2:1.18.3-1ubuntu2.3) xenial; urgency=medium commit ed8e88627eed6260a3168d42ddeb75b52f26c5e4 Author: Timo Aaltonen <[email protected]> Date: Thu Sep 1 10:04:18 2016 +0300 randr-adjust-masters-last-set-time.diff, randr-do-not-check-the-screen-size.diff: Fix issues changing display mode on prime setups. (LP: #1586260) diff --git a/debian/changelog b/debian/changelog index 3437abc..7053a70 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ xorg-server (2:1.18.4-0ubuntu0.1) UNRELEASED; urgency=medium * New upstream bugfix release. + * randr-adjust-masters-last-set-time.diff, + randr-do-not-check-the-screen-size.diff: + Fix issues changing display mode on prime setups. (LP: #1586260) -- Timo Aaltonen <[email protected]> Mon, 01 Aug 2016 14:36:15 +0300 diff --git a/debian/patches/randr-adjust-masters-last-set-time.diff b/debian/patches/randr-adjust-masters-last-set-time.diff new file mode 100644 index 0000000..15f8404 --- /dev/null +++ b/debian/patches/randr-adjust-masters-last-set-time.diff @@ -0,0 +1,39 @@ +Subject: [PATCH xserver] randr: Adjust master's last set time with slaves +From: Nikhil Mahale <[email protected]> +Date: 20.05.2016 08:01 +To: <[email protected]> +CC: Nikhil Mahale <[email protected]> + +In prime configurations master's last set time may not be latest +and greatest, adjust it with slaves last set time, pick up greatest +one. Otherwise xserver may end with events which has +lastSetTime < lastConfigTime even if that's not +the case and confuse xrandr client. + +Signed-off-by: Nikhil Mahale <[email protected]> +--- + randr/randr.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/randr/randr.c b/randr/randr.c +index 3aabb19..c07def1 100644 +--- a/randr/randr.c ++++ b/randr/randr.c +@@ -584,6 +585,15 @@ RRTellChanged(ScreenPtr pScreen) + mastersp = pScrPriv; + } + ++ xorg_list_for_each_entry(iter, &master->output_slave_list, output_head) { ++ pSlaveScrPriv = rrGetScrPriv(iter); ++ ++ if (CompareTimeStamps(mastersp->lastSetTime, ++ pSlaveScrPriv->lastSetTime) == EARLIER) { ++ mastersp->lastSetTime = pSlaveScrPriv->lastSetTime; ++ } ++ } ++ + if (mastersp->changed) { + UpdateCurrentTimeIf(); + if (mastersp->configChanged) { +-- 2.8.2 ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ----------------------------------------------------------------------------------- _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel + diff --git a/debian/patches/randr-do-not-check-the-screen-size.diff b/debian/patches/randr-do-not-check-the-screen-size.diff new file mode 100644 index 0000000..ca294b7 --- /dev/null +++ b/debian/patches/randr-do-not-check-the-screen-size.diff @@ -0,0 +1,87 @@ +Subject: [PATCH xserver] randr: Do not check the screen size bound for gpu screens +From: Nikhil Mahale <[email protected]> +Date: 20.05.2016 08:00 +To: <[email protected]> +CC: Nikhil Mahale <[email protected]> + +For gpu screen, CrtcSet set/adjust the master screen size along +mode in following callstack - + + ProcRRSetCrtcConfig() + | + -> RRCrtcSet() + | + -> rrCheckPixmapBounding() + | + -> pScrPriv->rrScreenSetSize() + +Checking screen size bound for gpus screen cause some configurations +to fails, e.g + + $ xrandr --output eDP --mode 1920x1080 --pos 0x0 --output HDMI \ + --mode 2560x1440 --pos 0x0 + + Here xrandr utility first sets screen size to 2560x1440 which + gets resized to 1920x1080 on RRSetCrtcConfig request for eDP, + and then RRSetCrtcConfig request for HDMI fails because + of failure of screen bound check. + +Signed-off-by: Nikhil Mahale <[email protected]> +--- + randr/rrcrtc.c | 19 ++++++------------- + 1 file changed, 6 insertions(+), 13 deletions(-) + +diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c +index 566a3db..82db9a8 100644 +--- a/randr/rrcrtc.c ++++ b/randr/rrcrtc.c +@@ -1176,27 +1176,20 @@ ProcRRSetCrtcConfig(ClientPtr client) + + #ifdef RANDR_12_INTERFACE + /* ++ * For gpu screen, CrtcSet set/adjust the master screen size along ++ * with mode. ++ * + * Check screen size bounds if the DDX provides a 1.2 interface + * for setting screen size. Else, assume the CrtcSet sets + * the size along with the mode. If the driver supports transforms, + * then it must allow crtcs to display a subset of the screen, so + * only do this check for drivers without transform support. + */ +- if (pScrPriv->rrScreenSetSize && !crtc->transforms) { ++ if (!pScreen->isGPU && pScrPriv->rrScreenSetSize && !crtc->transforms) { + int source_width; + int source_height; + PictTransform transform; + struct pixman_f_transform f_transform, f_inverse; +- int width, height; +- +- if (pScreen->isGPU) { +- width = pScreen->current_master->width; +- height = pScreen->current_master->height; +- } +- else { +- width = pScreen->width; +- height = pScreen->height; +- } + + RRTransformCompute(stuff->x, stuff->y, + mode->mode.width, mode->mode.height, +@@ -1206,13 +1199,13 @@ ProcRRSetCrtcConfig(ClientPtr client) + + RRModeGetScanoutSize(mode, &transform, &source_width, + &source_height); +- if (stuff->x + source_width > width) { ++ if (stuff->x + source_width > pScreen->width) { + client->errorValue = stuff->x; + free(outputs); + return BadValue; + } + +- if (stuff->y + source_height > height) { ++ if (stuff->y + source_height > pScreen->height) { + client->errorValue = stuff->y; + free(outputs); + return BadValue; +-- 2.8.2 ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ----------------------------------------------------------------------------------- _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel + diff --git a/debian/patches/series b/debian/patches/series index 891be0f..c204c32 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -50,3 +50,5 @@ xmir.patch xmir-desktop-file-hint-flag.patch drm_device_keep_trying.patch xi2-resize-touch.patch +randr-adjust-masters-last-set-time.diff +randr-do-not-check-the-screen-size.diff commit cd370cffa036c5d6948e24cf2f9c23195c9323be Author: Timo Aaltonen <[email protected]> Date: Mon Aug 1 14:40:58 2016 +0300 New upstream bugfix release. diff --git a/debian/changelog b/debian/changelog index 8d51676..3437abc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +xorg-server (2:1.18.4-0ubuntu0.1) UNRELEASED; urgency=medium + + * New upstream bugfix release. + + -- Timo Aaltonen <[email protected]> Mon, 01 Aug 2016 14:36:15 +0300 + xorg-server (2:1.18.3-1ubuntu2.3) xenial; urgency=medium [ Timo Aaltonen ] commit 8b312db7d1d98be67f0283d982428545cf948a66 Author: Adam Jackson <[email protected]> Date: Tue Jul 19 13:27:08 2016 -0400 xserver 1.18.4 Signed-off-by: Adam Jackson <[email protected]> diff --git a/configure.ac b/configure.ac index cfffcd8..868e859 100644 --- a/configure.ac +++ b/configure.ac @@ -26,9 +26,9 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.60) -AC_INIT([xorg-server], 1.18.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="2016-04-04" -RELEASE_NAME="Halloumi" +AC_INIT([xorg-server], 1.18.4, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="2016-07-19" +RELEASE_NAME="Skordalia" AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) commit 42a74080ffe93502904ede7555652f01ab11d12d Author: Michel Dänzer <[email protected]> Date: Wed Mar 30 18:23:04 2016 +0900 os: Use strtok instead of xstrtokenize in ComputeLocalClient Fixes leaking the memory pointed to by the members of the array returned by xstrtokenize. Reviewed-by: Adam Jackson <[email protected]> (cherry picked from commit e156c0ccb530897d3a428255bd5585f7ea7b9b41) diff --git a/os/access.c b/os/access.c index 08c4fd0..dac6f49 100644 --- a/os/access.c +++ b/os/access.c @@ -1132,19 +1132,20 @@ ComputeLocalClient(ClientPtr client) * is forwarded from another host via SSH */ if (cmdname) { - char **cmd; + char *cmd = strdup(cmdname); Bool ret; /* Cut off any colon and whatever comes after it, see * https://lists.freedesktop.org/archives/xorg-devel/2015-December/048164.html */ - cmd = xstrtokenize(cmdname, ":"); + cmd = strtok(cmd, ":"); #if !defined(WIN32) || defined(__CYGWIN__) - cmd[0] = basename(cmd[0]); + ret = strcmp(basename(cmd), "ssh") != 0; +#else + ret = strcmp(cmd, "ssh") != 0; #endif - ret = strcmp(cmd[0], "ssh") != 0; free(cmd); return ret; commit 3c4cead499f10dabac20ab87728746ec41dae799 Author: Adam Jackson <[email protected]> Date: Mon Mar 28 18:11:09 2016 +0900 os: Treat ssh as a non-local client (v4) By the time we get to ComputeLocalClient, we've already done NextAvailableClient → ReserveClientIds → DetermineClientCmd (assuming we're built with #define CLIENTIDS), so we can look up the name of the client process and refuse to treat ssh's X forwarding as if it were local. v2: (Michel Dänzer) * Only match "ssh" itself, not other executable names starting with that prefix. * Ignore executable path for the match. v3: (Michel Dänzer) * Use GetClientCmdName (Mark Kettenis) * Perform check on Windows as well, but only ignore path on Cygwin (Martin Peres, Emil Velikov, Jon Turney) v4: (Michel Dänzer) * Cut of any colon and whatever comes after it. (Adam Jackson) * Add bugzilla reference. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93261 Signed-off-by: Adam Jackson <[email protected]> Signed-off-by: Michel Dänzer <[email protected]> (cherry picked from commit adefbaee499b9679c6cac21f52ec6545af2b36b5) diff --git a/os/access.c b/os/access.c index 2499a9f..08c4fd0 100644 --- a/os/access.c +++ b/os/access.c @@ -173,6 +173,10 @@ SOFTWARE. #endif /* WIN32 */ +#if !defined(WIN32) || defined(__CYGWIN__) +#include <libgen.h> +#endif + #define X_INCLUDE_NETDB_H #include <X11/Xos_r.h> @@ -1081,9 +1085,8 @@ ResetHosts(const char *display) } } -/* Is client on the local host */ -Bool -ComputeLocalClient(ClientPtr client) +static Bool +xtransLocalClient(ClientPtr client) { int alen, family, notused; Xtransaddr *from = NULL; @@ -1116,6 +1119,40 @@ ComputeLocalClient(ClientPtr client) return FALSE; } +/* Is client on the local host */ +Bool +ComputeLocalClient(ClientPtr client) +{ + const char *cmdname = GetClientCmdName(client); + + if (!xtransLocalClient(client)) + return FALSE; + + /* If the executable name is "ssh", assume that this client connection + * is forwarded from another host via SSH + */ + if (cmdname) { + char **cmd; + Bool ret; + + /* Cut off any colon and whatever comes after it, see + * https://lists.freedesktop.org/archives/xorg-devel/2015-December/048164.html + */ + cmd = xstrtokenize(cmdname, ":"); + +#if !defined(WIN32) || defined(__CYGWIN__) + cmd[0] = basename(cmd[0]); +#endif + + ret = strcmp(cmd[0], "ssh") != 0; + free(cmd); + + return ret; + } + + return TRUE; +} + /* * Return the uid and all gids of a connected local client * Allocates a LocalClientCredRec - caller must call FreeLocalClientCreds commit aebfc6ad9be5bd33b7e0a813d424c81d6214ab07 Author: Michel Dänzer <[email protected]> Date: Fri Jul 1 12:34:20 2016 +0900 glamor: Translate solid text background region after clipping Fixes incorrect clipping for redirected windows which don't happen to be located at the top left corner of the screen. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96742 Signed-off-by: Michel Dänzer <[email protected]> Reviewed-by: Adam Jackson <[email protected]> (cherry picked from commit e8e36755abb17872d669b88d33ca9adc511029a0) diff --git a/glamor/glamor_text.c b/glamor/glamor_text.c index c305305..cf165ca 100644 --- a/glamor/glamor_text.c +++ b/glamor/glamor_text.c @@ -446,16 +446,17 @@ glamor_image_text(DrawablePtr drawable, GCPtr gc, glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); if (width >= 0) { - box.x1 = off_x + drawable->x + x; - box.x2 = off_x + drawable->x + x + width; + box.x1 = drawable->x + x; + box.x2 = drawable->x + x + width; } else { - box.x1 = off_x + drawable->x + x + width; - box.x2 = off_x + drawable->x + x; + box.x1 = drawable->x + x + width; + box.x2 = drawable->x + x; } - box.y1 = off_y + drawable->y + y - gc->font->info.fontAscent; - box.y2 = off_y + drawable->y + y + gc->font->info.fontDescent; + box.y1 = drawable->y + y - gc->font->info.fontAscent; + box.y2 = drawable->y + y + gc->font->info.fontDescent; RegionInit(®ion, &box, 1); RegionIntersect(®ion, ®ion, gc->pCompositeClip); + RegionTranslate(®ion, off_x, off_y); glamor_solid_boxes(pixmap, RegionRects(®ion), RegionNumRects(®ion), gc->bgPixel); RegionUninit(®ion); } commit 7a08d8d82007367a90197f9e9d549dbf0bc9ca2e Author: Adam Jackson <[email protected]> Date: Tue Jul 12 10:04:18 2016 -0400 xfree86: Fix fallback driver sort order for Xorg -configure (v2) The intent here was that fallback drivers would be at the end of the list in order, but if a fallback driver happened to be at the end of the list already that's not what would happen. Rather than open-code something smarter, just use qsort. Note that qsort puts things in ascending order, so somewhat backwardsly fallbacks are greater than native drivers, and vesa is greater than modesetting. v2: Use strcmp to compare non-fallback drivers so we get a predictable result if your libc's qsort isn't stable (Keith Packard) Reviewed-by: Keith Packard <[email protected]> Signed-off-by: Adam Jackson <[email protected]> (cherry picked from commit 32a9504c69183485b0b796fa3966cd1e39992365) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 07f8fb4..26591c6 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -518,33 +518,54 @@ xf86InputDriverlistFromConfig(void) return modulearray; } +static int +is_fallback(const char *s) +{ + /* later entries are less preferred */ + const char *fallback[5] = { "modesetting", "fbdev", "vesa", "wsfb", NULL }; + int i; + + for (i = 0; fallback[i]; i++) + if (strstr(s, fallback[i])) + return i; + + return -1; +} + +static int +driver_sort(const void *_l, const void *_r) +{ + const char *l = *(const char **)_l; + const char *r = *(const char **)_r; + int left = is_fallback(l); + int right = is_fallback(r); + + /* neither is a fallback, asciibetize */ + if (left == -1 && right == -1) + return strcmp(l, r); + + /* left is a fallback */ + if (left >= 0) + return 1; + + /* right is a fallback */ + if (right >= 0) + return -1; + + /* both are fallbacks, which is worse */ + return left - right; +} + static void fixup_video_driver_list(const char **drivers) { - static const char *fallback[5] = { "modesetting", "fbdev", "vesa", "wsfb", NULL }; - const char **end, **drv; - const char *x; - int i; + const char **end; /* walk to the end of the list */ for (end = drivers; *end && **end; end++); end--; - /* - * for each of the fallback drivers, if we find it in the list, - * swap it with the last available non-fallback driver. - */ - for (i = 0; fallback[i]; i++) { - for (drv = drivers; drv != end; drv++) { - if (strstr(*drv, fallback[i])) { - x = *drv; - *drv = *end; - *end = x; - end--; - break; - } - } - } + qsort(drivers, end - drivers, sizeof(const char *), driver_sort); } static const char ** commit 8ff830d1ea4c3572b8fb770009c73c40007e132a Author: Andrew Eikum <[email protected]> Date: Wed Jul 6 14:13:09 2016 -0500 shm: Also censor images returned by ShmGetImage We currently censor images from dix's GetImage, but not from ShmGetImage. This is a method to bypass XACE, creating a potential leak. We should censor in both methods. Reviewed-by: Adam Jackson <[email protected]> Signed-off-by: Andrew Eikum <[email protected]> (cherry picked from commit 4926845a57fa8b53e18ea7d3434bf5539e9b7782) diff --git a/Xext/shm.c b/Xext/shm.c index b359a90..2a3448d 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -619,6 +619,7 @@ ProcShmGetImage(ClientPtr client) xShmGetImageReply xgi; ShmDescPtr shmdesc; VisualID visual = None; + RegionPtr pVisibleRegion = NULL; int rc; REQUEST(xShmGetImageReq); @@ -650,6 +651,9 @@ ProcShmGetImage(ClientPtr client) wBorderWidth((WindowPtr) pDraw) + (int) pDraw->height) return BadMatch; visual = wVisual(((WindowPtr) pDraw)); + pVisibleRegion = NotClippedByChildren((WindowPtr) pDraw); + if (pVisibleRegion) + RegionTranslate(pVisibleRegion, -pDraw->x, -pDraw->y); } else { if (stuff->x < 0 || @@ -686,6 +690,11 @@ ProcShmGetImage(ClientPtr client) stuff->width, stuff->height, stuff->format, stuff->planeMask, shmdesc->addr + stuff->offset); + if (pVisibleRegion) + XaceCensorImage(client, pVisibleRegion, + PixmapBytePad(stuff->width, pDraw->depth), pDraw, + stuff->x, stuff->y, stuff->width, stuff->height, + stuff->format, shmdesc->addr + stuff->offset); } else { @@ -697,11 +706,19 @@ ProcShmGetImage(ClientPtr client) stuff->width, stuff->height, stuff->format, plane, shmdesc->addr + length); + if (pVisibleRegion) + XaceCensorImage(client, pVisibleRegion, + BitmapBytePad(stuff->width), pDraw, + stuff->x, stuff->y, stuff->width, stuff->height, + stuff->format, shmdesc->addr + length); length += lenPer; } } } + if (pVisibleRegion) + RegionDestroy(pVisibleRegion); + if (client->swapped) { swaps(&xgi.sequenceNumber); swapl(&xgi.length); commit d4cbb1155a79a3dc1dc74cc155dbcfc303273856 Author: Rui Matos <[email protected]> Date: Wed Jul 13 19:19:09 2016 +0200 xwayland: Update RR state on wl_output.done instead of wl_output.mode Otherwise if the geometry changes but the mode doesn't we end up with the previous geometry from RR's point of view. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=768710 Reviewed-by: Jonas Ådahl <[email protected]> Signed-off-by: Rui Matos <[email protected]> (cherry picked from commit cf6730c503f8090a5d1b80918fe253fc2c5bc090) diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c index 4903062..b66da13 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c @@ -98,7 +98,6 @@ output_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags, int width, int height, int refresh) { struct xwl_output *xwl_output = data; - RRModePtr randr_mode; if (!(flags & WL_OUTPUT_MODE_CURRENT)) return; @@ -111,13 +110,7 @@ output_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags, xwl_output->height = width; } - randr_mode = xwayland_cvt(width, height, refresh / 1000.0, 0, 0); - - RROutputSetModes(xwl_output->randr_output, &randr_mode, 1, 1); - - RRCrtcNotify(xwl_output->randr_crtc, randr_mode, - xwl_output->x, xwl_output->y, - xwl_output->rotation, NULL, 1, &xwl_output->randr_output); + xwl_output->refresh = refresh; } static inline void @@ -198,6 +191,14 @@ output_handle_done(void *data, struct wl_output *wl_output) struct xwl_output *it, *xwl_output = data; struct xwl_screen *xwl_screen = xwl_output->xwl_screen; int width = 0, height = 0, has_this_output = 0; + RRModePtr randr_mode; + + randr_mode = xwayland_cvt(xwl_output->width, xwl_output->height, + xwl_output->refresh / 1000.0, 0, 0); + RROutputSetModes(xwl_output->randr_output, &randr_mode, 1, 1); + RRCrtcNotify(xwl_output->randr_crtc, randr_mode, + xwl_output->x, xwl_output->y, + xwl_output->rotation, NULL, 1, &xwl_output->randr_output); xorg_list_for_each_entry(it, &xwl_screen->output_list, link) { /* output done event is sent even when some property diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h index 67b30cb..232d9f4 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -147,7 +147,7 @@ struct xwl_output { struct xwl_screen *xwl_screen; RROutputPtr randr_output; RRCrtcPtr randr_crtc; - int32_t x, y, width, height; + int32_t x, y, width, height, refresh; Rotation rotation; }; commit 65c5eab6000f108762b7ef6b63869525222ff99d Author: Michel Dänzer <[email protected]> Date: Tue Jun 28 17:22:47 2016 +0900 dix: Work around non-premultiplied ARGB cursor data Some games incorrectly use non-premultiplied ARGB cursor data, presumably because that's what Windows uses. On some hardware (and with SWcursor), this breaks areas of the cursor which are supposed to be transparent (and presumably also translucent areas, but that's less noticeable). This change checks for pixels with alpha == 0 and any non-alpha component != 0. If any such pixel is found, the data is assumed to be non-premultiplied and fixed up by multiplying the RGB components with the alpha component. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92309 Signed-off-by: Michel Dänzer <[email protected]> Reviewed-by: Alex Deucher <[email protected]> (cherry picked from commit 401a8d6e1379133863e3271374dc21850d0d3cab) diff --git a/dix/cursor.c b/dix/cursor.c index e459456..25d6767 100644 --- a/dix/cursor.c +++ b/dix/cursor.c @@ -288,6 +288,29 @@ AllocARGBCursor(unsigned char *psrcbits, unsigned char *pmaskbits, goto error; *ppCurs = pCurs; + + if (argb) { + size_t i, size = bits->width * bits->height; + + for (i = 0; i < size; i++) { + if ((argb[i] & 0xff000000) == 0 && (argb[i] & 0xffffff) != 0) { + /* ARGB data doesn't seem pre-multiplied, fix it */ + for (i = 0; i < size; i++) { + CARD32 a, ar, ag, ab; + + a = argb[i] >> 24; + ar = a * ((argb[i] >> 16) & 0xff) / 0xff; + ag = a * ((argb[i] >> 8) & 0xff) / 0xff; + ab = a * (argb[i] & 0xff) / 0xff; + + argb[i] = a << 24 | ar << 16 | ag << 8 | ab; + } + + break; + } + } + } + return Success; error: commit c0b02ce45f48450d2896a424dc1eb9a2827ed4c5 Author: Hans De Goede <[email protected]> Date: Thu Jul 7 10:55:04 2016 +0200 linux: Do not try to open /dev/vc/0, fix error msg when /dev/tty0 open fails /dev/vc/0 is a devfs thing which is long dead, so stop trying to open /dev/vc/0, besides being a (small) code cleanup this will also fix the "parse_vt_settings: Cannot open /dev/tty0 (%s)\n" error message to display the actual error, rather then the -ENOENT from also trying /dev/vc/0. BugLink: https://patchwork.freedesktop.org/patch/8768/ Reported-by: Chad Versace <[email protected]> Suggested-by: Julien Cristau <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Julien Cristau <[email protected]> Reviewed-by: Chad Versace <[email protected]> (cherry picked from commit 033888e7766d226a179357d970223428c19c4b53) diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c index 1ed213c..ca17493 100644 --- a/hw/xfree86/os-support/linux/lnx_init.c +++ b/hw/xfree86/os-support/linux/lnx_init.c @@ -93,7 +93,6 @@ linux_parse_vt_settings(int may_fail) struct vt_stat vts; struct stat st; MessageType from = X_PROBED; - const char *tty0[] = { "/dev/tty0", "/dev/vc/0", NULL }; /* Only do this once */ static int vt_settings_parsed = 0; @@ -108,14 +107,7 @@ linux_parse_vt_settings(int may_fail) from = X_CMDLINE; } else { - - i = 0; - while (tty0[i] != NULL) { - if ((fd = open(tty0[i], O_WRONLY, 0)) >= 0) - break; - i++; - } - + fd = open("/dev/tty0", O_WRONLY, 0); if (fd < 0) { if (may_fail) return 0; commit b377a806693ec86df1743d7ddd5a931c88050ebb Author: Adam Jackson <[email protected]> Date: Mon Jul 18 12:46:51 2016 -0400 modesetting: resubmit dirty rects on EINVAL (v2) This error code can mean we're submitting more rects at once than the driver can handle. If that happens, resubmit one at a time. v2: Make the rect submit loop more error-proof (Walter Harms) Signed-off-by: Adam Jackson <[email protected]> Reviewed-by: Michael Thayer <[email protected]> (cherry picked from commit 4b311d23e84356bd0e9e736aeed7448dd6382118) diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index 6133d2d..14f80b3 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -502,6 +502,15 @@ dispatch_dirty_region(ScrnInfoPtr scrn, /* TODO query connector property to see if this is needed */ ret = drmModeDirtyFB(ms->fd, fb_id, clip, num_cliprects); + + /* if we're swamping it with work, try one at a time */ + if (ret == -EINVAL) { + for (i = 0; i < num_cliprects; i++) { + if ((ret = drmModeDirtyFB(ms->fd, fb_id, &clip[i], 1)) < 0) + break; + } + } + free(clip); DamageEmpty(damage); } commit f091528457cc62fa9bd6cd24aeebacffb7296419 Author: Dave Airlie <[email protected]> Date: Wed Jul 22 12:14:06 2015 -0400 modesetting: Implement 32->24 bpp conversion in shadow update 24bpp front buffers tend to be the least well tested path for client rendering. On the qemu cirrus emulation, and on some Matrox G200 server chips, the hardware can't do 32bpp at all. It's better to just allocate a 32bpp shadow and downconvert in the upload hook than expose a funky pixmap format to clients. [ajax: Ported from RHEL and separate modesetting driver, lifted kbpp into the drmmode struct, cleaned up commit message, fixed 16bpp] Reviewed-by: Adam Jackson <[email protected]> Signed-off-by: Dave Airlied <[email protected]> Reviewed-by: Alex Deucher <[email protected]> [[email protected]: rebase, also use kbpp for rotate shadow fb] Signed-off-by: Hans de Goede <[email protected]> (cherry picked from commit 21217d02168d1883b2d1f64399aec494f96a8b9d) diff --git a/hw/xfree86/drivers/modesetting/Makefile.am b/hw/xfree86/drivers/modesetting/Makefile.am index 82c4f2f..ca7e05a 100644 --- a/hw/xfree86/drivers/modesetting/Makefile.am +++ b/hw/xfree86/drivers/modesetting/Makefile.am @@ -51,6 +51,8 @@ modesetting_drv_la_SOURCES = \ dumb_bo.c \ dumb_bo.h \ present.c \ + sh3224.c \ + sh3224.h \ vblank.c \ $(NULL) diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index e7f6e8d..6133d2d 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -60,6 +60,7 @@ #endif #include "driver.h" +#include "sh3224.h" static void AdjustFrame(ScrnInfoPtr pScrn, int x, int y); static Bool CloseScreen(ScreenPtr pScreen); @@ -662,6 +663,11 @@ try_enable_glamor(ScrnInfoPtr pScrn) ms->drmmode.glamor = FALSE; #ifdef GLAMOR + if (ms->drmmode.force_24_32) { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Cannot use glamor with 24bpp packed fb\n"); + return; + } + if (!do_glamor) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "glamor disabled\n"); return; @@ -810,10 +816,16 @@ PreInit(ScrnInfoPtr pScrn, int flags) ms->drmmode.fd = ms->fd; drmmode_get_default_bpp(pScrn, &ms->drmmode, &defaultdepth, &defaultbpp); - if (defaultdepth == 24 && defaultbpp == 24) - bppflags = SupportConvert32to24 | Support24bppFb; - else - bppflags = PreferConvert24to32 | SupportConvert24to32 | Support32bppFb; + if (defaultdepth == 24 && defaultbpp == 24) { + ms->drmmode.force_24_32 = TRUE; + ms->drmmode.kbpp = 24; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Using 24bpp hw front buffer with 32bpp shadow\n"); + defaultbpp = 32; + } else { + ms->drmmode.kbpp = defaultbpp; + } + bppflags = PreferConvert24to32 | SupportConvert24to32 | Support32bppFb; if (!xf86SetDepthBpp (pScrn, defaultdepth, defaultdepth, defaultbpp, bppflags)) @@ -867,18 +879,24 @@ PreInit(ScrnInfoPtr pScrn, int flags) } else { Bool prefer_shadow = TRUE; - ret = drmGetCap(ms->fd, DRM_CAP_DUMB_PREFER_SHADOW, &value); - if (!ret) { - prefer_shadow = !!value; - } + if (ms->drmmode.force_24_32) { + prefer_shadow = TRUE; + ms->drmmode.shadow_enable = TRUE; + } else { + ret = drmGetCap(ms->fd, DRM_CAP_DUMB_PREFER_SHADOW, &value); + if (!ret) { + prefer_shadow = !!value; + } - ms->drmmode.shadow_enable = xf86ReturnOptValBool(ms->drmmode.Options, - OPTION_SHADOW_FB, - prefer_shadow); + ms->drmmode.shadow_enable = + xf86ReturnOptValBool(ms->drmmode.Options, OPTION_SHADOW_FB, + prefer_shadow); + } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ShadowFB: preferred %s, enabled %s\n", prefer_shadow ? "YES" : "NO", + ms->drmmode.force_24_32 ? "FORCE" : ms->drmmode.shadow_enable ? "YES" : "NO"); ms->drmmode.pageflip = FALSE; @@ -950,7 +968,7 @@ msShadowWindow(ScreenPtr screen, CARD32 row, CARD32 offset, int mode, modesettingPtr ms = modesettingPTR(pScrn); int stride; - stride = (pScrn->displayWidth * pScrn->bitsPerPixel) / 8; + stride = (pScrn->displayWidth * ms->drmmode.kbpp) / 8; *size = stride; return ((uint8_t *) ms->drmmode.front_bo.dumb->ptr + row * stride + offset); @@ -971,6 +989,7 @@ CreateScreenResources(ScreenPtr pScreen) Bool ret;

