diff options
author | Keith Packard <keithp@keithp.com> | 2017-10-12 21:24:40 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2017-10-12 21:25:20 -0700 |
commit | 8ea2ac5341a7f2b82ab0ecaef89e606ba381592e (patch) | |
tree | 039cabeb379aafeae0c12cedea7433b6022e9261 | |
parent | fd3a78649e4ed986e621d8e6e88a247888139049 (diff) |
xf86: Turn crtc->enabled off while leased
This makes the modesetting code ignore all leased crtcs
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | hw/xfree86/drivers/modesetting/drmmode_display.c | 2 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.c | 2 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.h | 3 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86RandR12.c | 14 |
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) { |