OSDN Git Service

msm: mdss: edid: limit resolutions support based on interface
authorAjay Singh Parmar <aparmar@codeaurora.org>
Thu, 6 Oct 2016 23:02:07 +0000 (16:02 -0700)
committerChandan Uddaraju <chandanu@codeaurora.org>
Fri, 7 Oct 2016 17:39:17 +0000 (10:39 -0700)
Limit the resolutions provided by sink to the ones supported
by the interface so that user modules do not receive the resolutions
which are not supported by the interface.

Change-Id: I63657f139cd7b058d211c306fb596ac5d80f2495
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
drivers/video/fbdev/msm/mdss_hdmi_util.c
drivers/video/fbdev/msm/mdss_hdmi_util.h

index 9ed909e..b3d929b 100644 (file)
@@ -560,7 +560,7 @@ int msm_hdmi_get_timing_info(
 int hdmi_get_supported_mode(struct msm_hdmi_mode_timing_info *info,
        struct hdmi_util_ds_data *ds_data, u32 mode)
 {
-       int ret;
+       int ret, i = 0;
 
        if (!info)
                return -EINVAL;
@@ -570,9 +570,23 @@ int hdmi_get_supported_mode(struct msm_hdmi_mode_timing_info *info,
 
        ret = msm_hdmi_get_timing_info(info, mode);
 
-       if (!ret && ds_data && ds_data->ds_registered && ds_data->ds_max_clk) {
-               if (info->pixel_freq > ds_data->ds_max_clk)
-                       info->supported = false;
+       if (!ret && ds_data && ds_data->ds_registered) {
+               if (ds_data->ds_max_clk) {
+                       if (info->pixel_freq > ds_data->ds_max_clk)
+                               info->supported = false;
+               }
+
+               if (ds_data->modes_num) {
+                       u32 *modes = ds_data->modes;
+
+                       for (i = 0; i < ds_data->modes_num; i++) {
+                               if (info->video_format == *modes++)
+                                       break;
+                       }
+
+                       if (i == ds_data->modes_num)
+                               info->supported = false;
+               }
        }
 
        return ret;
index e65cf91..8a7e4d1 100644 (file)
@@ -459,6 +459,8 @@ struct hdmi_tx_ddc_ctrl {
 struct hdmi_util_ds_data {
        bool ds_registered;
        u32 ds_max_clk;
+       u32 modes_num;
+       u32 *modes;
 };
 
 static inline int hdmi_tx_get_v_total(const struct msm_hdmi_mode_timing_info *t)