[PATCH v3] drm/exynos: calculate vrefresh instead of use a fixed value
Gustavo Padovan
gustavo at padovan.org
Wed May 20 13:56:39 PDT 2015
From: Gustavo Padovan <gustavo.padovan at collabora.co.uk>
When mode's vrefresh is zero we should ask DRM core to calculate vrefresh
for us so we can get the correct value instead of relying on fixed value
defined in a macro. But if vrefresh is still zero we should fail the
update.
Suggested-by: Daniel Stone <daniels at collabora.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan at collabora.co.uk>
---
drivers/gpu/drm/exynos/exynos_drm_fimd.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 9819fa6..3f9646d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -42,7 +42,6 @@
* CPU Interface.
*/
-#define FIMD_DEFAULT_FRAMERATE 60
#define MIN_FB_WIDTH_FOR_16WORD_BURST 128
/* position control register for hardware window 0, 2 ~ 4.*/
@@ -329,7 +328,9 @@ static bool fimd_mode_fixup(struct exynos_drm_crtc *crtc,
struct drm_display_mode *adjusted_mode)
{
if (adjusted_mode->vrefresh == 0)
- adjusted_mode->vrefresh = FIMD_DEFAULT_FRAMERATE;
+ adjusted_mode->vrefresh = drm_mode_vrefresh(mode);
+ if (adjusted_mode->vrefresh == 0)
+ return false;
return true;
}
@@ -427,7 +428,7 @@ static void fimd_commit(struct exynos_drm_crtc *crtc)
if (ctx->driver_data->has_clksel)
val |= VIDCON0_CLKSEL_LCD;
- clkdiv = fimd_calc_clkdiv(ctx, mode);
+ clkdiv = fimd_calc_clkdiv(ctx, &crtc->base.state->adjusted_mode);
if (clkdiv > 1)
val |= VIDCON0_CLKVAL_F(clkdiv - 1) | VIDCON0_CLKDIR;
--
2.1.0
More information about the dri-devel
mailing list