xserver-multidpi/hw/xfree86
Eric Anholt 77e51d5bbb Revert "DRI2: re-allocate DRI2 drawable if pixmap serial changes"
This reverts commit 3209b094a3.  After a
long debug session by Paul Berry, it appears that this was the commit
that has been producing sporadic failures in piglit front buffer
rendering tests for the last several years.

GetBuffers may return fresh buffers with invalid contents at a couple
reasonable times:

- When first asked for a non-fake-front buffer.
- When the drawable size is changed, an Invalidate has been sent, and
  obviously the app needs to redraw the whole buffer.
- After a glXSwapBuffers(), GL allows the backbuffer to be undefined,
  and an Invalidate was sent to tell the GL that it should grab these
  appropriate new buffers to avoid stalling.

But with the patch being reverted, GetBuffers would also return fresh
invalid buffers when the drawable serial number changed, which is
approximately "whenever, for any reason".  The app is not expecting
invalid buffer contents "whenever", nor is it valid.  Because the GL
usually only GetBuffers after an Invalidate is sent, and the new
buffer allocation only happened during a GetBuffers, most apps saw no
problems.  But apps that do (fake-)frontbuffer rendering do frequently
ask the server for the front buffer (since we drop the fake front
allocation when we're not doing front buffer rendering), and if the
drawable serial got bumped midway through a draw, the server would
pointlessly ditch the front *and* backbuffer full of important
drawing, resulting in bad rendering.

The patch was originally to fix bugzilla:
https://bugs.freedesktop.org/show_bug.cgi?id=28365
Specifically:

    To reproduce, start with a large-ish display (i.e. 1680x1050 on my
    laptop), use the patched glxgears from bug 28252 to add the
    -override option.  Then run glxgears -override -geometry 640x480
    to create a 640x480 window in the top left corner, which will work
    fine.  Next, run xrandr -s 640x480 and watch the fireworks.

I've tested with an override-redirect glxgears, both with vblank sync
enabled and disabled, both with gnome-shell and no window manager at
all, before and after this patch.  The only problem observed was that
before and after the revert, sometimes when alt-tabbing to kill my
gears after completing the test gnome-shell would get confused about
override-redirectness of the glxgears window (according to a log
message) and apparently not bother doing any further compositing.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-06-18 10:54:22 -07:00
..
common Merge remote-tracking branch 'alanc/master' 2013-05-06 10:52:40 -07:00
ddc Define prototypes for hw/xfree86/modes/xf86Modes.c only in xf86Modes.h. 2013-04-08 09:19:34 -07:00
dixmods Constify extensions in LoadExtension users 2012-11-21 11:13:55 +11:00
doc dix: Remove refs to mi backing store from docs 2012-09-23 10:31:39 -07:00
dri Merge remote-tracking branch 'yselkowitz/master' 2012-12-19 12:22:03 -08:00
dri2 Revert "DRI2: re-allocate DRI2 drawable if pixmap serial changes" 2013-06-18 10:54:22 -07:00
exa api: rework the X server driver API to avoid global arrays. 2012-06-05 13:22:18 +01:00
fbdevhw Define prototypes for hw/xfree86/modes/xf86Modes.c only in xf86Modes.h. 2013-04-08 09:19:34 -07:00
i2c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
int10 int10: fix pci_device_read_rom usage 2012-10-04 13:06:02 -07:00
loader Fix up formatting of initializers for arrays of structs 2012-08-06 15:22:53 -07:00
man xserver: add monitor Option "ZoomModes" [v2] 2013-03-26 13:53:06 -07:00
modes Abstract cursor refcounting 2013-05-15 19:17:57 +10:00
os-support sparcPromPathname2Node: free name when returning error, instead of leaking it 2013-04-24 14:22:36 -07:00
parser Remove obsolete tab stop comments from hw/xfree86/parser/*.c 2012-06-20 21:41:52 -07:00
ramdac Abstract cursor refcounting 2013-05-15 19:17:57 +10:00
shadowfb api: rework the X server driver API to avoid global arrays. 2012-06-05 13:22:18 +01:00
utils Define prototypes for hw/xfree86/modes/xf86Modes.c only in xf86Modes.h. 2013-04-08 09:19:34 -07:00
vbe Define prototypes for hw/xfree86/modes/xf86Modes.c only in xf86Modes.h. 2013-04-08 09:19:34 -07:00
vgahw xf86dga: handle DGAAvailable for gpu screens. (v2) 2012-07-07 10:37:10 +01:00
x86emu Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
.gitignore xfree86: Move sdksyms generation to ddx toplevel 2011-06-23 05:28:31 -07:00
Makefile.am Remove XAA 2012-07-10 00:41:57 -07:00
sdksyms.sh dix: fix redundant redeclaration warnings in dixfont 2012-11-05 13:24:59 -06:00
xorgconf.cpp xfree86: use sed rather than cpp to perform string substitutions 2011-01-18 15:11:14 -08:00