diff --git a/msm/dp/dp_panel.c b/msm/dp/dp_panel.c index a99e1b4528..c4ce5788ae 100644 --- a/msm/dp/dp_panel.c +++ b/msm/dp/dp_panel.c @@ -2968,6 +2968,21 @@ static void dp_panel_convert_to_dp_mode(struct dp_panel *dp_panel, comp_info->comp_ratio = DP_COMPRESSION_RATIO_NONE; comp_info->comp_type = MSM_DISPLAY_COMPRESSION_NONE; + /* As YUV was not supported now, so set the default format to RGB */ + dp_mode->output_format = DP_OUTPUT_FORMAT_RGB; + /* + * If a given videomode can be only supported in YCBCR420, set + * the output format to YUV420. While now our driver did not + * support YUV display over DP, so just place this flag here. + * When we want to support YUV, we can use this flag to do + * a lot of settings, like CDM, CSC and pixel_clock. + */ + if (drm_mode_is_420_only(&dp_panel->connector->display_info, + drm_mode)) { + dp_mode->output_format = DP_OUTPUT_FORMAT_YCBCR420; + DP_DEBUG("YCBCR420 was not supported"); + } + if (dp_panel->dsc_en && dsc_cap) { if (dp_panel_dsc_prepare_basic_params(comp_info, dp_mode, dp_panel)) { diff --git a/msm/dp/dp_panel.h b/msm/dp/dp_panel.h index f388f2d940..595b6bdf28 100644 --- a/msm/dp/dp_panel.h +++ b/msm/dp/dp_panel.h @@ -35,6 +35,14 @@ enum dp_lane_count { DP_LANE_COUNT_4 = 4, }; +enum dp_output_format { + DP_OUTPUT_FORMAT_RGB, + DP_OUTPUT_FORMAT_YCBCR420, + DP_OUTPUT_FORMAT_YCBCR422, + DP_OUTPUT_FORMAT_YCBCR444, + DP_OUTPUT_FORMAT_INVALID, +}; + #define DP_MAX_DOWNSTREAM_PORTS 0x10 struct dp_panel_info { @@ -62,6 +70,13 @@ struct dp_display_mode { u32 capabilities; s64 fec_overhead_fp; s64 dsc_overhead_fp; + /** + * @output_format: + * + * This is used to indicate DP output format. + * The output format can be read from drm_mode. + */ + enum dp_output_format output_format; }; struct dp_panel;