All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>,
	<intel-xe@lists.freedesktop.org>, <lucas.demarchi@intel.com>,
	<ville.syrjala@linux.intel.com>
Subject: Re: [PATCH v2 9/9] drm/i915/bios: use display->is.PLATFORM instead of IS_PLATFORM()
Date: Wed, 28 Aug 2024 16:52:45 -0400	[thread overview]
Message-ID: <Zs-OHYuyLlBE2Omc@intel.com> (raw)
In-Reply-To: <3957cefee1b89d5443297248a806755d2b001b7a.1724092799.git.jani.nikula@intel.com>

On Mon, Aug 19, 2024 at 09:44:36PM +0300, Jani Nikula wrote:
> Switch to using the new display->is.PLATFORM members.
> 
> There are still cases like IS_G4X() which is trivial with macros, but
> not so with platform members. Ditto for IS_IRONLAKE_M() and IS_IVB_GT1()
> etc. although not used in this file.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_bios.c | 36 +++++++++--------------
>  1 file changed, 14 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> index d49435af62c7..c701f13e0cf6 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> @@ -1168,7 +1168,6 @@ static int intel_bios_ssc_frequency(struct intel_display *display,
>  static void
>  parse_general_features(struct intel_display *display)
>  {
> -	struct drm_i915_private *i915 = to_i915(display->drm);
>  	const struct bdb_general_features *general;
>  
>  	general = bdb_find_section(display, BDB_GENERAL_FEATURES);
> @@ -1178,7 +1177,7 @@ parse_general_features(struct intel_display *display)
>  	display->vbt.int_tv_support = general->int_tv_support;
>  	/* int_crt_support can't be trusted on earlier platforms */
>  	if (display->vbt.version >= 155 &&
> -	    (HAS_DDI(display) || IS_VALLEYVIEW(i915)))
> +	    (HAS_DDI(display) || display->is.VALLEYVIEW))
>  		display->vbt.int_crt_support = general->int_crt_support;
>  	display->vbt.lvds_use_ssc = general->enable_ssc;
>  	display->vbt.lvds_ssc_freq =
> @@ -1541,7 +1540,6 @@ static void
>  parse_psr(struct intel_display *display,
>  	  struct intel_panel *panel)
>  {
> -	struct drm_i915_private *i915 = to_i915(display->drm);
>  	const struct bdb_psr *psr;
>  	const struct psr_table *psr_table;
>  	int panel_type = panel->vbt.panel_type;
> @@ -1566,7 +1564,7 @@ parse_psr(struct intel_display *display,
>  	 * Old decimal value is wake up time in multiples of 100 us.
>  	 */
>  	if (display->vbt.version >= 205 &&
> -	    (DISPLAY_VER(display) >= 9 && !IS_BROXTON(i915))) {
> +	    (DISPLAY_VER(display) >= 9 && !display->is.BROXTON)) {
>  		switch (psr_table->tp1_wakeup_time) {
>  		case 0:
>  			panel->vbt.psr.tp1_wakeup_time_us = 500;
> @@ -2028,11 +2026,9 @@ static void icl_fixup_mipi_sequences(struct intel_display *display,
>  static void fixup_mipi_sequences(struct intel_display *display,
>  				 struct intel_panel *panel)
>  {
> -	struct drm_i915_private *i915 = to_i915(display->drm);
> -
>  	if (DISPLAY_VER(display) >= 11)
>  		icl_fixup_mipi_sequences(display, panel);
> -	else if (IS_VALLEYVIEW(i915))
> +	else if (display->is.VALLEYVIEW)
>  		vlv_fixup_mipi_sequences(display, panel);
>  }
>  
> @@ -2242,15 +2238,15 @@ static u8 map_ddc_pin(struct intel_display *display, u8 vbt_pin)
>  	const u8 *ddc_pin_map;
>  	int i, n_entries;
>  
> -	if (INTEL_PCH_TYPE(i915) >= PCH_MTL || IS_ALDERLAKE_P(i915)) {
> +	if (INTEL_PCH_TYPE(i915) >= PCH_MTL || display->is.ALDERLAKE_P) {
>  		ddc_pin_map = adlp_ddc_pin_map;
>  		n_entries = ARRAY_SIZE(adlp_ddc_pin_map);
> -	} else if (IS_ALDERLAKE_S(i915)) {
> +	} else if (display->is.ALDERLAKE_S) {
>  		ddc_pin_map = adls_ddc_pin_map;
>  		n_entries = ARRAY_SIZE(adls_ddc_pin_map);
>  	} else if (INTEL_PCH_TYPE(i915) >= PCH_DG1) {
>  		return vbt_pin;
> -	} else if (IS_ROCKETLAKE(i915) && INTEL_PCH_TYPE(i915) == PCH_TGP) {
> +	} else if (display->is.ROCKETLAKE && INTEL_PCH_TYPE(i915) == PCH_TGP) {
>  		ddc_pin_map = rkl_pch_tgp_ddc_pin_map;
>  		n_entries = ARRAY_SIZE(rkl_pch_tgp_ddc_pin_map);
>  	} else if (HAS_PCH_TGP(i915) && DISPLAY_VER(display) == 9) {
> @@ -2333,7 +2329,6 @@ static enum port __dvo_port_to_port(int n_ports, int n_dvo,
>  static enum port dvo_port_to_port(struct intel_display *display,
>  				  u8 dvo_port)
>  {
> -	struct drm_i915_private *i915 = to_i915(display->drm);
>  	/*
>  	 * Each DDI port can have more than one value on the "DVO Port" field,
>  	 * so look for all the possible values for each port.
> @@ -2390,12 +2385,12 @@ static enum port dvo_port_to_port(struct intel_display *display,
>  					  ARRAY_SIZE(xelpd_port_mapping[0]),
>  					  xelpd_port_mapping,
>  					  dvo_port);
> -	else if (IS_ALDERLAKE_S(i915))
> +	else if (display->is.ALDERLAKE_S)
>  		return __dvo_port_to_port(ARRAY_SIZE(adls_port_mapping),
>  					  ARRAY_SIZE(adls_port_mapping[0]),
>  					  adls_port_mapping,
>  					  dvo_port);
> -	else if (IS_DG1(i915) || IS_ROCKETLAKE(i915))
> +	else if (display->is.DG1 || display->is.ROCKETLAKE)
>  		return __dvo_port_to_port(ARRAY_SIZE(rkl_port_mapping),
>  					  ARRAY_SIZE(rkl_port_mapping[0]),
>  					  rkl_port_mapping,
> @@ -2518,7 +2513,6 @@ static void sanitize_hdmi_level_shift(struct intel_bios_encoder_data *devdata,
>  				      enum port port)
>  {
>  	struct intel_display *display = devdata->display;
> -	struct drm_i915_private *i915 = to_i915(display->drm);
>  
>  	if (!intel_bios_encoder_supports_dvi(devdata))
>  		return;
> @@ -2528,7 +2522,7 @@ static void sanitize_hdmi_level_shift(struct intel_bios_encoder_data *devdata,
>  	 * with a HSW VBT where the level shifter value goes
>  	 * up to 11, whereas the BDW max is 9.
>  	 */
> -	if (IS_BROADWELL(i915) && devdata->child.hdmi_level_shifter_value > 9) {
> +	if (display->is.BROADWELL && devdata->child.hdmi_level_shifter_value > 9) {
>  		drm_dbg_kms(display->drm,
>  			    "Bogus port %c VBT HDMI level shift %d, adjusting to %d\n",
>  			    port_name(port), devdata->child.hdmi_level_shifter_value, 9);
> @@ -2617,14 +2611,13 @@ int intel_bios_hdmi_max_tmds_clock(const struct intel_bios_encoder_data *devdata
>  
>  static bool is_port_valid(struct intel_display *display, enum port port)
>  {
> -	struct drm_i915_private *i915 = to_i915(display->drm);
>  	/*
>  	 * On some ICL SKUs port F is not present, but broken VBTs mark
>  	 * the port as present. Only try to initialize port F for the
>  	 * SKUs that may actually have it.
>  	 */
> -	if (port == PORT_F && IS_ICELAKE(i915))
> -		return IS_ICL_WITH_PORT_F(i915);
> +	if (port == PORT_F && display->is.ICELAKE)
> +		return display->is.ICELAKE_PORT_F;
>  
>  	return true;
>  }
> @@ -2906,7 +2899,7 @@ init_vbt_missing_defaults(struct intel_display *display)
>  	unsigned int ports = DISPLAY_RUNTIME_INFO(display)->port_mask;
>  	enum port port;
>  
> -	if (!HAS_DDI(display) && !IS_CHERRYVIEW(i915))
> +	if (!HAS_DDI(display) && !display->is.CHERRYVIEW)
>  		return;
>  
>  	for_each_port_masked(port, ports) {
> @@ -3671,17 +3664,16 @@ static const u8 direct_aux_ch_map[] = {
>  
>  static enum aux_ch map_aux_ch(struct intel_display *display, u8 aux_channel)
>  {
> -	struct drm_i915_private *i915 = to_i915(display->drm);
>  	const u8 *aux_ch_map;
>  	int i, n_entries;
>  
>  	if (DISPLAY_VER(display) >= 13) {
>  		aux_ch_map = adlp_aux_ch_map;
>  		n_entries = ARRAY_SIZE(adlp_aux_ch_map);
> -	} else if (IS_ALDERLAKE_S(i915)) {
> +	} else if (display->is.ALDERLAKE_S) {
>  		aux_ch_map = adls_aux_ch_map;
>  		n_entries = ARRAY_SIZE(adls_aux_ch_map);
> -	} else if (IS_DG1(i915) || IS_ROCKETLAKE(i915)) {
> +	} else if (display->is.DG1 || display->is.ROCKETLAKE) {
>  		aux_ch_map = rkl_aux_ch_map;
>  		n_entries = ARRAY_SIZE(rkl_aux_ch_map);
>  	} else {
> -- 
> 2.39.2
> 

  reply	other threads:[~2024-08-28 20:53 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-19 18:44 [PATCH v2 0/9] drm/i915/display: platform identification with display->is.<PLATFORM> Jani Nikula
2024-08-19 18:44 ` [PATCH v2 1/9] drm/i915/display: use a macro to initialize subplatforms Jani Nikula
2024-08-19 18:44 ` [PATCH v2 2/9] drm/i915/display: use a macro to define platform enumerations Jani Nikula
2024-08-19 18:44 ` [PATCH v2 3/9] drm/i915/display: join the platform and subplatform enums Jani Nikula
2024-08-19 18:44 ` [PATCH v2 4/9] drm/i915/display: add display platforms structure with platform members Jani Nikula
2024-08-28 20:46   ` Rodrigo Vivi
2024-08-19 18:44 ` [PATCH v2 5/9] drm/i915/display: add platforms "is" member to struct intel_display Jani Nikula
2024-08-19 18:48   ` [PATCH v3] " Jani Nikula
2024-08-28 20:48     ` Rodrigo Vivi
2024-08-28 20:47   ` [PATCH v2 5/9] " Rodrigo Vivi
2024-08-19 18:44 ` [PATCH v2 6/9] drm/i915/display: remove the display platform enum as unnecessary Jani Nikula
2024-08-28 20:49   ` Rodrigo Vivi
2024-08-19 18:44 ` [PATCH v2 7/9] drm/i915/display: consider HSW/BDW ULX to also be ULT Jani Nikula
2024-08-28 20:50   ` Rodrigo Vivi
2024-08-19 18:44 ` [PATCH v2 8/9] drm/i915/display: keep subplatforms next to their platforms Jani Nikula
2024-08-28 20:52   ` Rodrigo Vivi
2024-08-19 18:44 ` [PATCH v2 9/9] drm/i915/bios: use display->is.PLATFORM instead of IS_PLATFORM() Jani Nikula
2024-08-28 20:52   ` Rodrigo Vivi [this message]
2024-08-19 18:51 ` ✓ CI.Patch_applied: success for drm/i915/display: platform identification with display->is.<PLATFORM> (rev2) Patchwork
2024-08-19 18:51 ` ✗ CI.checkpatch: warning " Patchwork
2024-08-19 18:52 ` ✓ CI.KUnit: success " Patchwork
2024-08-19 19:04 ` ✓ CI.Build: " Patchwork
2024-08-19 19:06 ` ✓ CI.Hooks: " Patchwork
2024-08-19 19:08 ` ✗ CI.checksparse: warning " Patchwork
2024-08-19 19:13 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/display: platform identification with display->is.<PLATFORM> (rev3) Patchwork
2024-08-19 19:13 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-08-19 19:15 ` ✓ Fi.CI.BAT: success " Patchwork
2024-08-19 19:30 ` ✗ CI.BAT: failure for drm/i915/display: platform identification with display->is.<PLATFORM> (rev2) Patchwork
2024-08-19 19:35 ` ✓ CI.Patch_applied: success for drm/i915/display: platform identification with display->is.<PLATFORM> (rev3) Patchwork
2024-08-19 19:35 ` ✗ CI.checkpatch: warning " Patchwork
2024-08-19 19:36 ` ✓ CI.KUnit: success " Patchwork
2024-08-19 19:51 ` ✓ CI.Build: " Patchwork
2024-08-19 19:54 ` ✓ CI.Hooks: " Patchwork
2024-08-19 19:56 ` ✗ CI.checksparse: warning " Patchwork
2024-08-19 20:16 ` ✓ CI.BAT: success " Patchwork
2024-08-19 23:31 ` ✗ CI.FULL: failure for drm/i915/display: platform identification with display->is.<PLATFORM> (rev2) Patchwork
2024-08-20  0:25 ` ✗ CI.FULL: failure for drm/i915/display: platform identification with display->is.<PLATFORM> (rev3) Patchwork
2024-08-20  9:51 ` ✗ Fi.CI.IGT: " Patchwork
2024-08-28 20:41 ` [PATCH v2 0/9] drm/i915/display: platform identification with display->is.<PLATFORM> Rodrigo Vivi
2024-08-29 16:03   ` Ville Syrjälä
2024-09-24  9:49     ` Jani Nikula
2024-09-24 13:14       ` Lucas De Marchi
2024-09-24 13:37         ` Jani Nikula
2024-09-24 13:43           ` Ville Syrjälä
2024-09-26 14:58           ` Rodrigo Vivi
2024-09-27 12:16             ` Jani Nikula
2024-09-27 14:49               ` Rodrigo Vivi
2024-09-27 15:01                 ` Jani Nikula
2024-09-27 16:13                   ` Rodrigo Vivi
2024-09-27 18:12                     ` Lucas De Marchi

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=Zs-OHYuyLlBE2Omc@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=lucas.demarchi@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.