diff options
author | Dave Airlie <airlied@redhat.com> | 2012-06-18 14:11:24 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-07-07 10:37:11 +0100 |
commit | 88bc02bfaae2c15a30c606d34cf7940e6ad5ea14 (patch) | |
tree | de106a2beb349724088c5f49f2793363a91c2187 | |
parent | 9b8217f9ef6279fff6628631d18497bed0343ef9 (diff) |
xf86/crtc: add new interface to detach slave crtcs
This will detach any scanout pixmaps attached to slave crtcs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.c | 20 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.h | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 31efd83f6..6a005cd7b 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -3228,3 +3228,23 @@ xf86ProviderSetup(ScrnInfoPtr scrn, #endif } +void +xf86DetachAllCrtc(ScrnInfoPtr scrn) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + int i; + + for (i = 0; i < xf86_config->num_crtc; i++) { + xf86CrtcPtr crtc = xf86_config->crtc[i]; + + if (crtc->randr_crtc) + RRCrtcDetachScanoutPixmap(crtc->randr_crtc); + + /* dpms off */ + (*crtc->funcs->dpms) (crtc, DPMSModeOff); + /* force a reset the next time its used */ + crtc->randr_crtc->mode = NULL; + crtc->mode.HDisplay = 0; + crtc->x = crtc->y = 0; + } +} diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index 25fb34d72..38b9ea58a 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -1014,4 +1014,7 @@ extern _X_EXPORT void xf86ProviderSetup(ScrnInfoPtr scrn, const xf86ProviderFuncsRec * funcs, const char *name); +extern _X_EXPORT void +xf86DetachAllCrtc(ScrnInfoPtr scrn); + #endif /* _XF86CRTC_H_ */ |