]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
drm: Remove duplicate drm_mode_cea_vic()
authorThierry Reding <thierry.reding@avionic-design.de>
Thu, 20 Dec 2012 14:41:44 +0000 (15:41 +0100)
committerThierry Reding <thierry.reding@avionic-design.de>
Fri, 22 Feb 2013 07:19:53 +0000 (08:19 +0100)
The same function had already been merged with a different name. Remove
the duplicate one but reuse some of its kerneldoc fragments for the
existing implementation.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/drm_edid.c
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_hdmi.c
drivers/gpu/drm/i915/intel_sdvo.c
include/drm/drm_crtc.h

index 67aa0dd68250a8ca330bc8f3005a9e924d79ff8d..02da919f6c3811d8b803308e0ddbb1888bcb2b1f 100644 (file)
@@ -1516,11 +1516,14 @@ u8 *drm_find_cea_extension(struct edid *edid)
 }
 EXPORT_SYMBOL(drm_find_cea_extension);
 
-/*
- * Looks for a CEA mode matching given drm_display_mode.
- * Returns its CEA Video ID code, or 0 if not found.
+/**
+ * drm_match_cea_mode - look for a CEA mode matching given mode
+ * @to_match: display mode
+ *
+ * Returns the CEA Video ID (VIC) of the mode or 0 if it isn't a CEA-861
+ * mode.
  */
-u8 drm_match_cea_mode(struct drm_display_mode *to_match)
+u8 drm_match_cea_mode(const struct drm_display_mode *to_match)
 {
        struct drm_display_mode *cea_mode;
        u8 mode;
@@ -2114,22 +2117,3 @@ int drm_add_modes_noedid(struct drm_connector *connector,
        return num_modes;
 }
 EXPORT_SYMBOL(drm_add_modes_noedid);
-
-/**
- * drm_mode_cea_vic - return the CEA-861 VIC of a given mode
- * @mode: mode
- *
- * RETURNS:
- * The VIC number, 0 in case it's not a CEA-861 mode.
- */
-uint8_t drm_mode_cea_vic(const struct drm_display_mode *mode)
-{
-       uint8_t i;
-
-       for (i = 0; i < drm_num_cea_modes; i++)
-               if (drm_mode_equal(mode, &edid_cea_modes[i]))
-                       return i + 1;
-
-       return 0;
-}
-EXPORT_SYMBOL(drm_mode_cea_vic);
index 31c0205685abb1e575db6a3b00198e1637013dfb..f61cb7998c7230d28c83850aeab068958be5df3a 100644 (file)
@@ -770,7 +770,7 @@ intel_dp_mode_fixup(struct drm_encoder *encoder,
                 * CEA-861-E - 5.1 Default Encoding Parameters
                 * VESA DisplayPort Ver.1.2a - 5.1.1.1 Video Colorimetry
                 */
-               if (bpp != 18 && drm_mode_cea_vic(adjusted_mode) > 1)
+               if (bpp != 18 && drm_match_cea_mode(adjusted_mode) > 1)
                        intel_dp->color_range = DP_COLOR_RANGE_16_235;
                else
                        intel_dp->color_range = 0;
index 3ea0c8b6a00f41d8b46c4b0f96196567d04133a6..f131dfc54b01fb90e95145dd41b70f100b325020 100644 (file)
@@ -348,7 +348,7 @@ static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,
                        avi_if.body.avi.ITC_EC_Q_SC |= DIP_AVI_RGB_QUANT_RANGE_FULL;
        }
 
-       avi_if.body.avi.VIC = drm_mode_cea_vic(adjusted_mode);
+       avi_if.body.avi.VIC = drm_match_cea_mode(adjusted_mode);
 
        intel_set_infoframe(encoder, &avi_if);
 }
@@ -781,7 +781,7 @@ bool intel_hdmi_mode_fixup(struct drm_encoder *encoder,
        if (intel_hdmi->color_range_auto) {
                /* See CEA-861-E - 5.1 Default Encoding Parameters */
                if (intel_hdmi->has_hdmi_sink &&
-                   drm_mode_cea_vic(adjusted_mode) > 1)
+                   drm_match_cea_mode(adjusted_mode) > 1)
                        intel_hdmi->color_range = SDVO_COLOR_RANGE_16_235;
                else
                        intel_hdmi->color_range = 0;
index 33b46d9694eafb9a4adb8a819c9b6348103855f2..d07a8cdf998ec4b1eadda9aa9906a8053f25b1ee 100644 (file)
@@ -1077,7 +1077,7 @@ static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder,
        if (intel_sdvo->color_range_auto) {
                /* See CEA-861-E - 5.1 Default Encoding Parameters */
                if (intel_sdvo->has_hdmi_monitor &&
-                   drm_mode_cea_vic(adjusted_mode) > 1)
+                   drm_match_cea_mode(adjusted_mode) > 1)
                        intel_sdvo->color_range = SDVO_COLOR_RANGE_16_235;
                else
                        intel_sdvo->color_range = 0;
index 8b7762728639ad7e3a5ec0f8ba4ab5c1bac1ea3e..77627184775c164d2fc4a450ae7663aa1615c207 100644 (file)
@@ -1061,7 +1061,7 @@ extern int drm_mode_gamma_get_ioctl(struct drm_device *dev,
 extern int drm_mode_gamma_set_ioctl(struct drm_device *dev,
                                    void *data, struct drm_file *file_priv);
 extern u8 *drm_find_cea_extension(struct edid *edid);
-extern u8 drm_match_cea_mode(struct drm_display_mode *to_match);
+extern u8 drm_match_cea_mode(const struct drm_display_mode *to_match);
 extern bool drm_detect_hdmi_monitor(struct edid *edid);
 extern bool drm_detect_monitor_audio(struct edid *edid);
 extern bool drm_rgb_quant_range_selectable(struct edid *edid);
@@ -1079,7 +1079,6 @@ extern struct drm_display_mode *drm_gtf_mode_complex(struct drm_device *dev,
                                int GTF_2C, int GTF_K, int GTF_2J);
 extern int drm_add_modes_noedid(struct drm_connector *connector,
                                int hdisplay, int vdisplay);
-extern uint8_t drm_mode_cea_vic(const struct drm_display_mode *mode);
 
 extern int drm_edid_header_is_valid(const u8 *raw_edid);
 extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid);