diff options
author | Tobias Jakobi <tjakobi@math.uni-bielefeld.de> | 2017-08-22 10:19:44 -0400 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2017-08-25 01:30:27 -0400 |
commit | 5b7b1b7fa10145c014750b09ff4cf31ac4e1843a (patch) | |
tree | 96ac0ba54a2e421cead0d9aeb3f71e21d5a7ec22 | |
parent | ac60944ccf2388901412a0c9a0e7e3e4b56520a4 (diff) |
drm/exynos: simplify set_pixfmt() in DECON and FIMD drivers
DRM core already checks the validity of the pixelformat.
Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r-- | drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos7_drm_decon.c | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fimd.c | 8 |
3 files changed, 3 insertions, 16 deletions
diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c index f7c5e340bc71..730b8d9db187 100644 --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c | |||
@@ -279,13 +279,11 @@ static void decon_win_set_pixfmt(struct decon_context *ctx, unsigned int win, | |||
279 | val |= WINCONx_BURSTLEN_16WORD; | 279 | val |= WINCONx_BURSTLEN_16WORD; |
280 | break; | 280 | break; |
281 | case DRM_FORMAT_ARGB8888: | 281 | case DRM_FORMAT_ARGB8888: |
282 | default: | ||
282 | val |= WINCONx_BPPMODE_32BPP_A8888; | 283 | val |= WINCONx_BPPMODE_32BPP_A8888; |
283 | val |= WINCONx_WSWP_F | WINCONx_BLD_PIX_F | WINCONx_ALPHA_SEL_F; | 284 | val |= WINCONx_WSWP_F | WINCONx_BLD_PIX_F | WINCONx_ALPHA_SEL_F; |
284 | val |= WINCONx_BURSTLEN_16WORD; | 285 | val |= WINCONx_BURSTLEN_16WORD; |
285 | break; | 286 | break; |
286 | default: | ||
287 | DRM_ERROR("Proper pixel format is not set\n"); | ||
288 | return; | ||
289 | } | 287 | } |
290 | 288 | ||
291 | DRM_DEBUG_KMS("cpp = %u\n", fb->format->cpp[0]); | 289 | DRM_DEBUG_KMS("cpp = %u\n", fb->format->cpp[0]); |
diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c index 4662d55ed988..615efcf7782a 100644 --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c | |||
@@ -309,16 +309,11 @@ static void decon_win_set_pixfmt(struct decon_context *ctx, unsigned int win, | |||
309 | val |= WINCONx_BURSTLEN_16WORD; | 309 | val |= WINCONx_BURSTLEN_16WORD; |
310 | break; | 310 | break; |
311 | case DRM_FORMAT_BGRA8888: | 311 | case DRM_FORMAT_BGRA8888: |
312 | default: | ||
312 | val |= WINCONx_BPPMODE_32BPP_BGRA | WINCONx_BLD_PIX | | 313 | val |= WINCONx_BPPMODE_32BPP_BGRA | WINCONx_BLD_PIX | |
313 | WINCONx_ALPHA_SEL; | 314 | WINCONx_ALPHA_SEL; |
314 | val |= WINCONx_BURSTLEN_16WORD; | 315 | val |= WINCONx_BURSTLEN_16WORD; |
315 | break; | 316 | break; |
316 | default: | ||
317 | DRM_DEBUG_KMS("invalid pixel size so using unpacked 24bpp.\n"); | ||
318 | |||
319 | val |= WINCONx_BPPMODE_24BPP_xRGB; | ||
320 | val |= WINCONx_BURSTLEN_16WORD; | ||
321 | break; | ||
322 | } | 317 | } |
323 | 318 | ||
324 | DRM_DEBUG_KMS("cpp = %d\n", fb->format->cpp[0]); | 319 | DRM_DEBUG_KMS("cpp = %d\n", fb->format->cpp[0]); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index ebc2077b1253..d42ae2bc3e56 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c | |||
@@ -583,18 +583,12 @@ static void fimd_win_set_pixfmt(struct fimd_context *ctx, unsigned int win, | |||
583 | val |= WINCONx_BURSTLEN_16WORD; | 583 | val |= WINCONx_BURSTLEN_16WORD; |
584 | break; | 584 | break; |
585 | case DRM_FORMAT_ARGB8888: | 585 | case DRM_FORMAT_ARGB8888: |
586 | default: | ||
586 | val |= WINCON1_BPPMODE_25BPP_A1888 | 587 | val |= WINCON1_BPPMODE_25BPP_A1888 |
587 | | WINCON1_BLD_PIX | WINCON1_ALPHA_SEL; | 588 | | WINCON1_BLD_PIX | WINCON1_ALPHA_SEL; |
588 | val |= WINCONx_WSWP; | 589 | val |= WINCONx_WSWP; |
589 | val |= WINCONx_BURSTLEN_16WORD; | 590 | val |= WINCONx_BURSTLEN_16WORD; |
590 | break; | 591 | break; |
591 | default: | ||
592 | DRM_DEBUG_KMS("invalid pixel size so using unpacked 24bpp.\n"); | ||
593 | |||
594 | val |= WINCON0_BPPMODE_24BPP_888; | ||
595 | val |= WINCONx_WSWP; | ||
596 | val |= WINCONx_BURSTLEN_16WORD; | ||
597 | break; | ||
598 | } | 592 | } |
599 | 593 | ||
600 | /* | 594 | /* |