summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@nxp.com>2018-07-04 16:37:08 +0300
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit41932e6374427a213b8d02f127ff8d65ca7f3a68 (patch)
tree5993ed66e82b3ac8a59f12c9573132aa09da9a0e /drivers
parentba5ba3a04d8080753976c3cff6ac71d4cfa7ceac (diff)
MLK-18767: drm: imx: dcss: fix vblank timed out warning
The following commit: f9a03b3 - MLK-17925: drm: imx: dcss: fix tearing introduced a regression because we does not send VBLANK event if context loader was not flushed. But this condition is always met immediately after enabling the CRTC. Hence, when 30FPS modes are selected, it is possible to exceed the 50ms vblank timeout if the first event is not sent. That's because 2 x 0.33ms > 50ms. This does not happen for 60fps modes though. This patch will force sending the first vblank event even if the context loader is not completely flushed. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/imx/dcss/dcss-crtc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/imx/dcss/dcss-crtc.c b/drivers/gpu/drm/imx/dcss/dcss-crtc.c
index e0f583620772..9ae4933ebf37 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-crtc.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-crtc.c
@@ -50,6 +50,8 @@ struct dcss_crtc {
enum dcss_hdr10_gamut opipe_g;
enum dcss_hdr10_pixel_range opipe_pr;
u32 opipe_pix_format;
+
+ bool fist_vblank_after_en;
};
static void dcss_crtc_destroy(struct drm_crtc *crtc)
@@ -227,6 +229,8 @@ static void dcss_crtc_enable(struct drm_crtc *crtc)
dcss_dtg_enable(dcss, true, NULL);
dcss_ctxld_enable(dcss);
+ dcss_crtc->fist_vblank_after_en = true;
+
crtc->enabled = true;
}
@@ -246,8 +250,6 @@ static void dcss_crtc_atomic_disable(struct drm_crtc *crtc,
}
spin_unlock_irq(&crtc->dev->event_lock);
- drm_crtc_vblank_off(crtc);
-
dcss_ss_enable(dcss, false);
dcss_dtg_enable(dcss, false, &dcss_crtc->disable_completion);
dcss_ctxld_enable(dcss);
@@ -257,6 +259,8 @@ static void dcss_crtc_atomic_disable(struct drm_crtc *crtc,
wait_for_completion_timeout(&dcss_crtc->disable_completion,
msecs_to_jiffies(100));
+ drm_crtc_vblank_off(crtc);
+
pm_runtime_put_sync(dcss_crtc->dev->parent);
}
@@ -306,8 +310,10 @@ static irqreturn_t dcss_crtc_irq_handler(int irq, void *dev_id)
dcss_trace_module(TRACE_DRM_CRTC, TRACE_VBLANK);
- if (dcss_ctxld_is_flushed(dcss))
+ if (dcss_ctxld_is_flushed(dcss) || dcss_crtc->fist_vblank_after_en) {
drm_crtc_handle_vblank(&dcss_crtc->base);
+ dcss_crtc->fist_vblank_after_en = false;
+ }
dcss_vblank_irq_clear(dcss);