Skip to contentSkip to conversation

drm/sun4i: Report proper vblank

PATCH New Maxime Ripard 1 participant 2 messages Jun 20, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/sun4i: Report proper vblank

The sun4i display engine doesn't have any vblank counter. Use the proper helper for that.

---
 drivers/gpu/drm/sun4i/sun4i_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/sun4i/sun4i_drv.c +1 -1
index 257d2b4f3645..cbe4a25a748c 100644
@@ -92,7 +92,7 @@ static struct drm_driver sun4i_drv_driver = {
 	/* Frame Buffer Operations */
 
 	/* VBlank Operations */
-	.get_vblank_counter	= drm_vblank_count,
+	.get_vblank_counter	= drm_vblank_no_hw_counter,
 	.enable_vblank		= sun4i_drv_enable_vblank,
 	.disable_vblank		= sun4i_drv_disable_vblank,
 };
Signature · 6 lines
2.9.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 2/2 drm/sun4i: Send vblank event when the CRTC is disabled

So far, we were missing to send the vblank event when disabling the CRTC, making us never report the last vblank event.

This was causing a time out on the page flip, which should be solved now.

---
 drivers/gpu/drm/sun4i/sun4i_crtc.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/sun4i/sun4i_crtc.c +8 -0
index 4182a21f5923..41cacecbea9a 100644
@@ -65,6 +65,14 @@ static void sun4i_crtc_disable(struct drm_crtc *crtc)
 	DRM_DEBUG_DRIVER("Disabling the CRTC\n");
 
 	sun4i_tcon_disable(drv->tcon);
+
+	if (crtc->state->event && !crtc->state->active) {
+		spin_lock_irq(&crtc->dev->event_lock);
+		drm_crtc_send_vblank_event(crtc, crtc->state->event);
+		spin_unlock_irq(&crtc->dev->event_lock);
+
+		crtc->state->event = NULL;
+	}
 }
 
 static void sun4i_crtc_enable(struct drm_crtc *crtc)
Signature · 6 lines
2.9.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel