diff options
author | Keith Packard <keithp@keithp.com> | 2009-01-30 14:19:41 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-01-30 14:19:41 -0800 |
commit | ea309e47457156b60aadbf113f04e5b6851029c8 (patch) | |
tree | e4e8fe384b40d7e0f2f439255175cc33f4d9dc5e | |
parent | fff00df94d7ebd18a8e24537ec96073717375a3f (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.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index cb13debb3..217e01c75 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c | |||
@@ -3117,22 +3117,29 @@ xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn, | |||
3117 | xf86_crtc_notify_proc_ptr | 3117 | xf86_crtc_notify_proc_ptr |
3118 | xf86_wrap_crtc_notify (ScreenPtr screen, xf86_crtc_notify_proc_ptr new) | 3118 | xf86_wrap_crtc_notify (ScreenPtr screen, xf86_crtc_notify_proc_ptr new) |
3119 | { | 3119 | { |
3120 | ScrnInfoPtr scrn = xf86Screens[screen->myNum]; | 3120 | if (xf86CrtcConfigPrivateIndex != -1) |
3121 | xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); | 3121 | { |
3122 | xf86_crtc_notify_proc_ptr old; | 3122 | ScrnInfoPtr scrn = xf86Screens[screen->myNum]; |
3123 | 3123 | xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); | |
3124 | old = config->xf86_crtc_notify; | 3124 | xf86_crtc_notify_proc_ptr old; |
3125 | config->xf86_crtc_notify = new; | 3125 | |
3126 | return old; | 3126 | old = config->xf86_crtc_notify; |
3127 | config->xf86_crtc_notify = new; | ||
3128 | return old; | ||
3129 | } | ||
3130 | return NULL; | ||
3127 | } | 3131 | } |
3128 | 3132 | ||
3129 | void | 3133 | void |
3130 | xf86_unwrap_crtc_notify(ScreenPtr screen, xf86_crtc_notify_proc_ptr old) | 3134 | xf86_unwrap_crtc_notify(ScreenPtr screen, xf86_crtc_notify_proc_ptr old) |
3131 | { | 3135 | { |
3132 | ScrnInfoPtr scrn = xf86Screens[screen->myNum]; | 3136 | if (xf86CrtcConfigPrivateIndex != -1) |
3133 | xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); | 3137 | { |
3134 | 3138 | ScrnInfoPtr scrn = xf86Screens[screen->myNum]; | |
3135 | config->xf86_crtc_notify = old; | 3139 | xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); |
3140 | |||
3141 | config->xf86_crtc_notify = old; | ||
3142 | } | ||
3136 | } | 3143 | } |
3137 | 3144 | ||
3138 | void | 3145 | void |