Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Vinod Govindapillai <vinod.govindapillai@intel.com>
Cc: intel-gfx@lists.freedesktop.org, ville.syrjala@intel.com
Subject: Re: [PATCH v1 1/2] drm/i915/display: use PAGE_SIZE macro for FBC cfb alloc
Date: Thu, 11 Jan 2024 15:44:10 +0200	[thread overview]
Message-ID: <ZZ_wqnWx5I5h7hKZ@intel.com> (raw)
In-Reply-To: <20240110110009.28799-2-vinod.govindapillai@intel.com>

On Wed, Jan 10, 2024 at 01:00:08PM +0200, Vinod Govindapillai wrote:
> FBC compressed frame buffer size need to be PAGE_SIZE aligned
> and the corresponding the drm_gem functions check the object
> size alignment using PAGE_SIZE macro. Use the PAGE_SIZE macro
> in the cfb alloc as well instead of the magic number.
> 
> Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_fbc.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
> index f17a1afb4929..9b9c8715d664 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbc.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbc.c
> @@ -764,13 +764,15 @@ static int find_compression_limit(struct intel_fbc *fbc,
>  
>  	/* Try to over-allocate to reduce reallocations and fragmentation. */
>  	ret = i915_gem_stolen_insert_node_in_range(i915, &fbc->compressed_fb,
> -						   size <<= 1, 4096, 0, end);
> +						   size <<= 1, PAGE_SIZE, 0,
> +						   end);
>  	if (ret == 0)
>  		return limit;
>  
>  	for (; limit <= intel_fbc_max_limit(i915); limit <<= 1) {
>  		ret = i915_gem_stolen_insert_node_in_range(i915, &fbc->compressed_fb,
> -							   size >>= 1, 4096, 0, end);
> +							   size >>= 1, PAGE_SIZE, 0,
> +							   end);

PAGE_SIZE is 4k so I can't see this doing anything at all.

The correct fix is probably either:
- fix the xe gem code to always page align the size
- page align it in xe's i915_gem_stolen_insert_node_in_range()

>  		if (ret == 0)
>  			return limit;
>  	}
> -- 
> 2.34.1

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2024-01-11 13:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-10 11:00 [PATCH v1 0/2] drm/xe: ensure fbc cfb size to be page size aligned Vinod Govindapillai
2024-01-10 11:00 ` [PATCH v1 1/2] drm/i915/display: use PAGE_SIZE macro for FBC cfb alloc Vinod Govindapillai
2024-01-11 13:44   ` Ville Syrjälä [this message]
2024-01-11 13:47     ` Govindapillai, Vinod
2024-01-11 13:59       ` Ville Syrjälä
2024-01-11 14:37         ` Govindapillai, Vinod
2024-01-10 11:00 ` [PATCH v1 2/2] drm/xe: Modify the cfb size to be page size aligned for FBC Vinod Govindapillai
2024-01-12  8:56   ` Jani Nikula
2024-01-12  8:58     ` Jani Nikula
2024-01-10 15:11 ` ✗ Fi.CI.SPARSE: warning for drm/xe: ensure fbc cfb size to be page size aligned Patchwork
2024-01-10 15:23 ` ✓ Fi.CI.BAT: success " Patchwork
2024-01-10 17:53 ` ✗ Fi.CI.IGT: 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=ZZ_wqnWx5I5h7hKZ@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@intel.com \
    --cc=vinod.govindapillai@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