Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v3 10/12] drm/edid: constify struct edid passed around in callbacks and closure
Date: Mon, 28 Mar 2022 20:40:15 +0300	[thread overview]
Message-ID: <YkHy/10HdEPG9459@intel.com> (raw)
In-Reply-To: <8229be49b5a7686856c17428aa9291b4c4cf1bd5.1648477901.git.jani.nikula@intel.com>

On Mon, Mar 28, 2022 at 05:34:31PM +0300, Jani Nikula wrote:
> Finalize detailed timing parsing constness by making struct edid also
> const in callbacks and closure.
> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/drm_edid.c | 48 +++++++++++++++++++-------------------
>  1 file changed, 24 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index dae394688e5b..625fa6a4a93a 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -97,7 +97,7 @@ static int oui(u8 first, u8 second, u8 third)
>  
>  struct detailed_mode_closure {
>  	struct drm_connector *connector;
> -	struct edid *edid;
> +	const struct edid *edid;
>  	bool preferred;
>  	u32 quirks;
>  	int modes;
> @@ -2424,7 +2424,7 @@ is_rb(const struct detailed_timing *descriptor, void *data)
>  
>  /* EDID 1.4 defines this explicitly.  For EDID 1.3, we guess, badly. */
>  static bool
> -drm_monitor_supports_rb(struct edid *edid)
> +drm_monitor_supports_rb(const struct edid *edid)
>  {
>  	if (edid->revision >= 4) {
>  		bool ret = false;
> @@ -2452,7 +2452,7 @@ find_gtf2(const struct detailed_timing *descriptor, void *data)
>  
>  /* Secondary GTF curve kicks in above some break frequency */
>  static int
> -drm_gtf2_hbreak(struct edid *edid)
> +drm_gtf2_hbreak(const struct edid *edid)
>  {
>  	const struct detailed_timing *descriptor = NULL;
>  
> @@ -2464,7 +2464,7 @@ drm_gtf2_hbreak(struct edid *edid)
>  }
>  
>  static int
> -drm_gtf2_2c(struct edid *edid)
> +drm_gtf2_2c(const struct edid *edid)
>  {
>  	const struct detailed_timing *descriptor = NULL;
>  
> @@ -2476,7 +2476,7 @@ drm_gtf2_2c(struct edid *edid)
>  }
>  
>  static int
> -drm_gtf2_m(struct edid *edid)
> +drm_gtf2_m(const struct edid *edid)
>  {
>  	const struct detailed_timing *descriptor = NULL;
>  
> @@ -2488,7 +2488,7 @@ drm_gtf2_m(struct edid *edid)
>  }
>  
>  static int
> -drm_gtf2_k(struct edid *edid)
> +drm_gtf2_k(const struct edid *edid)
>  {
>  	const struct detailed_timing *descriptor = NULL;
>  
> @@ -2500,7 +2500,7 @@ drm_gtf2_k(struct edid *edid)
>  }
>  
>  static int
> -drm_gtf2_2j(struct edid *edid)
> +drm_gtf2_2j(const struct edid *edid)
>  {
>  	const struct detailed_timing *descriptor = NULL;
>  
> @@ -2515,7 +2515,7 @@ drm_gtf2_2j(struct edid *edid)
>   * standard_timing_level - get std. timing level(CVT/GTF/DMT)
>   * @edid: EDID block to scan
>   */
> -static int standard_timing_level(struct edid *edid)
> +static int standard_timing_level(const struct edid *edid)
>  {
>  	if (edid->revision >= 2) {
>  		if (edid->revision >= 4 && (edid->features & DRM_EDID_FEATURE_DEFAULT_GTF))
> @@ -2558,7 +2558,7 @@ static int drm_mode_hsync(const struct drm_display_mode *mode)
>   * and convert them into a real mode using CVT/GTF/DMT.
>   */
>  static struct drm_display_mode *
> -drm_mode_std(struct drm_connector *connector, struct edid *edid,
> +drm_mode_std(struct drm_connector *connector, const struct edid *edid,
>  	     const struct std_timing *t)
>  {
>  	struct drm_device *dev = connector->dev;
> @@ -2720,7 +2720,7 @@ drm_mode_do_interlace_quirk(struct drm_display_mode *mode,
>   * return a new struct drm_display_mode.
>   */
>  static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
> -						  struct edid *edid,
> +						  const struct edid *edid,
>  						  const struct detailed_timing *timing,
>  						  u32 quirks)
>  {
> @@ -2820,7 +2820,7 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
>  
>  static bool
>  mode_in_hsync_range(const struct drm_display_mode *mode,
> -		    struct edid *edid, const u8 *t)
> +		    const struct edid *edid, const u8 *t)
>  {
>  	int hsync, hmin, hmax;
>  
> @@ -2837,7 +2837,7 @@ mode_in_hsync_range(const struct drm_display_mode *mode,
>  
>  static bool
>  mode_in_vsync_range(const struct drm_display_mode *mode,
> -		    struct edid *edid, const u8 *t)
> +		    const struct edid *edid, const u8 *t)
>  {
>  	int vsync, vmin, vmax;
>  
> @@ -2853,7 +2853,7 @@ mode_in_vsync_range(const struct drm_display_mode *mode,
>  }
>  
>  static u32
> -range_pixel_clock(struct edid *edid, const u8 *t)
> +range_pixel_clock(const struct edid *edid, const u8 *t)
>  {
>  	/* unspecified */
>  	if (t[9] == 0 || t[9] == 255)
> @@ -2868,7 +2868,7 @@ range_pixel_clock(struct edid *edid, const u8 *t)
>  }
>  
>  static bool
> -mode_in_range(const struct drm_display_mode *mode, struct edid *edid,
> +mode_in_range(const struct drm_display_mode *mode, const struct edid *edid,
>  	      const struct detailed_timing *timing)
>  {
>  	u32 max_clock;
> @@ -2914,7 +2914,7 @@ static bool valid_inferred_mode(const struct drm_connector *connector,
>  }
>  
>  static int
> -drm_dmt_modes_for_range(struct drm_connector *connector, struct edid *edid,
> +drm_dmt_modes_for_range(struct drm_connector *connector, const struct edid *edid,
>  			const struct detailed_timing *timing)
>  {
>  	int i, modes = 0;
> @@ -2949,7 +2949,7 @@ void drm_mode_fixup_1366x768(struct drm_display_mode *mode)
>  }
>  
>  static int
> -drm_gtf_modes_for_range(struct drm_connector *connector, struct edid *edid,
> +drm_gtf_modes_for_range(struct drm_connector *connector, const struct edid *edid,
>  			const struct detailed_timing *timing)
>  {
>  	int i, modes = 0;
> @@ -2978,7 +2978,7 @@ drm_gtf_modes_for_range(struct drm_connector *connector, struct edid *edid,
>  }
>  
>  static int
> -drm_cvt_modes_for_range(struct drm_connector *connector, struct edid *edid,
> +drm_cvt_modes_for_range(struct drm_connector *connector, const struct edid *edid,
>  			const struct detailed_timing *timing)
>  {
>  	int i, modes = 0;
> @@ -3046,7 +3046,7 @@ do_inferred_modes(const struct detailed_timing *timing, void *c)
>  }
>  
>  static int
> -add_inferred_modes(struct drm_connector *connector, struct edid *edid)
> +add_inferred_modes(struct drm_connector *connector, const struct edid *edid)
>  {
>  	struct detailed_mode_closure closure = {
>  		.connector = connector,
> @@ -3108,7 +3108,7 @@ do_established_modes(const struct detailed_timing *timing, void *c)
>   * (defined above).  Tease them out and add them to the global modes list.
>   */
>  static int
> -add_established_modes(struct drm_connector *connector, struct edid *edid)
> +add_established_modes(struct drm_connector *connector, const struct edid *edid)
>  {
>  	struct drm_device *dev = connector->dev;
>  	unsigned long est_bits = edid->established_timings.t1 |
> @@ -3145,7 +3145,7 @@ do_standard_modes(const struct detailed_timing *timing, void *c)
>  	struct detailed_mode_closure *closure = c;
>  	const struct detailed_non_pixel *data = &timing->data.other_data;
>  	struct drm_connector *connector = closure->connector;
> -	struct edid *edid = closure->edid;
> +	const struct edid *edid = closure->edid;
>  	int i;
>  
>  	if (!is_display_descriptor(timing, EDID_DETAIL_STD_MODES))
> @@ -3172,7 +3172,7 @@ do_standard_modes(const struct detailed_timing *timing, void *c)
>   * GTF or CVT. Grab them from @edid and add them to the list.
>   */
>  static int
> -add_standard_modes(struct drm_connector *connector, struct edid *edid)
> +add_standard_modes(struct drm_connector *connector, const struct edid *edid)
>  {
>  	int i, modes = 0;
>  	struct detailed_mode_closure closure = {
> @@ -3264,7 +3264,7 @@ do_cvt_mode(const struct detailed_timing *timing, void *c)
>  }
>  
>  static int
> -add_cvt_modes(struct drm_connector *connector, struct edid *edid)
> +add_cvt_modes(struct drm_connector *connector, const struct edid *edid)
>  {
>  	struct detailed_mode_closure closure = {
>  		.connector = connector,
> @@ -3318,7 +3318,7 @@ do_detailed_mode(const struct detailed_timing *timing, void *c)
>   * @quirks: quirks to apply
>   */
>  static int
> -add_detailed_modes(struct drm_connector *connector, struct edid *edid,
> +add_detailed_modes(struct drm_connector *connector, const struct edid *edid,
>  		   u32 quirks)
>  {
>  	struct detailed_mode_closure closure = {
> @@ -4525,7 +4525,7 @@ monitor_name(const struct detailed_timing *timing, void *data)
>  	*res = timing->data.other_data.data.str.str;
>  }
>  
> -static int get_monitor_name(struct edid *edid, char name[13])
> +static int get_monitor_name(const struct edid *edid, char name[13])
>  {
>  	const char *edid_name = NULL;
>  	int mnl;
> -- 
> 2.30.2

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2022-03-28 17:40 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28 14:34 [Intel-gfx] [PATCH v3 00/12] drm/edid: constify EDID parsing, with fixes Jani Nikula
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 01/12] drm/edid: don't modify EDID while parsing Jani Nikula
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 02/12] drm/edid: fix reduced blanking support check Jani Nikula
2022-03-28 17:27   ` Ville Syrjälä
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 03/12] drm/edid: pass a timing pointer to is_display_descriptor() Jani Nikula
2022-03-28 17:28   ` Ville Syrjälä
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 04/12] drm/edid: pass a timing pointer to is_detailed_timing_descriptor() Jani Nikula
2022-03-28 17:29   ` Ville Syrjälä
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 05/12] drm/edid: use struct detailed_timing member access in is_rb() Jani Nikula
2022-03-28 17:29   ` Ville Syrjälä
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 06/12] drm/edid: use struct detailed_timing member access in gtf2 functions Jani Nikula
2022-03-28 17:34   ` Ville Syrjälä
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 07/12] drm/edid: constify struct detailed_timing in lower level parsing Jani Nikula
2022-03-28 17:35   ` Ville Syrjälä
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 08/12] drm/edid: constify struct detailed_timing in parsing callbacks Jani Nikula
2022-03-28 17:37   ` Ville Syrjälä
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 09/12] drm/edid: constify struct edid passed to detailed blocks Jani Nikula
2022-03-28 17:39   ` Ville Syrjälä
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 10/12] drm/edid: constify struct edid passed around in callbacks and closure Jani Nikula
2022-03-28 17:40   ` Ville Syrjälä [this message]
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 11/12] drm/edid: add more general struct edid constness in the interfaces Jani Nikula
2022-03-28 17:41   ` Ville Syrjälä
2022-03-28 14:34 ` [Intel-gfx] [PATCH v3 12/12] drm/edid: split drm_add_edid_modes() to two Jani Nikula
2022-03-28 17:48   ` Ville Syrjälä
2022-03-28 18:35     ` Jani Nikula
2022-03-28 18:00 ` [Intel-gfx] [PATCH v3 00/12] drm/edid: constify EDID parsing, with fixes Emil Velikov
2022-03-28 18:36   ` Jani Nikula
2022-03-29  1:28 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/edid: constify EDID parsing, with fixes (rev2) Patchwork
2022-03-29  1:30 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-03-29  1:34 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2022-03-29  1:59 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-03-29  4:35 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-03-29  9:21 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/edid: constify EDID parsing, with fixes (rev3) Patchwork
2022-03-29  9:23 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-03-29  9:27 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2022-03-29  9:59 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-03-29 12:55 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YkHy/10HdEPG9459@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox