[PATCH 29/36] xf86/crtc: add new interface to detach slave crtcs.
Dave Airlie
airlied at gmail.com
Mon Jul 2 03:13:22 PDT 2012
From: Dave Airlie <airlied at redhat.com>
This will detach any scanout pixmaps attached to slave crtcs.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
hw/xfree86/modes/xf86Crtc.c | 20 ++++++++++++++++++++
hw/xfree86/modes/xf86Crtc.h | 3 +++
2 files changed, 23 insertions(+)
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 238fb91..68291c4 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -3248,3 +3248,23 @@ xf86SetCurrentRole(ScrnInfoPtr scrn, uint32_t role)
RRProviderSetCurrentRole(config->provider->randr_provider, scrn->current_role);
}
+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 ae4b5e0..662157b 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -1038,4 +1038,7 @@ xf86ProviderCreate(ScrnInfoPtr scrn,
extern _X_EXPORT void
xf86SetCurrentRole(ScrnInfoPtr scrn, uint32_t role);
+extern _X_EXPORT void
+xf86DetachAllCrtc(ScrnInfoPtr scrn);
+
#endif /* _XF86CRTC_H_ */
--
1.7.10.2
More information about the xorg-devel
mailing list