drm/exynos: simplify set_pixfmt() in DECON and FIMD drivers
authorTobias Jakobi <tjakobi@math.uni-bielefeld.de>
Tue, 22 Aug 2017 14:19:44 +0000 (16:19 +0200)
committerInki Dae <inki.dae@samsung.com>
Fri, 25 Aug 2017 05:30:27 +0000 (14:30 +0900)
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>
drivers/gpu/drm/exynos/exynos5433_drm_decon.c
drivers/gpu/drm/exynos/exynos7_drm_decon.c
drivers/gpu/drm/exynos/exynos_drm_fimd.c

index f7c5e340bc71d8de6646e2ad14d911075d36244c..730b8d9db18704c42346b9553c8d7ab737493392 100644 (file)
@@ -279,13 +279,11 @@ static void decon_win_set_pixfmt(struct decon_context *ctx, unsigned int win,
                val |= WINCONx_BURSTLEN_16WORD;
                break;
        case DRM_FORMAT_ARGB8888:
+       default:
                val |= WINCONx_BPPMODE_32BPP_A8888;
                val |= WINCONx_WSWP_F | WINCONx_BLD_PIX_F | WINCONx_ALPHA_SEL_F;
                val |= WINCONx_BURSTLEN_16WORD;
                break;
-       default:
-               DRM_ERROR("Proper pixel format is not set\n");
-               return;
        }
 
        DRM_DEBUG_KMS("cpp = %u\n", fb->format->cpp[0]);
index 4662d55ed988de9670b9ca75b1c3ecaf49b902d9..615efcf7782a130dce3c06975a611323b12dcf5e 100644 (file)
@@ -309,16 +309,11 @@ static void decon_win_set_pixfmt(struct decon_context *ctx, unsigned int win,
                val |= WINCONx_BURSTLEN_16WORD;
                break;
        case DRM_FORMAT_BGRA8888:
+       default:
                val |= WINCONx_BPPMODE_32BPP_BGRA | WINCONx_BLD_PIX |
                        WINCONx_ALPHA_SEL;
                val |= WINCONx_BURSTLEN_16WORD;
                break;
-       default:
-               DRM_DEBUG_KMS("invalid pixel size so using unpacked 24bpp.\n");
-
-               val |= WINCONx_BPPMODE_24BPP_xRGB;
-               val |= WINCONx_BURSTLEN_16WORD;
-               break;
        }
 
        DRM_DEBUG_KMS("cpp = %d\n", fb->format->cpp[0]);
index ebc2077b1253a112dd83f625ea7b6a04a9eff492..d42ae2bc3e5679fd2258a6edf0b8f7a7ae700a8b 100644 (file)
@@ -583,18 +583,12 @@ static void fimd_win_set_pixfmt(struct fimd_context *ctx, unsigned int win,
                val |= WINCONx_BURSTLEN_16WORD;
                break;
        case DRM_FORMAT_ARGB8888:
+       default:
                val |= WINCON1_BPPMODE_25BPP_A1888
                        | WINCON1_BLD_PIX | WINCON1_ALPHA_SEL;
                val |= WINCONx_WSWP;
                val |= WINCONx_BURSTLEN_16WORD;
                break;
-       default:
-               DRM_DEBUG_KMS("invalid pixel size so using unpacked 24bpp.\n");
-
-               val |= WINCON0_BPPMODE_24BPP_888;
-               val |= WINCONx_WSWP;
-               val |= WINCONx_BURSTLEN_16WORD;
-               break;
        }
 
        /*