randr: cleanup provider properly
authorDave Airlie <airlied@redhat.com>
Wed, 9 Jan 2013 02:58:28 +0000 (12:58 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 1 Mar 2013 08:14:28 +0000 (18:14 +1000)
commit8f4640bdb9d3988148e09a08d2c7e3bab1d538d6
tree965b9a262246c80d860fe8ebb5fb9ceeb6c910fd
parent3ec35c45ca17f5ed6fd02c50fc49ae7b8d128dcb
randr: cleanup provider properly

So in the cold plug server shutdown case, we reap the resources
before we call CloseScreen handlers, so the config->randr_provider
is a dangling pointer when the xf86CrtcCloseScreen handler is called,

however in the hot screen unplug case, we can't rely on automatically
reaped resources, so we need to clean up the provider in the xf86CrtcCloseScreen
case.

This patch provides a cleanup callback from the randr provider removal
into the DDX so it can cleanup properly, this then gets called by the automatic
code for cold plug, or if hot unplug it gets called explicitly.

Fixes a number of random server crashes on shutdown
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58174
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=891140

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
hw/xfree86/modes/xf86Crtc.c
hw/xfree86/modes/xf86RandR12.c
randr/randrstr.h
randr/rrprovider.c