Tweak vc4 vblank for stability

This commit is contained in:
Peter Robinson 2017-06-28 15:32:53 +01:00
parent 18dd17cef8
commit a68ff15c18
2 changed files with 13 additions and 52 deletions

View File

@ -1,49 +1,7 @@
From e487709ee89a572a3a8068f33e9275479fde9bf4 Mon Sep 17 00:00:00 2001
From: Boris Brezillon <boris.brezillon@free-electrons.com>
Date: Fri, 16 Jun 2017 10:30:33 +0200
Subject: [PATCH 1/2] drm/vc4: Send a VBLANK event when disabling a CRTC
VBLANK events are missed when the CRTC is being disabled because the
driver does not wait till the end of the frame before stopping the
HVS and PV blocks. In this case, we should explicitly issue a VBLANK
event if there's one waiting.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
---
drivers/gpu/drm/vc4/vc4_crtc.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
index 9fcf05ca492b..66cffc548af2 100644
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
@@ -526,6 +526,19 @@ static void vc4_crtc_disable(struct drm_crtc *crtc)
WARN_ON_ONCE((HVS_READ(SCALER_DISPSTATX(chan)) &
(SCALER_DISPSTATX_FULL | SCALER_DISPSTATX_EMPTY)) !=
SCALER_DISPSTATX_EMPTY);
+
+ /*
+ * Make sure we issue a vblank event after disabling the CRTC if
+ * someone was waiting it.
+ */
+ if (crtc->state->event) {
+ unsigned long flags;
+
+ spin_lock_irqsave(&dev->event_lock, flags);
+ drm_crtc_send_vblank_event(crtc, crtc->state->event);
+ crtc->state->event = NULL;
+ spin_unlock_irqrestore(&dev->event_lock, flags);
+ }
}
static void vc4_crtc_enable(struct drm_crtc *crtc)
--
2.13.0
From 6c9d1ad4c10657d7d6f8455088686abee1805102 Mon Sep 17 00:00:00 2001
From 5db729b12376b0b6507503eee1dcbe5f3b089686 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Mon, 26 Jun 2017 09:03:28 +0100
Subject: [PATCH 2/2] drm/vc4: Fix VBLANK handling in crtc->enable() path
Date: Wed, 28 Jun 2017 10:49:18 +0100
Subject: [PATCH] drm/vc4: Fix VBLANK handling in crtc->enable() path
When we are enabling a CRTC, drm_crtc_vblank_get() is called before
drm_crtc_vblank_on(), which is not supposed to happen (hence the
@ -56,11 +14,11 @@ Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
1 file changed, 43 insertions(+), 23 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
index 66cffc548af2..47a8ef0a755d 100644
index 9fcf05ca492b..138c406f4f77 100644
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
@@ -541,6 +541,34 @@ static void vc4_crtc_disable(struct drm_crtc *crtc)
}
@@ -528,6 +528,34 @@ static void vc4_crtc_disable(struct drm_crtc *crtc)
SCALER_DISPSTATX_EMPTY);
}
+static void vc4_crtc_update_dlist(struct drm_crtc *crtc)
@ -94,7 +52,7 @@ index 66cffc548af2..47a8ef0a755d 100644
static void vc4_crtc_enable(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
@@ -551,6 +579,12 @@ static void vc4_crtc_enable(struct drm_crtc *crtc)
@@ -538,6 +566,12 @@ static void vc4_crtc_enable(struct drm_crtc *crtc)
require_hvs_enabled(dev);
@ -107,7 +65,7 @@ index 66cffc548af2..47a8ef0a755d 100644
/* Turn on the scaler, which will wait for vstart to start
* compositing.
*/
@@ -562,9 +596,6 @@ static void vc4_crtc_enable(struct drm_crtc *crtc)
@@ -549,9 +583,6 @@ static void vc4_crtc_enable(struct drm_crtc *crtc)
/* Turn on the pixel valve, which will emit the vstart signal. */
CRTC_WRITE(PV_V_CONTROL,
CRTC_READ(PV_V_CONTROL) | PV_VCONTROL_VIDEN);
@ -117,7 +75,7 @@ index 66cffc548af2..47a8ef0a755d 100644
}
static bool vc4_crtc_mode_fixup(struct drm_crtc *crtc,
@@ -619,7 +650,6 @@ static void vc4_crtc_atomic_flush(struct drm_crtc *crtc,
@@ -606,7 +637,6 @@ static void vc4_crtc_atomic_flush(struct drm_crtc *crtc,
{
struct drm_device *dev = crtc->dev;
struct vc4_dev *vc4 = to_vc4_dev(dev);
@ -125,7 +83,7 @@ index 66cffc548af2..47a8ef0a755d 100644
struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc->state);
struct drm_plane *plane;
bool debug_dump_regs = false;
@@ -641,25 +671,15 @@ static void vc4_crtc_atomic_flush(struct drm_crtc *crtc,
@@ -628,25 +658,15 @@ static void vc4_crtc_atomic_flush(struct drm_crtc *crtc,
WARN_ON_ONCE(dlist_next - dlist_start != vc4_state->mm.size);

View File

@ -2236,6 +2236,9 @@ fi
#
#
%changelog
* Wed Jun 28 2017 Peter Robinson <pbrobinson@fedoraproject.org>
- Tweak vc4 vblank for stability
* Mon Jun 26 2017 Peter Robinson <pbrobinson@fedoraproject.org>
- Config improvements for Qualcomm devices