Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/msm/dsi: Replace dsi_get_bpp() with mipi_dsi header function

drm_mipi_dsi.h already provides a conversion function from MIPI_DSI_FMT_
to bpp, named mipi_dsi_pixel_format_to_bpp().

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/577065/
Link: https://lore.kernel.org/r/20240204-drm-msm-dsi-remove-open-coded-get-bpp-v1-1-c16212de7e86@somainline.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

authored by

Marijn Suijten and committed by
Dmitry Baryshkov
99d519fe 4825b207

+4 -14
+4 -14
drivers/gpu/drm/msm/dsi/dsi_host.c
··· 183 183 int irq; 184 184 }; 185 185 186 - static u32 dsi_get_bpp(const enum mipi_dsi_pixel_format fmt) 187 - { 188 - switch (fmt) { 189 - case MIPI_DSI_FMT_RGB565: return 16; 190 - case MIPI_DSI_FMT_RGB666_PACKED: return 18; 191 - case MIPI_DSI_FMT_RGB666: 192 - case MIPI_DSI_FMT_RGB888: 193 - default: return 24; 194 - } 195 - } 196 186 197 187 static inline u32 dsi_read(struct msm_dsi_host *msm_host, u32 reg) 198 188 { ··· 557 567 { 558 568 struct msm_dsi_host *msm_host = to_msm_dsi_host(host); 559 569 u8 lanes = msm_host->lanes; 560 - u32 bpp = dsi_get_bpp(msm_host->format); 570 + u32 bpp = mipi_dsi_pixel_format_to_bpp(msm_host->format); 561 571 unsigned long pclk_rate = dsi_get_pclk_rate(mode, msm_host->dsc, is_bonded_dsi); 562 572 unsigned long pclk_bpp; 563 573 ··· 600 610 601 611 int dsi_calc_clk_rate_v2(struct msm_dsi_host *msm_host, bool is_bonded_dsi) 602 612 { 603 - u32 bpp = dsi_get_bpp(msm_host->format); 613 + u32 bpp = mipi_dsi_pixel_format_to_bpp(msm_host->format); 604 614 unsigned int esc_mhz, esc_div; 605 615 unsigned long byte_mhz; 606 616 ··· 983 993 984 994 /* image data and 1 byte write_memory_start cmd */ 985 995 if (!msm_host->dsc) 986 - wc = hdisplay * dsi_get_bpp(msm_host->format) / 8 + 1; 996 + wc = hdisplay * mipi_dsi_pixel_format_to_bpp(msm_host->format) / 8 + 1; 987 997 else 988 998 /* 989 999 * When DSC is enabled, WC = slice_chunk_size * slice_per_pkt + 1. ··· 1403 1413 { 1404 1414 int len, ret; 1405 1415 int bllp_len = msm_host->mode->hdisplay * 1406 - dsi_get_bpp(msm_host->format) / 8; 1416 + mipi_dsi_pixel_format_to_bpp(msm_host->format) / 8; 1407 1417 1408 1418 len = dsi_cmd_dma_add(msm_host, msg); 1409 1419 if (len < 0) {