summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/mxsfb/mxsfb_drv.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-07-27 05:06:46 +0300
committerStefan Agner <stefan@agner.ch>2020-07-28 17:21:24 +0200
commitb9f5937680a8f1c14aea481358af3504c8b94c3f (patch)
tree9cae5c4b6be145cc1a03ce11479d66d3fd1f9f75 /drivers/gpu/drm/mxsfb/mxsfb_drv.c
parent07b7fd77b48c56a0d99c06053bad39b426e28201 (diff)
downloadlinux-b9f5937680a8f1c14aea481358af3504c8b94c3f.tar.gz
drm: mxsfb: Enable vblank handling
Enable vblank handling when the CRTC is turned on and disable it when it is turned off. This requires moving vblank init after the KMS pipeline initialisation, otherwise drm_vblank_init() gets called with 0 CRTCs. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Stefan Agner <stefan@agner.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20200727020654.8231-15-laurent.pinchart@ideasonboard.com
Diffstat (limited to 'drivers/gpu/drm/mxsfb/mxsfb_drv.c')
-rw-r--r--drivers/gpu/drm/mxsfb/mxsfb_drv.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
index cac50fb4fc0f..85756d5907e3 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
@@ -161,12 +161,6 @@ static int mxsfb_load(struct drm_device *drm)
pm_runtime_enable(drm->dev);
- ret = drm_vblank_init(drm, drm->mode_config.num_crtc);
- if (ret < 0) {
- dev_err(drm->dev, "Failed to initialise vblank\n");
- goto err_vblank;
- }
-
/* Modeset init */
drm_mode_config_init(drm);
@@ -176,6 +170,15 @@ static int mxsfb_load(struct drm_device *drm)
goto err_vblank;
}
+ ret = drm_vblank_init(drm, drm->mode_config.num_crtc);
+ if (ret < 0) {
+ dev_err(drm->dev, "Failed to initialise vblank\n");
+ goto err_vblank;
+ }
+
+ /* Start with vertical blanking interrupt reporting disabled. */
+ drm_crtc_vblank_off(&mxsfb->crtc);
+
ret = mxsfb_attach_bridge(mxsfb);
if (ret) {
dev_err(drm->dev, "Cannot connect bridge: %d\n", ret);