summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/xfree86/drivers/modesetting/drmmode_display.c2
-rw-r--r--hw/xfree86/modes/xf86Crtc.c2
-rw-r--r--hw/xfree86/modes/xf86Crtc.h3
-rw-r--r--hw/xfree86/modes/xf86RandR12.c14
4 files changed, 20 insertions, 1 deletions
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 7ca6cd996..223025631 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -2137,6 +2137,8 @@ drmmode_create_lease(RRLeasePtr lease, int *fd)
lease->devPrivate = lease_private;
+ xf86CrtcLeaseStarted(lease);
+
*fd = lease_fd;
return Success;
}
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 7ea7decf6..2c9331e3f 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -254,7 +254,7 @@ xf86CrtcSetModeTransform(xf86CrtcPtr crtc, DisplayModePtr mode,
RRTransformRec saved_transform;
Bool saved_transform_present;
- crtc->enabled = xf86CrtcInUse(crtc);
+ crtc->enabled = xf86CrtcInUse(crtc) && !RRCrtcIsLeased(crtc->randr_crtc);;
/* We only hit this if someone explicitly sends a "disabled" modeset. */
if (!crtc->enabled) {
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index e43e8d447..e3aaf1af6 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -756,6 +756,9 @@ typedef struct _xf86CrtcConfigFuncs {
extern _X_EXPORT void
xf86CrtcLeaseTerminated(RRLeasePtr lease);
+extern _X_EXPORT void
+xf86CrtcLeaseStarted(RRLeasePtr lease);
+
typedef void (*xf86_crtc_notify_proc_ptr) (ScreenPtr pScreen);
typedef struct _xf86CrtcConfig {
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index c55ab7c90..6c6970952 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -2176,6 +2176,7 @@ xf86CrtcLeaseTerminated(RRLeasePtr lease)
RRCrtcPtr randr_crtc = lease->crtcs[c];
xf86CrtcPtr crtc = randr_crtc->devPrivate;
+ crtc->enabled = xf86CrtcInUse(crtc);
if (crtc->enabled) {
RRTransformPtr transform;
@@ -2191,6 +2192,19 @@ xf86CrtcLeaseTerminated(RRLeasePtr lease)
RRLeaseTerminated(lease);
}
+void
+xf86CrtcLeaseStarted(RRLeasePtr lease)
+{
+ int c;
+
+ for (c = 0; c < lease->numCrtcs; c++) {
+ RRCrtcPtr randr_crtc = lease->crtcs[c];
+ xf86CrtcPtr crtc = randr_crtc->devPrivate;
+
+ crtc->enabled = FALSE;
+ }
+}
+
static int
xf86RandR16CreateLease(ScreenPtr screen, RRLeasePtr randr_lease, int *fd)
{