From: Jani Nikula <jani.nikula@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v2 01/12] drm/i915: Pass intel_display to intel_scanout_needs_vtd_wa()
Date: Fri, 07 Feb 2025 13:08:26 +0200 [thread overview]
Message-ID: <87r04a3tcl.fsf@intel.com> (raw)
In-Reply-To: <20250206185533.32306-2-ville.syrjala@linux.intel.com>
On Thu, 06 Feb 2025, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Now that intel_scanout_needs_vtd_wa() is no longer used from
> the gem code we can convert it to take struct intel_display.
> which will help with converting the low level plane code over
> as well.
>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/display/i9xx_plane.c | 11 ++++++-----
> drivers/gpu/drm/i915/display/intel_cursor.c | 7 ++++---
> drivers/gpu/drm/i915/display/intel_display.c | 6 ++++--
> drivers/gpu/drm/i915/display/intel_display.h | 2 +-
> drivers/gpu/drm/i915/display/intel_sprite.c | 10 +++++-----
> drivers/gpu/drm/i915/display/skl_universal_plane.c | 3 ++-
> 6 files changed, 22 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/i9xx_plane.c b/drivers/gpu/drm/i915/display/i9xx_plane.c
> index bd3f8db13700..110ad49884be 100644
> --- a/drivers/gpu/drm/i915/display/i9xx_plane.c
> +++ b/drivers/gpu/drm/i915/display/i9xx_plane.c
> @@ -780,13 +780,13 @@ unsigned int vlv_plane_min_alignment(struct intel_plane *plane,
> const struct drm_framebuffer *fb,
> int color_plane)
> {
> - struct drm_i915_private *i915 = to_i915(plane->base.dev);
> + struct intel_display *display = to_intel_display(plane);
>
> if (intel_plane_can_async_flip(plane, fb->modifier))
> return 256 * 1024;
>
> /* FIXME undocumented so not sure what's actually needed */
> - if (intel_scanout_needs_vtd_wa(i915))
> + if (intel_scanout_needs_vtd_wa(display))
> return 256 * 1024;
>
> switch (fb->modifier) {
> @@ -804,12 +804,12 @@ static unsigned int g4x_primary_min_alignment(struct intel_plane *plane,
> const struct drm_framebuffer *fb,
> int color_plane)
> {
> - struct drm_i915_private *i915 = to_i915(plane->base.dev);
> + struct intel_display *display = to_intel_display(plane);
>
> if (intel_plane_can_async_flip(plane, fb->modifier))
> return 256 * 1024;
>
> - if (intel_scanout_needs_vtd_wa(i915))
> + if (intel_scanout_needs_vtd_wa(display))
> return 256 * 1024;
>
> switch (fb->modifier) {
> @@ -865,6 +865,7 @@ static const struct drm_plane_funcs i8xx_plane_funcs = {
> struct intel_plane *
> intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
> {
> + struct intel_display *display = &dev_priv->display;
> struct intel_plane *plane;
> const struct drm_plane_funcs *plane_funcs;
> unsigned int supported_rotations;
> @@ -959,7 +960,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
> plane->min_alignment = i9xx_plane_min_alignment;
>
> /* FIXME undocumented for VLV/CHV so not sure what's actually needed */
> - if (intel_scanout_needs_vtd_wa(dev_priv))
> + if (intel_scanout_needs_vtd_wa(display))
> plane->vtd_guard = 128;
>
> if (IS_I830(dev_priv) || IS_I845G(dev_priv)) {
> diff --git a/drivers/gpu/drm/i915/display/intel_cursor.c b/drivers/gpu/drm/i915/display/intel_cursor.c
> index 6a1035a22b0a..791557b99d94 100644
> --- a/drivers/gpu/drm/i915/display/intel_cursor.c
> +++ b/drivers/gpu/drm/i915/display/intel_cursor.c
> @@ -372,9 +372,9 @@ static unsigned int i9xx_cursor_min_alignment(struct intel_plane *plane,
> const struct drm_framebuffer *fb,
> int color_plane)
> {
> - struct drm_i915_private *i915 = to_i915(plane->base.dev);
> + struct intel_display *display = to_intel_display(plane);
>
> - if (intel_scanout_needs_vtd_wa(i915))
> + if (intel_scanout_needs_vtd_wa(display))
> return 64 * 1024;
>
> return 4 * 1024; /* physical for i915/i945 */
> @@ -989,6 +989,7 @@ struct intel_plane *
> intel_cursor_plane_create(struct drm_i915_private *dev_priv,
> enum pipe pipe)
> {
> + struct intel_display *display = &dev_priv->display;
> struct intel_plane *cursor;
> int ret, zpos;
> u64 *modifiers;
> @@ -1019,7 +1020,7 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
> else
> cursor->min_alignment = i9xx_cursor_min_alignment;
>
> - if (intel_scanout_needs_vtd_wa(dev_priv))
> + if (intel_scanout_needs_vtd_wa(display))
> cursor->vtd_guard = 2;
>
> cursor->update_arm = i9xx_cursor_update_arm;
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index a6383ddde871..0f4d4a86cb98 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -8782,7 +8782,9 @@ void intel_hpd_poll_fini(struct drm_i915_private *i915)
> drm_connector_list_iter_end(&conn_iter);
> }
>
> -bool intel_scanout_needs_vtd_wa(struct drm_i915_private *i915)
> +bool intel_scanout_needs_vtd_wa(struct intel_display *display)
> {
> - return IS_DISPLAY_VER(i915, 6, 11) && i915_vtd_active(i915);
> + struct drm_i915_private *i915 = to_i915(display->drm);
> +
> + return IS_DISPLAY_VER(display, 6, 11) && i915_vtd_active(i915);
> }
> diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h
> index 49a246feb1ae..793c9d30c582 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.h
> +++ b/drivers/gpu/drm/i915/display/intel_display.h
> @@ -596,7 +596,7 @@ bool assert_port_valid(struct drm_i915_private *i915, enum port port);
> unlikely(__ret_warn_on); \
> })
>
> -bool intel_scanout_needs_vtd_wa(struct drm_i915_private *i915);
> +bool intel_scanout_needs_vtd_wa(struct intel_display *display);
> int intel_crtc_num_joined_pipes(const struct intel_crtc_state *crtc_state);
>
> #endif
> diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
> index a6b27798fdc3..d873c3ea5fa6 100644
> --- a/drivers/gpu/drm/i915/display/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
> @@ -980,9 +980,9 @@ static unsigned int g4x_sprite_min_alignment(struct intel_plane *plane,
> const struct drm_framebuffer *fb,
> int color_plane)
> {
> - struct drm_i915_private *i915 = to_i915(plane->base.dev);
> + struct intel_display *display = to_intel_display(plane);
>
> - if (intel_scanout_needs_vtd_wa(i915))
> + if (intel_scanout_needs_vtd_wa(display))
> return 128 * 1024;
>
> return 4 * 1024;
> @@ -1610,7 +1610,7 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
> plane->min_cdclk = vlv_plane_min_cdclk;
>
> /* FIXME undocumented for VLV/CHV so not sure what's actually needed */
> - if (intel_scanout_needs_vtd_wa(dev_priv))
> + if (intel_scanout_needs_vtd_wa(display))
> plane->vtd_guard = 128;
>
> if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B) {
> @@ -1639,7 +1639,7 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
>
> plane->min_alignment = g4x_sprite_min_alignment;
>
> - if (intel_scanout_needs_vtd_wa(dev_priv))
> + if (intel_scanout_needs_vtd_wa(display))
> plane->vtd_guard = 64;
>
> formats = snb_sprite_formats;
> @@ -1656,7 +1656,7 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
> plane->min_alignment = g4x_sprite_min_alignment;
> plane->min_cdclk = g4x_sprite_min_cdclk;
>
> - if (intel_scanout_needs_vtd_wa(dev_priv))
> + if (intel_scanout_needs_vtd_wa(display))
> plane->vtd_guard = 64;
>
> if (IS_SANDYBRIDGE(dev_priv)) {
> diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> index ee93361bba09..e166e1915afa 100644
> --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> @@ -2697,6 +2697,7 @@ struct intel_plane *
> skl_universal_plane_create(struct drm_i915_private *dev_priv,
> enum pipe pipe, enum plane_id plane_id)
> {
> + struct intel_display *display = &dev_priv->display;
> const struct drm_plane_funcs *plane_funcs;
> struct intel_plane *plane;
> enum drm_plane_type plane_type;
> @@ -2750,7 +2751,7 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
> else
> plane->min_alignment = skl_plane_min_alignment;
>
> - if (intel_scanout_needs_vtd_wa(dev_priv))
> + if (intel_scanout_needs_vtd_wa(display))
> plane->vtd_guard = DISPLAY_VER(dev_priv) >= 10 ? 168 : 136;
>
> if (DISPLAY_VER(dev_priv) >= 11) {
--
Jani Nikula, Intel
next prev parent reply other threads:[~2025-02-07 11:10 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-06 18:55 [PATCH v2 00/12] drm/i915: intel_display conversions and some debug improvements Ville Syrjala
2025-02-06 18:55 ` [PATCH v2 01/12] drm/i915: Pass intel_display to intel_scanout_needs_vtd_wa() Ville Syrjala
2025-02-07 11:08 ` Jani Nikula [this message]
2025-02-06 18:55 ` [PATCH v2 02/12] drm/i915: Decouple i915_gem_dumb_create() from the display a bit Ville Syrjala
2025-02-06 18:55 ` [PATCH v2 03/12] drm/i915: Decouple intel_fb_bo.h interfaces from driver specific types Ville Syrjala
2025-02-06 18:55 ` [PATCH v2 04/12] drm/i915: Convert intel_crtc.c to struct intel_display Ville Syrjala
2025-02-06 18:55 ` [PATCH v2 05/12] drm/i915: Convert intel_fb.c " Ville Syrjala
2025-02-06 18:55 ` [PATCH v2 06/12] drm/i915: Convert intel_display_power_{get, put}*() to intel_display Ville Syrjala
2025-02-06 18:55 ` [PATCH v2 07/12] drm/i915: Convert i9xx_plane.c to struct intel_display Ville Syrjala
2025-02-06 18:55 ` [PATCH v2 08/12] drm/i915: Finish intel_sprite.c struct intel_display conversion Ville Syrjala
2025-02-06 18:55 ` [PATCH v2 09/12] drm/i915: Convert intel_cursor.c to struct intel_display Ville Syrjala
2025-02-06 18:55 ` [PATCH v2 10/12] drm/i915: Convert skl_univeral_plane.c " Ville Syrjala
2025-02-06 18:55 ` [PATCH v2 11/12] drm/i915: Use DRM_RECT_FMT & co. for plane debugs Ville Syrjala
2025-02-06 18:55 ` [PATCH v2 12/12] drm/i915: Pimp " Ville Syrjala
2025-02-06 21:03 ` ✓ CI.Patch_applied: success for drm/i915: intel_display conversions and some debug improvements (rev2) Patchwork
2025-02-06 21:04 ` ✗ CI.checkpatch: warning " Patchwork
2025-02-06 21:05 ` ✓ CI.KUnit: success " Patchwork
2025-02-06 21:21 ` ✓ CI.Build: " Patchwork
2025-02-06 21:23 ` ✗ CI.Hooks: failure " Patchwork
2025-02-06 21:25 ` ✗ CI.checksparse: warning " Patchwork
2025-02-06 21:44 ` ✓ Xe.CI.BAT: success " Patchwork
2025-02-07 3:39 ` ✗ Xe.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=87r04a3tcl.fsf@intel.com \
--to=jani.nikula@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