diff mbox

[v3,9/9] drm: Remove duplicate drm_mode_cea_vic()

Message ID 1358173828-31674-10-git-send-email-thierry.reding@avionic-design.de (mailing list archive)
State New, archived
Headers show

Commit Message

Thierry Reding Jan. 14, 2013, 2:30 p.m. UTC
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>
---
 drivers/gpu/drm/drm_edid.c | 30 +++++++-----------------------
 include/drm/drm_crtc.h     |  3 +--
 2 files changed, 8 insertions(+), 25 deletions(-)

Comments

Ville Syrjälä Jan. 14, 2013, 2:57 p.m. UTC | #1
On Mon, Jan 14, 2013 at 03:30:28PM +0100, Thierry Reding wrote:
> 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.

And I just used that function. Oh well ;)

Personally I would have kept the other function instead since it has a
more descriptive name, but I can't be bothered to care enough to
complain too much.

The patch could be moved to the beginning of the series, so it can be
merged w/o being blocked by the more invasive stuff. Well, assuming that
the more invasive stuff still needs discussing.

> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
> ---
>  drivers/gpu/drm/drm_edid.c | 30 +++++++-----------------------
>  include/drm/drm_crtc.h     |  3 +--
>  2 files changed, 8 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 1cfafc0..0acd6f3 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1514,11 +1514,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
> + * @mode: 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;
> @@ -2082,25 +2085,6 @@ int drm_add_modes_noedid(struct drm_connector *connector,
>  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);
> -
> -/**
>   * drm_hdmi_avi_infoframe_from_display_mode() - fill an HDMI AVI infoframe with
>   *                                              data from a DRM display mode
>   * @frame: HDMI AVI infoframe
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index dd62ca0..d0f3927 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -1031,7 +1031,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 int drm_mode_page_flip_ioctl(struct drm_device *dev,
> @@ -1048,7 +1048,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);
> -- 
> 1.8.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
Thierry Reding Jan. 14, 2013, 3:03 p.m. UTC | #2
On Mon, Jan 14, 2013 at 04:57:56PM +0200, Ville Syrjälä wrote:
> On Mon, Jan 14, 2013 at 03:30:28PM +0100, Thierry Reding wrote:
> > 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.
> 
> And I just used that function. Oh well ;)
> 
> Personally I would have kept the other function instead since it has a
> more descriptive name, but I can't be bothered to care enough to
> complain too much.

drm_mode_cea_vic() was introduced later, so I preferred the older
variant.

> The patch could be moved to the beginning of the series, so it can be
> merged w/o being blocked by the more invasive stuff. Well, assuming that
> the more invasive stuff still needs discussing.

I had it at the beginning of the series, then realized that I hadn't
updated the i915 driver properly. So I cheated a bit and just moved the
patch instead of updating i915 and then resolving the conflict in the
subsequent i915 HDMI helper patch. =)

If the series can't be merged as-is, I can work this in for the next
version.

Thierry
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 1cfafc0..0acd6f3 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1514,11 +1514,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
+ * @mode: 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;
@@ -2082,25 +2085,6 @@  int drm_add_modes_noedid(struct drm_connector *connector,
 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);
-
-/**
  * drm_hdmi_avi_infoframe_from_display_mode() - fill an HDMI AVI infoframe with
  *                                              data from a DRM display mode
  * @frame: HDMI AVI infoframe
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index dd62ca0..d0f3927 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -1031,7 +1031,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 int drm_mode_page_flip_ioctl(struct drm_device *dev,
@@ -1048,7 +1048,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);