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 01/11] drm/i915: Decouple i915_gem_dumb_create() from the display a bit
Date: Tue, 04 Feb 2025 13:15:30 +0200 [thread overview]
Message-ID: <87seou55bh.fsf@intel.com> (raw)
In-Reply-To: <20250124163040.8886-2-ville.syrjala@linux.intel.com>
On Fri, 24 Jan 2025, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Pass the device argument as drm_device to intel_plane_fb_max_stride()
> to decouple i915_gem_dumb_create() vs. the display code a bit.
>
> xe currently doesn't even call this, but it probably should...
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_display.c | 6 ++++--
> drivers/gpu/drm/i915/display/intel_display.h | 2 +-
> drivers/gpu/drm/i915/display/intel_fb.c | 4 ++--
> drivers/gpu/drm/i915/gem/i915_gem_create.c | 2 +-
> 4 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 7d68d652c1bc..157863428b52 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -713,13 +713,15 @@ void intel_add_fb_offsets(int *x, int *y,
> *y += state->view.color_plane[color_plane].y;
> }
>
> -u32 intel_plane_fb_max_stride(struct drm_i915_private *dev_priv,
> +u32 intel_plane_fb_max_stride(struct drm_device *dev,
Purely subjective, but I've mostly been using struct drm_device *drm
where that's still needed.
BR,
Jani.
> u32 pixel_format, u64 modifier)
> {
> + struct intel_display *display = to_intel_display(dev);
> + struct drm_i915_private *dev_priv = to_i915(dev);
> struct intel_crtc *crtc;
> struct intel_plane *plane;
>
> - if (!HAS_DISPLAY(dev_priv))
> + if (!HAS_DISPLAY(display))
> return 0;
>
> /*
> diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h
> index 49a246feb1ae..b9ed0deb3f69 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.h
> +++ b/drivers/gpu/drm/i915/display/intel_display.h
> @@ -421,7 +421,7 @@ void intel_link_compute_m_n(u16 bpp, int nlanes,
> int pixel_clock, int link_clock,
> int bw_overhead,
> struct intel_link_m_n *m_n);
> -u32 intel_plane_fb_max_stride(struct drm_i915_private *dev_priv,
> +u32 intel_plane_fb_max_stride(struct drm_device *dev,
> u32 pixel_format, u64 modifier);
> enum drm_mode_status
> intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv,
> diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
> index 9f7f1b9f3275..3121371635bb 100644
> --- a/drivers/gpu/drm/i915/display/intel_fb.c
> +++ b/drivers/gpu/drm/i915/display/intel_fb.c
> @@ -1847,7 +1847,7 @@ u32 intel_fb_max_stride(struct drm_i915_private *dev_priv,
> */
> if (DISPLAY_VER(dev_priv) < 4 || intel_fb_is_ccs_modifier(modifier) ||
> intel_fb_modifier_uses_dpt(dev_priv, modifier))
> - return intel_plane_fb_max_stride(dev_priv, pixel_format, modifier);
> + return intel_plane_fb_max_stride(&dev_priv->drm, pixel_format, modifier);
> else if (DISPLAY_VER(dev_priv) >= 7)
> return 256 * 1024;
> else
> @@ -1861,7 +1861,7 @@ intel_fb_stride_alignment(const struct drm_framebuffer *fb, int color_plane)
> unsigned int tile_width;
>
> if (is_surface_linear(fb, color_plane)) {
> - unsigned int max_stride = intel_plane_fb_max_stride(dev_priv,
> + unsigned int max_stride = intel_plane_fb_max_stride(&dev_priv->drm,
> fb->format->format,
> fb->modifier);
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_create.c b/drivers/gpu/drm/i915/gem/i915_gem_create.c
> index 19156ba4b9ef..c3e6a325872d 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_create.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_create.c
> @@ -193,7 +193,7 @@ i915_gem_dumb_create(struct drm_file *file,
> args->pitch = ALIGN(args->width * cpp, 64);
>
> /* align stride to page size so that we can remap */
> - if (args->pitch > intel_plane_fb_max_stride(to_i915(dev), format,
> + if (args->pitch > intel_plane_fb_max_stride(dev, format,
> DRM_FORMAT_MOD_LINEAR))
> args->pitch = ALIGN(args->pitch, 4096);
--
Jani Nikula, Intel
next prev parent reply other threads:[~2025-02-04 11:18 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-24 16:30 [PATCH 00/11] drm/i915: intel_display conversions and some debug improvements Ville Syrjala
2025-01-24 16:30 ` [PATCH 01/11] drm/i915: Decouple i915_gem_dumb_create() from the display a bit Ville Syrjala
2025-02-04 11:15 ` Jani Nikula [this message]
2025-01-24 16:30 ` [PATCH 02/11] drm/i915: Decouple intel_fb_bo.h interfaces from driver specific types Ville Syrjala
2025-01-24 16:30 ` [PATCH 03/11] drm/i915: Convert intel_crtc.c to struct intel_display Ville Syrjala
2025-01-24 16:30 ` [PATCH 04/11] drm/i915: Convert intel_fb.c " Ville Syrjala
2025-01-24 16:30 ` [PATCH 05/11] drm/i915: Convert intel_display_power_{get, put}*() to intel_display Ville Syrjala
2025-01-24 16:30 ` [PATCH 06/11] drm/i915: Convert i9xx_plane.c to struct intel_display Ville Syrjala
2025-01-24 16:30 ` [PATCH 07/11] drm/i915: Finish intel_sprite.c struct intel_display conversion Ville Syrjala
2025-01-24 16:30 ` [PATCH 08/11] drm/i915: Convert intel_cursor.c to struct intel_display Ville Syrjala
2025-01-24 16:30 ` [PATCH 09/11] drm/i915: Convert skl_univeral_plane.c " Ville Syrjala
2025-01-24 16:30 ` [PATCH 10/11] drm/i915: Use DRM_RECT_FMT & co. for plane debugs Ville Syrjala
2025-01-24 16:30 ` [PATCH 11/11] drm/i915: Pimp " Ville Syrjala
2025-01-28 7:04 ` Borah, Chaitanya Kumar
2025-01-24 16:39 ` ✓ CI.Patch_applied: success for drm/i915: intel_display conversions and some debug improvements Patchwork
2025-01-24 16:40 ` ✗ CI.checkpatch: warning " Patchwork
2025-01-24 16:41 ` ✓ CI.KUnit: success " Patchwork
2025-01-24 17:03 ` ✓ CI.Build: " Patchwork
2025-01-24 17:05 ` ✗ CI.Hooks: failure " Patchwork
2025-01-24 17:07 ` ✗ CI.checksparse: warning " Patchwork
2025-01-24 17:27 ` ✗ Fi.CI.CHECKPATCH: " Patchwork
2025-01-24 17:27 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-01-24 17:41 ` ✓ Xe.CI.BAT: success " Patchwork
2025-01-24 17:42 ` ✓ i915.CI.BAT: " Patchwork
2025-01-24 23:24 ` ✗ Xe.CI.Full: failure " Patchwork
2025-01-25 5:29 ` ✗ i915.CI.Full: " Patchwork
2025-02-04 11:14 ` [PATCH 00/11] " Jani Nikula
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=87seou55bh.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 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.