Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 04/11] drm/edid: Define more flags
Date: Mon, 29 Aug 2022 11:39:36 +0300	[thread overview]
Message-ID: <878rn7h29j.fsf@intel.com> (raw)
In-Reply-To: <20220826213501.31490-5-ville.syrjala@linux.intel.com>

On Sat, 27 Aug 2022, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Replace a bunch of hex constants with proper definitions.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/drm_edid.c | 18 +++++++++---------
>  include/drm/drm_edid.h     | 14 +++++++++-----
>  2 files changed, 18 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 4355d73632c3..856d304a1354 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -2984,7 +2984,7 @@ is_rb(const struct detailed_timing *descriptor, void *data)
>  	BUILD_BUG_ON(offsetof(typeof(*descriptor), data.other_data.data.range.formula.cvt.flags) != 15);
>  
>  	if (descriptor->data.other_data.data.range.flags == DRM_EDID_CVT_SUPPORT_FLAG &&
> -	    descriptor->data.other_data.data.range.formula.cvt.flags & 0x10)
> +	    descriptor->data.other_data.data.range.formula.cvt.flags & DRM_EDID_CVT_FLAGS_REDUCED_BLANKING)
>  		*res = true;
>  }
>  
> @@ -3012,7 +3012,7 @@ find_gtf2(const struct detailed_timing *descriptor, void *data)
>  
>  	BUILD_BUG_ON(offsetof(typeof(*descriptor), data.other_data.data.range.flags) != 10);
>  
> -	if (descriptor->data.other_data.data.range.flags == 0x02)
> +	if (descriptor->data.other_data.data.range.flags == DRM_EDID_SECONDARY_GTF_SUPPORT_FLAG)
>  		*res = descriptor;
>  }
>  
> @@ -3415,7 +3415,7 @@ range_pixel_clock(const struct edid *edid, const u8 *t)
>  		return 0;
>  
>  	/* 1.4 with CVT support gives us real precision, yay */
> -	if (edid->revision >= 4 && t[10] == 0x04)
> +	if (edid->revision >= 4 && t[10] == DRM_EDID_CVT_SUPPORT_FLAG)
>  		return (t[9] * 10000) - ((t[12] >> 2) * 250);
>  
>  	/* 1.3 is pathetic, so fuzz up a bit */
> @@ -3441,7 +3441,7 @@ static bool mode_in_range(const struct drm_display_mode *mode,
>  			return false;
>  
>  	/* 1.4 max horizontal check */
> -	if (edid->revision >= 4 && t[10] == 0x04)
> +	if (edid->revision >= 4 && t[10] == DRM_EDID_CVT_SUPPORT_FLAG)
>  		if (t[13] && mode->hdisplay > 8 * (t[13] + (256 * (t[12]&0x3))))
>  			return false;
>  
> @@ -3581,13 +3581,13 @@ do_inferred_modes(const struct detailed_timing *timing, void *c)
>  		return; /* GTF not defined yet */
>  
>  	switch (range->flags) {
> -	case 0x02: /* secondary gtf, XXX could do more */
> -	case 0x00: /* default gtf */
> +	case DRM_EDID_SECONDARY_GTF_SUPPORT_FLAG: /* XXX could do more */
> +	case DRM_EDID_DEFAULT_GTF_SUPPORT_FLAG:
>  		closure->modes += drm_gtf_modes_for_range(closure->connector,
>  							  closure->drm_edid,
>  							  timing);
>  		break;
> -	case 0x04: /* cvt, only in 1.4+ */
> +	case DRM_EDID_CVT_SUPPORT_FLAG:
>  		if (!version_greater(closure->drm_edid, 1, 3))
>  			break;
>  
> @@ -3595,7 +3595,7 @@ do_inferred_modes(const struct detailed_timing *timing, void *c)
>  							  closure->drm_edid,
>  							  timing);
>  		break;
> -	case 0x01: /* just the ranges, no formula */
> +	case DRM_EDID_RANGE_LIMITS_ONLY_FLAG:
>  	default:
>  		break;
>  	}
> @@ -6393,7 +6393,7 @@ static int _drm_edid_connector_update(struct drm_connector *connector,
>  	num_modes += add_cea_modes(connector, drm_edid);
>  	num_modes += add_alternate_cea_modes(connector, drm_edid);
>  	num_modes += add_displayid_detailed_modes(connector, drm_edid);
> -	if (drm_edid->edid->features & DRM_EDID_FEATURE_DEFAULT_GTF)
> +	if (drm_edid->edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ)
>  		num_modes += add_inferred_modes(connector, drm_edid);
>  
>  	if (quirks & (EDID_QUIRK_PREFER_LARGE_60 | EDID_QUIRK_PREFER_LARGE_75))
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index 1ed61e2b30a4..429735b91f63 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -97,10 +97,13 @@ struct detailed_data_string {
>  #define DRM_EDID_RANGE_OFFSET_MIN_HFREQ (1 << 2) /* 1.4 */
>  #define DRM_EDID_RANGE_OFFSET_MAX_HFREQ (1 << 3) /* 1.4 */
>  
> -#define DRM_EDID_DEFAULT_GTF_SUPPORT_FLAG   0x00
> -#define DRM_EDID_RANGE_LIMITS_ONLY_FLAG     0x01
> -#define DRM_EDID_SECONDARY_GTF_SUPPORT_FLAG 0x02
> -#define DRM_EDID_CVT_SUPPORT_FLAG           0x04
> +#define DRM_EDID_DEFAULT_GTF_SUPPORT_FLAG   0x00 /* 1.3 */
> +#define DRM_EDID_RANGE_LIMITS_ONLY_FLAG     0x01 /* 1.4 */
> +#define DRM_EDID_SECONDARY_GTF_SUPPORT_FLAG 0x02 /* 1.3 */
> +#define DRM_EDID_CVT_SUPPORT_FLAG           0x04 /* 1.4 */
> +
> +#define DRM_EDID_CVT_FLAGS_STANDARD_BLANKING (1 << 3)
> +#define DRM_EDID_CVT_FLAGS_REDUCED_BLANKING  (1 << 4)
>  
>  struct detailed_data_monitor_range {
>  	u8 min_vfreq;
> @@ -206,7 +209,8 @@ struct detailed_timing {
>  #define DRM_EDID_DIGITAL_TYPE_DP       (5 << 0) /* 1.4 */
>  #define DRM_EDID_DIGITAL_DFP_1_X       (1 << 0) /* 1.3 */
>  
> -#define DRM_EDID_FEATURE_DEFAULT_GTF      (1 << 0)
> +#define DRM_EDID_FEATURE_DEFAULT_GTF      (1 << 0) /* 1.2 */
> +#define DRM_EDID_FEATURE_CONTINUOUS_FREQ  (1 << 0) /* 1.4 */
>  #define DRM_EDID_FEATURE_PREFERRED_TIMING (1 << 1)
>  #define DRM_EDID_FEATURE_STANDARD_COLOR   (1 << 2)
>  /* If analog */

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2022-08-29  8:39 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26 21:34 [Intel-gfx] [PATCH 00/11] drm/edid: Range descriptor stuff Ville Syrjala
2022-08-26 21:34 ` [Intel-gfx] [PATCH 01/11] drm/edid: Handle EDID 1.4 range descriptor h/vfreq offsets Ville Syrjala
2022-08-27  1:40   ` Navare, Manasi
2022-09-02 13:44     ` Ville Syrjälä
2022-08-26 21:34 ` [Intel-gfx] [PATCH 02/11] drm/edid: Clarify why we only accept the "range limits only" descriptor Ville Syrjala
2022-08-27  1:45   ` Navare, Manasi
2022-08-26 21:34 ` [Intel-gfx] [PATCH 03/11] drm/edid: s/monitor_rage/vrr_range/ Ville Syrjala
2022-08-27  1:47   ` Navare, Manasi
2022-08-29  8:29   ` Jani Nikula
2022-08-26 21:34 ` [Intel-gfx] [PATCH 04/11] drm/edid: Define more flags Ville Syrjala
2022-08-29  8:39   ` Jani Nikula [this message]
2022-08-26 21:34 ` [Intel-gfx] [PATCH 05/11] drm/edid: Only parse VRR range for continuous frequency displays Ville Syrjala
2022-08-29  8:58   ` Jani Nikula
2022-08-26 21:34 ` [Intel-gfx] [PATCH 06/11] drm/edid: Extract drm_gtf2_mode() Ville Syrjala
2022-08-29  8:45   ` Jani Nikula
2022-08-26 21:34 ` [Intel-gfx] [PATCH 07/11] drm/edid: Use GTF2 for inferred modes Ville Syrjala
2022-09-02 12:25   ` Jani Nikula
2022-09-02 12:45     ` Ville Syrjälä
2022-08-26 21:34 ` [Intel-gfx] [PATCH 08/11] drm/edid: Use the correct formula for standard timings Ville Syrjala
2022-09-02 13:41   ` Jani Nikula
2022-09-02 14:02     ` Ville Syrjälä
2022-08-26 21:34 ` [Intel-gfx] [PATCH 09/11] drm/edid: Unconfuse preferred timing stuff a bit Ville Syrjala
2022-09-02 12:27   ` Jani Nikula
2022-08-26 21:35 ` [Intel-gfx] [PATCH 10/11] drm/edid: Make version checks less convoluted Ville Syrjala
2022-09-02 12:31   ` Jani Nikula
2022-08-26 21:35 ` [Intel-gfx] [PATCH 11/11] drm/i915: Infer vrefresh range for eDP if the EDID omits it Ville Syrjala
2022-08-29  8:56   ` Jani Nikula
2022-08-29 12:02   ` [Intel-gfx] [PATCH v2 " Ville Syrjala
2022-08-26 22:35 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/edid: Range descriptor stuff Patchwork
2022-08-26 23:03 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-08-29 14:36 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/edid: Range descriptor stuff (rev2) Patchwork
2022-08-29 15:02 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-08-30 18:08 ` [Intel-gfx] ✓ Fi.CI.IGT: success for drm/edid: Range descriptor stuff Patchwork
2022-08-31  5:36 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/edid: Range descriptor stuff (rev2) 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=878rn7h29j.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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