瀏覽代碼

disp: msm: dp: set the output format YUV or RGB

When doing mode set, check the given videomode, if it
can be only supported in YCBCR420, set the output
format to YUV420.

Change-Id: I74224e5ad70f4fd8834b5b1e19109d4868cc14ff
Signed-off-by: Yuan Zhao <[email protected]>
Yuan Zhao 4 年之前
父節點
當前提交
a264f27680
共有 2 個文件被更改,包括 30 次插入0 次删除
  1. 15 0
      msm/dp/dp_panel.c
  2. 15 0
      msm/dp/dp_panel.h

+ 15 - 0
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)) {

+ 15 - 0
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;