Commit 7c653d4b authored by Robert Chiras's avatar Robert Chiras Committed by Guido Gunther
Browse files

drm/mxsfb: Fix the vblank events



Currently, the vblank support is not correctly implemented in MXSFB_DRM
driver. The call to drm_vblank_init is made with mode_config.num_crtc
which at that time is 0. Because of this, vblank is not activated, so
there won't be any vblank event submitted.
For example, when running modetest with the '-v' parameter will result
in an astronomical refresh rate (10000+ Hz), because of that.
Signed-off-by: default avatarRobert Chiras <robert.chiras@nxp.com>
parent b45ce5e0
...@@ -38,6 +38,9 @@ ...@@ -38,6 +38,9 @@
#include "mxsfb_drv.h" #include "mxsfb_drv.h"
#include "mxsfb_regs.h" #include "mxsfb_regs.h"
/* The eLCDIF max possible CRTCs */
#define MAX_CRTCS 1
enum mxsfb_devtype { enum mxsfb_devtype {
MXSFB_V3, MXSFB_V3,
MXSFB_V4, MXSFB_V4,
...@@ -138,6 +141,8 @@ static void mxsfb_pipe_enable(struct drm_simple_display_pipe *pipe, ...@@ -138,6 +141,8 @@ static void mxsfb_pipe_enable(struct drm_simple_display_pipe *pipe,
mxsfb->connector = &mxsfb->panel_connector; mxsfb->connector = &mxsfb->panel_connector;
} }
drm_crtc_vblank_on(&pipe->crtc);
pm_runtime_get_sync(drm->dev); pm_runtime_get_sync(drm->dev);
drm_panel_prepare(mxsfb->panel); drm_panel_prepare(mxsfb->panel);
mxsfb_crtc_enable(mxsfb); mxsfb_crtc_enable(mxsfb);
...@@ -164,6 +169,8 @@ static void mxsfb_pipe_disable(struct drm_simple_display_pipe *pipe) ...@@ -164,6 +169,8 @@ static void mxsfb_pipe_disable(struct drm_simple_display_pipe *pipe)
} }
spin_unlock_irq(&drm->event_lock); spin_unlock_irq(&drm->event_lock);
drm_crtc_vblank_off(&pipe->crtc);
if (mxsfb->connector != &mxsfb->panel_connector) if (mxsfb->connector != &mxsfb->panel_connector)
mxsfb->connector = NULL; mxsfb->connector = NULL;
} }
...@@ -246,7 +253,7 @@ static int mxsfb_load(struct drm_device *drm, unsigned long flags) ...@@ -246,7 +253,7 @@ static int mxsfb_load(struct drm_device *drm, unsigned long flags)
pm_runtime_enable(drm->dev); pm_runtime_enable(drm->dev);
ret = drm_vblank_init(drm, drm->mode_config.num_crtc); ret = drm_vblank_init(drm, MAX_CRTCS);
if (ret < 0) { if (ret < 0) {
dev_err(drm->dev, "Failed to initialise vblank\n"); dev_err(drm->dev, "Failed to initialise vblank\n");
goto err_vblank; goto err_vblank;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment