Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
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
Subject: Re: [PATCH 1/3] drm/i915: include gen 2 in HAS_128_BYTE_Y_TILING()
Date: Fri, 10 Oct 2025 16:57:05 +0300	[thread overview]
Message-ID: <aOkQsaOGg9wiILT-@intel.com> (raw)
In-Reply-To: <41bf9d67a11f38f4ab0f82740f38d5c8fe0bb58b.1760094361.git.jani.nikula@intel.com>

On Fri, Oct 10, 2025 at 02:07:51PM +0300, Jani Nikula wrote:
> Gen 2 platforms actually have 128-byte Y-tile, it's just different from
> the 128-byte Y-tile on i945+. Make the HAS_128_BYTE_Y_TILING() feature
> check macro and its usage slightly less convoluted by including gen 2 in
> it.
> 
> i915_tiling_ok() would strictly not need changing, but separate the if
> clauses to emphasize gen 2 X-tile also being 128 bytes.
> 
> Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

I think I want to redo the gem side tile size stuff with a
bigger hammer a bit at some point, but this seems fine 
for now.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_fb.c    | 2 +-
>  drivers/gpu/drm/i915/gem/i915_gem_tiling.c | 5 +++--
>  drivers/gpu/drm/i915/i915_drv.h            | 3 +--
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
> index 99823ef42ef1..3bfd211d64ba 100644
> --- a/drivers/gpu/drm/i915/display/intel_fb.c
> +++ b/drivers/gpu/drm/i915/display/intel_fb.c
> @@ -814,7 +814,7 @@ intel_tile_width_bytes(const struct drm_framebuffer *fb, int color_plane)
>  			return 64;
>  		fallthrough;
>  	case I915_FORMAT_MOD_Y_TILED:
> -		if (DISPLAY_VER(display) == 2 || HAS_128_BYTE_Y_TILING(i915))
> +		if (HAS_128_BYTE_Y_TILING(i915))
>  			return 128;
>  		else
>  			return 512;
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_tiling.c b/drivers/gpu/drm/i915/gem/i915_gem_tiling.c
> index 5a296ba3758a..567b97d28d30 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_tiling.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_tiling.c
> @@ -145,8 +145,9 @@ i915_tiling_ok(struct drm_i915_gem_object *obj,
>  			return false;
>  	}
>  
> -	if (GRAPHICS_VER(i915) == 2 ||
> -	    (tiling == I915_TILING_Y && HAS_128_BYTE_Y_TILING(i915)))
> +	if (tiling == I915_TILING_Y && HAS_128_BYTE_Y_TILING(i915))
> +		tile_width = 128;
> +	else if (GRAPHICS_VER(i915) == 2)
>  		tile_width = 128;
>  	else
>  		tile_width = 512;
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 6e159bb8ad2f..4b66e5d017d9 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -602,8 +602,7 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
>  /* With the 945 and later, Y tiling got adjusted so that it was 32 128-byte
>   * rows, which changed the alignment requirements and fence programming.
>   */
> -#define HAS_128_BYTE_Y_TILING(i915) (GRAPHICS_VER(i915) != 2 && \
> -					 !(IS_I915G(i915) || IS_I915GM(i915)))
> +#define HAS_128_BYTE_Y_TILING(i915) (!IS_I915G(i915) && !IS_I915GM(i915))
>  
>  #define HAS_RC6(i915)		 (INTEL_INFO(i915)->has_rc6)
>  #define HAS_RC6p(i915)		 (INTEL_INFO(i915)->has_rc6p)
> -- 
> 2.47.3

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2025-10-10 13:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-10 11:07 [PATCH 0/3] drm/i915/display: 128-byte Y-tiling and flat CCS feature checks Jani Nikula
2025-10-10 11:07 ` [PATCH 1/3] drm/i915: include gen 2 in HAS_128_BYTE_Y_TILING() Jani Nikula
2025-10-10 13:57   ` Ville Syrjälä [this message]
2025-10-10 11:07 ` [PATCH 2/3] drm/i915/display: duplicate 128-byte Y-tiling feature check Jani Nikula
2025-10-10 14:01   ` Ville Syrjälä
2025-10-10 11:07 ` [PATCH 3/3] drm/i915/display: add HAS_AUX_CCS() " Jani Nikula
2025-10-10 13:53   ` Ville Syrjälä
2025-10-13 14:47     ` Jani Nikula
2025-10-13 14:45   ` [PATCH v2] " Jani Nikula
2025-10-13 17:21     ` Ville Syrjälä
2025-10-14  9:50       ` Jani Nikula
2025-10-10 13:45 ` ✓ i915.CI.BAT: success for drm/i915/display: 128-byte Y-tiling and flat CCS feature checks Patchwork
2025-10-10 15:29 ` ✓ i915.CI.Full: " Patchwork
2025-10-13 16:27 ` ✓ i915.CI.BAT: success for drm/i915/display: 128-byte Y-tiling and flat CCS feature checks (rev2) Patchwork
2025-10-13 19:22 ` ✗ i915.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=aOkQsaOGg9wiILT-@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 \
    /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