From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
"Jouni Högander" <jouni.hogander@intel.com>,
"Maarten Lankhorst" <maarten@lankhorst.se>
Subject: Re: [PATCH v2] drm/{i915,xe}/fbdev: add intel_fbdev_fb_pitch_align()
Date: Wed, 22 Oct 2025 19:19:42 +0300 [thread overview]
Message-ID: <aPkEHv4iCGjYi2AC@intel.com> (raw)
In-Reply-To: <20251022161054.708388-1-jani.nikula@intel.com>
On Wed, Oct 22, 2025 at 07:10:54PM +0300, Jani Nikula wrote:
> For reasons still unknown, xe appears to require a stride alignment of
> XE_PAGE_SIZE, and using 64 leads to sporadic failures. Go back to having
> separate stride alignment for i915 and xe, until the issue is root
> caused.
>
> v2: Add FIXME comment, reference issue with Link (Ville)
>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Jouni Högander <jouni.hogander@intel.com>
> Cc: Maarten Lankhorst <maarten@lankhorst.se>
> Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/6220
> Fixes: 4a36b339a14a ("drm/xe/fbdev: use the same 64-byte stride alignment as i915")
> Link: https://lore.kernel.org/r/ae51d1e224048bdc87bf7a56d8f5ebd0fbb6a383.1756931441.git.jani.nikula@intel.com
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_fbdev.c | 2 +-
> drivers/gpu/drm/i915/display/intel_fbdev_fb.c | 5 +++++
> drivers/gpu/drm/i915/display/intel_fbdev_fb.h | 3 +++
> drivers/gpu/drm/xe/display/intel_fbdev_fb.c | 11 +++++++++++
> 4 files changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index 51d3d87caf43..d5c001761aa0 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -218,7 +218,7 @@ static void intel_fbdev_fill_mode_cmd(struct drm_fb_helper_surface_size *sizes,
> mode_cmd->width = sizes->surface_width;
> mode_cmd->height = sizes->surface_height;
>
> - mode_cmd->pitches[0] = ALIGN(mode_cmd->width * DIV_ROUND_UP(sizes->surface_bpp, 8), 64);
> + mode_cmd->pitches[0] = intel_fbdev_fb_pitch_align(mode_cmd->width * DIV_ROUND_UP(sizes->surface_bpp, 8));
> mode_cmd->pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
> sizes->surface_depth);
> mode_cmd->modifier[0] = DRM_FORMAT_MOD_LINEAR;
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev_fb.c b/drivers/gpu/drm/i915/display/intel_fbdev_fb.c
> index 56b145841473..0838fdd37254 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev_fb.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev_fb.c
> @@ -10,6 +10,11 @@
> #include "i915_drv.h"
> #include "intel_fbdev_fb.h"
>
> +u32 intel_fbdev_fb_pitch_align(u32 stride)
> +{
> + return ALIGN(stride, 64);
> +}
> +
> struct drm_gem_object *intel_fbdev_fb_bo_create(struct drm_device *drm, int size)
> {
> struct drm_i915_private *dev_priv = to_i915(drm);
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev_fb.h b/drivers/gpu/drm/i915/display/intel_fbdev_fb.h
> index 1fa44ed28543..fd0b3775dc1f 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev_fb.h
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev_fb.h
> @@ -6,12 +6,15 @@
> #ifndef __INTEL_FBDEV_FB_H__
> #define __INTEL_FBDEV_FB_H__
>
> +#include <linux/types.h>
> +
> struct drm_device;
> struct drm_gem_object;
> struct drm_mode_fb_cmd2;
> struct fb_info;
> struct i915_vma;
>
> +u32 intel_fbdev_fb_pitch_align(u32 stride);
> struct drm_gem_object *intel_fbdev_fb_bo_create(struct drm_device *drm, int size);
> void intel_fbdev_fb_bo_destroy(struct drm_gem_object *obj);
> int intel_fbdev_fb_fill_info(struct drm_device *drm, struct fb_info *info,
> diff --git a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
> index af72f7305e5a..7ad76022cb14 100644
> --- a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
> +++ b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c
> @@ -12,6 +12,17 @@
>
> #include <generated/xe_device_wa_oob.h>
>
> +/*
> + * FIXME: There shouldn't be any reason to have XE_PAGE_SIZE stride
> + * alignment. The same 64 as i915 uses should be fine, and we shouldn't need to
> + * have driver specific values. However, dropping the stride alignment to 64
> + * leads to underflowing the bo pin count in the atomic cleanup work.
> + */
> +u32 intel_fbdev_fb_pitch_align(u32 stride)
> +{
> + return ALIGN(stride, XE_PAGE_SIZE);
> +}
> +
> struct drm_gem_object *intel_fbdev_fb_bo_create(struct drm_device *drm, int size)
> {
> struct xe_device *xe = to_xe_device(drm);
> --
> 2.47.3
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2025-10-22 16:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-22 16:10 [PATCH v2] drm/{i915,xe}/fbdev: add intel_fbdev_fb_pitch_align() Jani Nikula
2025-10-22 16:19 ` Ville Syrjälä [this message]
2025-10-24 8:42 ` Jani Nikula
2025-10-22 23:27 ` ✗ CI.checkpatch: warning for drm/{i915,xe}/fbdev: add intel_fbdev_fb_pitch_align() (rev2) Patchwork
2025-10-22 23:28 ` ✓ CI.KUnit: success " Patchwork
2025-10-23 0:09 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-23 6:50 ` ✗ 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=aPkEHv4iCGjYi2AC@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=jouni.hogander@intel.com \
--cc=maarten@lankhorst.se \
/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;
as well as URLs for NNTP newsgroup(s).