summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/exynos
diff options
context:
space:
mode:
authorAndrzej Hajda <a.hajda@samsung.com>2017-09-29 12:05:34 +0200
committerInki Dae <inki.dae@samsung.com>2017-10-26 09:06:32 +0900
commit3fc40ca9695c6a10c528f80306b1731128eca8c1 (patch)
treed73b6ac43338ae69a91ad98b46c7be6a9aa19a3c /drivers/gpu/drm/exynos
parent71469944dea0e7c5d9426171a7a5fb3609b9d15f (diff)
downloadlinux-stable-3fc40ca9695c6a10c528f80306b1731128eca8c1.tar.gz
linux-stable-3fc40ca9695c6a10c528f80306b1731128eca8c1.tar.bz2
linux-stable-3fc40ca9695c6a10c528f80306b1731128eca8c1.zip
drm/exynos/mixer: move resolution configuration to single function
Screen resolution configuration depends on HW version, let's put it into single function to make it consistent and simplify the code. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos')
-rw-r--r--drivers/gpu/drm/exynos/exynos_mixer.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index ae89e53186ee..a87f60bbf2c2 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -367,7 +367,7 @@ static void mixer_vsync_set_update(struct mixer_context *ctx, bool enable)
VP_SHADOW_UPDATE_ENABLE : 0);
}
-static void mixer_cfg_scan(struct mixer_context *ctx, unsigned int height)
+static void mixer_cfg_scan(struct mixer_context *ctx, int width, int height)
{
struct mixer_resources *res = &ctx->mixer_res;
u32 val;
@@ -376,7 +376,11 @@ static void mixer_cfg_scan(struct mixer_context *ctx, unsigned int height)
val = test_bit(MXR_BIT_INTERLACE, &ctx->flags) ?
MXR_CFG_SCAN_INTERLACE : MXR_CFG_SCAN_PROGRESSIVE;
- if (ctx->mxr_ver != MXR_VER_128_0_0_184) {
+ /* setup display size */
+ if (ctx->mxr_ver == MXR_VER_128_0_0_184) {
+ mixer_reg_write(&ctx->mixer_res, MXR_RESOLUTION,
+ MXR_MXR_RES_HEIGHT(height) | MXR_MXR_RES_WIDTH(width));
+ } else {
/* choosing between proper HD and SD mode */
if (height <= 480)
val |= MXR_CFG_SCAN_NTSC | MXR_CFG_SCAN_SD;
@@ -482,14 +486,7 @@ static void mixer_commit(struct mixer_context *ctx)
else
__clear_bit(MXR_BIT_INTERLACE, &ctx->flags);
- /* setup display size */
- if (ctx->mxr_ver == MXR_VER_128_0_0_184) {
- u32 val = MXR_MXR_RES_HEIGHT(mode->vdisplay)
- | MXR_MXR_RES_WIDTH(mode->hdisplay);
- mixer_reg_write(&ctx->mixer_res, MXR_RESOLUTION, val);
- }
-
- mixer_cfg_scan(ctx, mode->vdisplay);
+ mixer_cfg_scan(ctx, mode->hdisplay, mode->vdisplay);
mixer_cfg_rgb_fmt(ctx, mode->vdisplay);
mixer_run(ctx);
}