[RFC] modesetting: Check if crtc supports vblank during check_flip

Submitted by Deepak Singh Rawat on July 5, 2019, 8:12 p.m.


Message ID 20190705201211.21627-1-drawat@vmware.com
State New
Headers show
Series "modesetting: Check if crtc supports vblank during check_flip" ( rev: 1 ) in X.org

Not browsing as part of any series.

Commit Message

Deepak Singh Rawat July 5, 2019, 8:12 p.m.
Present extension doesn't work for CRTC's which do not support vblank.


While testing modesetting driver with vmware platform I realized it's
not working because vmwgfx doesn't support vblank. So this patch to add
check for vblank during check_flip. Also I see that when flip is
disabled drmModeDirtyFB is called which updates the screen, should the
behavior be same in case of flip? What I observed is that the "flip"
callback is not called.

I would really appreciate any help.


Signed-off-by: Deepak Rawat <drawat@vmware.com>
 hw/xfree86/drivers/modesetting/present.c | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/hw/xfree86/drivers/modesetting/present.c b/hw/xfree86/drivers/modesetting/present.c
index dda7cc064..1d0af711b 100644
--- a/hw/xfree86/drivers/modesetting/present.c
+++ b/hw/xfree86/drivers/modesetting/present.c
@@ -221,6 +221,8 @@  ms_present_check_flip(RRCrtcPtr crtc,
     ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     modesettingPtr ms = modesettingPTR(scrn);
     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+    xf86CrtcPtr xf86_crtc = crtc->devPrivate;
+    CARD64 ust, msc;
     int num_crtcs_on = 0;
     int i;
     struct gbm_bo *gbm;
@@ -273,6 +275,9 @@  ms_present_check_flip(RRCrtcPtr crtc,
+    if (ms_get_crtc_ust_msc(xf86_crtc, &ust, &msc) == BadMatch)
+        return FALSE;
     /* Make sure there's a bo we can get to */
     /* XXX: actually do this.  also...is it sufficient?
      * if (!glamor_get_pixmap_private(pixmap))