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 07/12] drm/edid: constify struct detailed_timing in lower level parsing
Date: Mon, 28 Mar 2022 20:35:13 +0300	[thread overview]
Message-ID: <YkHx0UiAzu0mAqTA@intel.com> (raw)
In-Reply-To: <0b7fafcc7784db0003e454544916c273a9eb1250.1648477901.git.jani.nikula@intel.com>

On Mon, Mar 28, 2022 at 05:34:28PM +0300, Jani Nikula wrote:
> Start constifying the struct detailed_timing pointers being passed
> around from bottom up.
> 
> 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 | 40 +++++++++++++++++++-------------------
>  1 file changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 27a0e9bf260c..6d1461991ba4 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -2560,7 +2560,7 @@ static int drm_mode_hsync(const struct drm_display_mode *mode)
>   */
>  static struct drm_display_mode *
>  drm_mode_std(struct drm_connector *connector, struct edid *edid,
> -	     struct std_timing *t)
> +	     const struct std_timing *t)
>  {
>  	struct drm_device *dev = connector->dev;
>  	struct drm_display_mode *m, *mode = NULL;
> @@ -2678,7 +2678,7 @@ drm_mode_std(struct drm_connector *connector, struct edid *edid,
>   */
>  static void
>  drm_mode_do_interlace_quirk(struct drm_display_mode *mode,
> -			    struct detailed_pixel_timing *pt)
> +			    const struct detailed_pixel_timing *pt)
>  {
>  	int i;
>  	static const struct {
> @@ -2722,11 +2722,11 @@ drm_mode_do_interlace_quirk(struct drm_display_mode *mode,
>   */
>  static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
>  						  struct edid *edid,
> -						  struct detailed_timing *timing,
> +						  const struct detailed_timing *timing,
>  						  u32 quirks)
>  {
>  	struct drm_display_mode *mode;
> -	struct detailed_pixel_timing *pt = &timing->data.pixel_data;
> +	const struct detailed_pixel_timing *pt = &timing->data.pixel_data;
>  	unsigned hactive = (pt->hactive_hblank_hi & 0xf0) << 4 | pt->hactive_lo;
>  	unsigned vactive = (pt->vactive_vblank_hi & 0xf0) << 4 | pt->vactive_lo;
>  	unsigned hblank = (pt->hactive_hblank_hi & 0xf) << 8 | pt->hblank_lo;
> @@ -2821,7 +2821,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, u8 *t)
> +		    struct edid *edid, const u8 *t)
>  {
>  	int hsync, hmin, hmax;
>  
> @@ -2838,7 +2838,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, u8 *t)
> +		    struct edid *edid, const u8 *t)
>  {
>  	int vsync, vmin, vmax;
>  
> @@ -2854,7 +2854,7 @@ mode_in_vsync_range(const struct drm_display_mode *mode,
>  }
>  
>  static u32
> -range_pixel_clock(struct edid *edid, u8 *t)
> +range_pixel_clock(struct edid *edid, const u8 *t)
>  {
>  	/* unspecified */
>  	if (t[9] == 0 || t[9] == 255)
> @@ -2870,10 +2870,10 @@ range_pixel_clock(struct edid *edid, u8 *t)
>  
>  static bool
>  mode_in_range(const struct drm_display_mode *mode, struct edid *edid,
> -	      struct detailed_timing *timing)
> +	      const struct detailed_timing *timing)
>  {
>  	u32 max_clock;
> -	u8 *t = (u8 *)timing;
> +	const u8 *t = (const u8 *)timing;
>  
>  	if (!mode_in_hsync_range(mode, edid, t))
>  		return false;
> @@ -2916,7 +2916,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,
> -			struct detailed_timing *timing)
> +			const struct detailed_timing *timing)
>  {
>  	int i, modes = 0;
>  	struct drm_display_mode *newmode;
> @@ -2951,7 +2951,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,
> -			struct detailed_timing *timing)
> +			const struct detailed_timing *timing)
>  {
>  	int i, modes = 0;
>  	struct drm_display_mode *newmode;
> @@ -2980,7 +2980,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,
> -			struct detailed_timing *timing)
> +			const struct detailed_timing *timing)
>  {
>  	int i, modes = 0;
>  	struct drm_display_mode *newmode;
> @@ -3012,8 +3012,8 @@ static void
>  do_inferred_modes(struct detailed_timing *timing, void *c)
>  {
>  	struct detailed_mode_closure *closure = c;
> -	struct detailed_non_pixel *data = &timing->data.other_data;
> -	struct detailed_data_monitor_range *range = &data->data.range;
> +	const struct detailed_non_pixel *data = &timing->data.other_data;
> +	const struct detailed_data_monitor_range *range = &data->data.range;
>  
>  	if (!is_display_descriptor(timing, EDID_DETAIL_MONITOR_RANGE))
>  		return;
> @@ -3062,11 +3062,11 @@ add_inferred_modes(struct drm_connector *connector, struct edid *edid)
>  }
>  
>  static int
> -drm_est3_modes(struct drm_connector *connector, struct detailed_timing *timing)
> +drm_est3_modes(struct drm_connector *connector, const struct detailed_timing *timing)
>  {
>  	int i, j, m, modes = 0;
>  	struct drm_display_mode *mode;
> -	u8 *est = ((u8 *)timing) + 6;
> +	const u8 *est = ((const u8 *)timing) + 6;
>  
>  	for (i = 0; i < 6; i++) {
>  		for (j = 7; j >= 0; j--) {
> @@ -3145,7 +3145,7 @@ static void
>  do_standard_modes(struct detailed_timing *timing, void *c)
>  {
>  	struct detailed_mode_closure *closure = c;
> -	struct detailed_non_pixel *data = &timing->data.other_data;
> +	const struct detailed_non_pixel *data = &timing->data.other_data;
>  	struct drm_connector *connector = closure->connector;
>  	struct edid *edid = closure->edid;
>  	int i;
> @@ -3154,7 +3154,7 @@ do_standard_modes(struct detailed_timing *timing, void *c)
>  		return;
>  
>  	for (i = 0; i < 6; i++) {
> -		struct std_timing *std = &data->data.timings[i];
> +		const struct std_timing *std = &data->data.timings[i];
>  		struct drm_display_mode *newmode;
>  
>  		newmode = drm_mode_std(connector, edid, std);
> @@ -3203,12 +3203,12 @@ add_standard_modes(struct drm_connector *connector, struct edid *edid)
>  }
>  
>  static int drm_cvt_modes(struct drm_connector *connector,
> -			 struct detailed_timing *timing)
> +			 const struct detailed_timing *timing)
>  {
>  	int i, j, modes = 0;
>  	struct drm_display_mode *newmode;
>  	struct drm_device *dev = connector->dev;
> -	struct cvt_timing *cvt;
> +	const struct cvt_timing *cvt;
>  	const int rates[] = { 60, 85, 75, 60, 50 };
>  	const u8 empty[3] = { 0, 0, 0 };
>  
> -- 
> 2.30.2

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2022-03-28 17:35 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ä [this message]
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ä
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=YkHx0UiAzu0mAqTA@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