summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-01-30 14:19:41 -0800
committerKeith Packard <keithp@keithp.com>2009-02-17 19:07:13 -0800
commit4302a32391711ea86051c7e6d90cb018c79beec2 (patch)
tree31eb81c5cb7cbda9335c72b11ad11ade96d23f87 /hw
parent09cde70a6b3a05c28014862db19b36650412c2f3 (diff)
Make crtc_notify wrap/unwrap code do nothing unless mode code is inuse
Drivers not using the new hw/xfree86/modes code would crash in DRI due to that code trying to monitor CRTC changes. (cherry picked from commit ea309e47457156b60aadbf113f04e5b6851029c8) Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/modes/xf86Crtc.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index c35eba707..f09b9b895 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -2987,22 +2987,29 @@ xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn,
xf86_crtc_notify_proc_ptr
xf86_wrap_crtc_notify (ScreenPtr screen, xf86_crtc_notify_proc_ptr new)
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- xf86_crtc_notify_proc_ptr old;
-
- old = config->xf86_crtc_notify;
- config->xf86_crtc_notify = new;
- return old;
+ if (xf86CrtcConfigPrivateIndex != -1)
+ {
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ xf86_crtc_notify_proc_ptr old;
+
+ old = config->xf86_crtc_notify;
+ config->xf86_crtc_notify = new;
+ return old;
+ }
+ return NULL;
}
void
xf86_unwrap_crtc_notify(ScreenPtr screen, xf86_crtc_notify_proc_ptr old)
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
-
- config->xf86_crtc_notify = old;
+ if (xf86CrtcConfigPrivateIndex != -1)
+ {
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+
+ config->xf86_crtc_notify = old;
+ }
}
void