xfree86: detach scanout pixmaps when detaching output GPUs
authorAaron Plattner <aplattner@nvidia.com>
Tue, 30 Apr 2013 21:14:23 +0000 (14:14 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 25 Jul 2013 18:15:53 +0000 (11:15 -0700)
commitbdd1e22cbde9ea2324e4e1991c9e152f22f88151
tree61345c257f0c504978df8c312b6b354dc34baefc
parent43ac0491e36cdbb716b5c9d39c97d0aba3bebd75
xfree86: detach scanout pixmaps when detaching output GPUs

Commit 8f4640bdb9d3988148e09a08d2c7e3bab1d538d6 fixed a bit of a
chicken-and-egg problem by detaching GPU screens when their providers
are destroyed, which happens before CloseScreen is called.  However,
this created a new problem: the GPU screen tears down its RandR crtc
objects during CloseScreen and if one of them is active, it tries to
detach the scanout pixmap then.  This crashes because
RRCrtcDetachScanoutPixmap tries to get the master screen's screen
pixmap, but crtc->pScreen->current_master is already NULL at that
point.

It doesn't make sense for an unbound GPU screen to still be scanning
out its former master screen's pixmap, so detach them first when the
provider is destroyed.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
hw/xfree86/modes/xf86RandR12.c