Commit 18316c8c39a85c8b6e3db0a150b1bee5b6c4c053

Authored by Thierry Reding
1 parent c976cb37a9

drm: Remove duplicate drm_mode_cea_vic()

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>

Showing 5 changed files with 12 additions and 29 deletions Side-by-side Diff

drivers/gpu/drm/drm_edid.c
... ... @@ -1516,11 +1516,14 @@
1516 1516 }
1517 1517 EXPORT_SYMBOL(drm_find_cea_extension);
1518 1518  
1519   -/*
1520   - * Looks for a CEA mode matching given drm_display_mode.
1521   - * Returns its CEA Video ID code, or 0 if not found.
  1519 +/**
  1520 + * drm_match_cea_mode - look for a CEA mode matching given mode
  1521 + * @to_match: display mode
  1522 + *
  1523 + * Returns the CEA Video ID (VIC) of the mode or 0 if it isn't a CEA-861
  1524 + * mode.
1522 1525 */
1523   -u8 drm_match_cea_mode(struct drm_display_mode *to_match)
  1526 +u8 drm_match_cea_mode(const struct drm_display_mode *to_match)
1524 1527 {
1525 1528 struct drm_display_mode *cea_mode;
1526 1529 u8 mode;
... ... @@ -2114,23 +2117,4 @@
2114 2117 return num_modes;
2115 2118 }
2116 2119 EXPORT_SYMBOL(drm_add_modes_noedid);
2117   -
2118   -/**
2119   - * drm_mode_cea_vic - return the CEA-861 VIC of a given mode
2120   - * @mode: mode
2121   - *
2122   - * RETURNS:
2123   - * The VIC number, 0 in case it's not a CEA-861 mode.
2124   - */
2125   -uint8_t drm_mode_cea_vic(const struct drm_display_mode *mode)
2126   -{
2127   - uint8_t i;
2128   -
2129   - for (i = 0; i < drm_num_cea_modes; i++)
2130   - if (drm_mode_equal(mode, &edid_cea_modes[i]))
2131   - return i + 1;
2132   -
2133   - return 0;
2134   -}
2135   -EXPORT_SYMBOL(drm_mode_cea_vic);
drivers/gpu/drm/i915/intel_dp.c
... ... @@ -770,7 +770,7 @@
770 770 * CEA-861-E - 5.1 Default Encoding Parameters
771 771 * VESA DisplayPort Ver.1.2a - 5.1.1.1 Video Colorimetry
772 772 */
773   - if (bpp != 18 && drm_mode_cea_vic(adjusted_mode) > 1)
  773 + if (bpp != 18 && drm_match_cea_mode(adjusted_mode) > 1)
774 774 intel_dp->color_range = DP_COLOR_RANGE_16_235;
775 775 else
776 776 intel_dp->color_range = 0;
drivers/gpu/drm/i915/intel_hdmi.c
... ... @@ -348,7 +348,7 @@
348 348 avi_if.body.avi.ITC_EC_Q_SC |= DIP_AVI_RGB_QUANT_RANGE_FULL;
349 349 }
350 350  
351   - avi_if.body.avi.VIC = drm_mode_cea_vic(adjusted_mode);
  351 + avi_if.body.avi.VIC = drm_match_cea_mode(adjusted_mode);
352 352  
353 353 intel_set_infoframe(encoder, &avi_if);
354 354 }
... ... @@ -781,7 +781,7 @@
781 781 if (intel_hdmi->color_range_auto) {
782 782 /* See CEA-861-E - 5.1 Default Encoding Parameters */
783 783 if (intel_hdmi->has_hdmi_sink &&
784   - drm_mode_cea_vic(adjusted_mode) > 1)
  784 + drm_match_cea_mode(adjusted_mode) > 1)
785 785 intel_hdmi->color_range = SDVO_COLOR_RANGE_16_235;
786 786 else
787 787 intel_hdmi->color_range = 0;
drivers/gpu/drm/i915/intel_sdvo.c
... ... @@ -1077,7 +1077,7 @@
1077 1077 if (intel_sdvo->color_range_auto) {
1078 1078 /* See CEA-861-E - 5.1 Default Encoding Parameters */
1079 1079 if (intel_sdvo->has_hdmi_monitor &&
1080   - drm_mode_cea_vic(adjusted_mode) > 1)
  1080 + drm_match_cea_mode(adjusted_mode) > 1)
1081 1081 intel_sdvo->color_range = SDVO_COLOR_RANGE_16_235;
1082 1082 else
1083 1083 intel_sdvo->color_range = 0;
include/drm/drm_crtc.h
... ... @@ -1061,7 +1061,7 @@
1061 1061 extern int drm_mode_gamma_set_ioctl(struct drm_device *dev,
1062 1062 void *data, struct drm_file *file_priv);
1063 1063 extern u8 *drm_find_cea_extension(struct edid *edid);
1064   -extern u8 drm_match_cea_mode(struct drm_display_mode *to_match);
  1064 +extern u8 drm_match_cea_mode(const struct drm_display_mode *to_match);
1065 1065 extern bool drm_detect_hdmi_monitor(struct edid *edid);
1066 1066 extern bool drm_detect_monitor_audio(struct edid *edid);
1067 1067 extern bool drm_rgb_quant_range_selectable(struct edid *edid);
... ... @@ -1079,7 +1079,6 @@
1079 1079 int GTF_2C, int GTF_K, int GTF_2J);
1080 1080 extern int drm_add_modes_noedid(struct drm_connector *connector,
1081 1081 int hdisplay, int vdisplay);
1082   -extern uint8_t drm_mode_cea_vic(const struct drm_display_mode *mode);
1083 1082  
1084 1083 extern int drm_edid_header_is_valid(const u8 *raw_edid);
1085 1084 extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid);