Intel-XE 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>,
	intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 2/6] drm/i915/cdclk: Convert CDCLK code to intel_display
Date: Fri, 06 Sep 2024 18:18:58 +0300	[thread overview]
Message-ID: <87mskkn731.fsf@intel.com> (raw)
In-Reply-To: <20240906143306.15937-3-ville.syrjala@linux.intel.com>

On Fri, 06 Sep 2024, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> struct intel_display will replace struct drm_i915_private as
> the main thing for display code. Convert the CDCLK code to
> use it (as much as possible at this stage).
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Some nitpicks inline, but overall

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

[snip]

> @@ -2685,20 +2712,21 @@ intel_set_cdclk_post_plane_update(struct intel_atomic_state *state)
>  	else
>  		pipe = INVALID_PIPE;
>  
> -	drm_WARN_ON(&i915->drm, !new_cdclk_state->base.changed);
> +	drm_WARN_ON(display->drm, !new_cdclk_state->base.changed);
>  
> -	intel_set_cdclk(i915, &new_cdclk_state->actual, pipe,
> +	intel_set_cdclk(display, &new_cdclk_state->actual, pipe,
>  			"Post changing CDCLK to");
>  }
>  
>  static int intel_pixel_rate_to_cdclk(const struct intel_crtc_state *crtc_state)
>  {
> -	struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);
> +	struct intel_display *display = to_intel_display(crtc_state->uapi.crtc->dev);

This works, but to_intel_display(crtc_state) is enough.

> +	struct drm_i915_private *dev_priv = to_i915(display->drm);

I usually don't bother with changing the dev_priv initialization if it
keeps working. I just put the display stuff first. But this works.

>  	int pixel_rate = crtc_state->pixel_rate;
>  
> -	if (DISPLAY_VER(dev_priv) >= 10)
> +	if (DISPLAY_VER(display) >= 10)
>  		return DIV_ROUND_UP(pixel_rate, 2);
> -	else if (DISPLAY_VER(dev_priv) == 9 ||
> +	else if (DISPLAY_VER(display) == 9 ||
>  		 IS_BROADWELL(dev_priv) || IS_HASWELL(dev_priv))
>  		return pixel_rate;
>  	else if (IS_CHERRYVIEW(dev_priv))
> @@ -2712,11 +2740,11 @@ static int intel_pixel_rate_to_cdclk(const struct intel_crtc_state *crtc_state)

[snip]

> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c
> index 408c76852495..9ff08dbefc76 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_device.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_device.c
> @@ -1678,7 +1678,7 @@ static void __intel_display_device_info_runtime_init(struct drm_i915_private *i9
>  		}
>  	}
>  
> -	display_runtime->rawclk_freq = intel_read_rawclk(i915);
> +	display_runtime->rawclk_freq = intel_read_rawclk(&i915->display);

I generally prefer adding that struct intel_display local variable when
I need it the first time, so the subsequent changes are less churn.


-- 
Jani Nikula, Intel

  parent reply	other threads:[~2024-09-06 15:19 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-06 14:33 [PATCH 0/6] drm/i915: Some intel_display conversions Ville Syrjala
2024-09-06 14:33 ` [PATCH 1/6] drm/i915/cdclk: Add missing braces Ville Syrjala
2024-09-06 15:10   ` Rodrigo Vivi
2024-09-06 15:19   ` Jani Nikula
2024-09-06 14:33 ` [PATCH 2/6] drm/i915/cdclk: Convert CDCLK code to intel_display Ville Syrjala
2024-09-06 15:09   ` Rodrigo Vivi
2024-09-06 15:18   ` Jani Nikula [this message]
2024-09-06 16:17     ` Ville Syrjälä
2024-09-06 14:33 ` [PATCH 3/6] drm/i915/power: Convert low level DC state " Ville Syrjala
2024-09-06 15:10   ` Rodrigo Vivi
2024-09-06 14:33 ` [PATCH 4/6] drm/i915/vga: Convert VGA " Ville Syrjala
2024-09-06 15:12   ` Rodrigo Vivi
2024-09-06 14:33 ` [PATCH 5/6] drm/i915/power: Convert "i830 power well" " Ville Syrjala
2024-09-06 15:13   ` Rodrigo Vivi
2024-09-06 14:33 ` [PATCH 6/6] drm/i915/dmc: Convert DMC " Ville Syrjala
2024-09-06 15:16   ` Rodrigo Vivi
2024-09-06 14:38 ` ✓ CI.Patch_applied: success for drm/i915: Some intel_display conversions Patchwork
2024-09-06 14:39 ` ✗ CI.checkpatch: warning " Patchwork
2024-09-06 14:40 ` ✓ CI.KUnit: success " Patchwork
2024-09-06 14:57 ` ✓ CI.Build: " Patchwork
2024-09-06 15:02 ` ✓ CI.Hooks: " Patchwork
2024-09-06 15:03 ` ✗ CI.checksparse: warning " Patchwork
2024-09-06 15:45 ` ✓ CI.BAT: success " Patchwork
2024-09-09 10:12 ` ✗ CI.FULL: failure " 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=87mskkn731.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@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