From a01dc18dd2d9829ab42e1c816fd8e883cdf65e1b Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Thu, 17 Feb 2022 17:50:39 +0530 Subject: [PATCH] disp: msm: dsi: fix compressed RGB101010 support The destination format for compressed rgb101010 should be the same as rgb888. After adding uncompressed RGB101010 support, the programming for compressed rgb101010 went wrong. Fix this to re-enable compressed rgb101010 format support. Change-Id: I805e15df14dda8ff0653a0dba8c4efe3fe0681fd Signed-off-by: Rajeev Nandan Signed-off-by: Ritesh Kumar --- msm/dsi/dsi_display.c | 11 +++++++++++ msm/dsi/dsi_panel.c | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/msm/dsi/dsi_display.c b/msm/dsi/dsi_display.c index 2f442bd4..b7fc3baa 100644 --- a/msm/dsi/dsi_display.c +++ b/msm/dsi/dsi_display.c @@ -7044,6 +7044,17 @@ int dsi_display_get_modes_helper(struct dsi_display *display, return rc; } + /* + * Update the host_config.dst_format for compressed RGB101010 pixel format. + */ + if (display->panel->host_config.dst_format == DSI_PIXEL_FORMAT_RGB101010 && + display_mode.timing.dsc_enabled) { + display->panel->host_config.dst_format = DSI_PIXEL_FORMAT_RGB888; + DSI_DEBUG("updated dst_format from %d to %d\n", + DSI_PIXEL_FORMAT_RGB101010, + display->panel->host_config.dst_format); + } + if (display->cmdline_timing == display_mode.mode_idx) { topology_override = display->cmdline_topology; is_preferred = true; diff --git a/msm/dsi/dsi_panel.c b/msm/dsi/dsi_panel.c index b996cbbd..652ceb38 100644 --- a/msm/dsi/dsi_panel.c +++ b/msm/dsi/dsi_panel.c @@ -964,6 +964,15 @@ static int dsi_panel_parse_pixel_format(struct dsi_host_common_cfg *host, fmt = DSI_PIXEL_FORMAT_RGB666; break; case 30: + /* + * The destination pixel format (host->dst_format) depends + * upon the compression, and should be RGB888 if the DSC is + * enable. + * The DSC status information is inside the timing modes, that + * is parsed during first dsi_display_get_modes() call. + * The dst_format will be updated there depending upon the + * DSC status. + */ fmt = DSI_PIXEL_FORMAT_RGB101010; break; case 24: