aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/drivers/modesetting/vblank.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2015-01-04 16:25:32 +0100
committermarha <marha@users.sourceforge.net>2015-01-04 16:25:32 +0100
commit5e5a48ff8cd08f123601cd0625ca62a86675aac9 (patch)
treeea1c2cee139e8e1ce389a7f956e9874db1e0a650 /xorg-server/hw/xfree86/drivers/modesetting/vblank.c
parenta1011d63ffb5cc4f41bf0f4622ee3f1493d419d9 (diff)
downloadvcxsrv-5e5a48ff8cd08f123601cd0625ca62a86675aac9.tar.gz
vcxsrv-5e5a48ff8cd08f123601cd0625ca62a86675aac9.tar.bz2
vcxsrv-5e5a48ff8cd08f123601cd0625ca62a86675aac9.zip
fontconfig libX11 mesa xserver git update 4 Jan 2015
xserver commit dc777c346d5d452a53b13b917c45f6a1bad2f20b libX11 commit 446f5f7f41317a85a0cd0efa5e6a1b37bc99fba2 fontconfig commit 4420b27c074821a1d1f9d6ebe822a610176a417d mesa commit 48094d0e6554a9df36bf00fc2793ade46cf92406
Diffstat (limited to 'xorg-server/hw/xfree86/drivers/modesetting/vblank.c')
-rw-r--r--xorg-server/hw/xfree86/drivers/modesetting/vblank.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/xorg-server/hw/xfree86/drivers/modesetting/vblank.c b/xorg-server/hw/xfree86/drivers/modesetting/vblank.c
index 5031ef8ff..711f6edb3 100644
--- a/xorg-server/hw/xfree86/drivers/modesetting/vblank.c
+++ b/xorg-server/hw/xfree86/drivers/modesetting/vblank.c
@@ -88,6 +88,14 @@ static int ms_box_area(BoxPtr box)
return (int)(box->x2 - box->x1) * (int)(box->y2 - box->y1);
}
+static Bool
+ms_crtc_on(xf86CrtcPtr crtc)
+{
+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+
+ return crtc->enabled && drmmode_crtc->dpms_mode == DPMSModeOn;
+}
+
/*
* Return the crtc covering 'box'. If two crtcs cover a portion of
* 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc
@@ -114,7 +122,7 @@ ms_covering_crtc(ScrnInfoPtr scrn,
crtc = xf86_config->crtc[c];
/* If the CRTC is off, treat it as not covering */
- if (!crtc->enabled)
+ if (!ms_crtc_on(crtc))
continue;
ms_crtc_box(crtc, &crtc_box);
@@ -323,6 +331,24 @@ ms_drm_abort_scrn(ScrnInfoPtr scrn)
}
/*
+ * Externally usable abort function that uses a callback to match a single
+ * queued entry to abort
+ */
+void
+ms_drm_abort(ScrnInfoPtr scrn, Bool (*match)(void *data, void *match_data),
+ void *match_data)
+{
+ struct ms_drm_queue *q;
+
+ xorg_list_for_each_entry(q, &ms_drm_queue, list) {
+ if (match(q->data, match_data)) {
+ ms_drm_abort_one(q);
+ break;
+ }
+ }
+}
+
+/*
* General DRM kernel handler. Looks for the matching sequence number in the
* drm event queue and calls the handler for it.
*/