<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<div dir="auto">Hi Ville</div>
<div dir="auto"><br>
</div>
<div dir="auto">The fix is in the next patch.</div>
<div dir="auto"><br>
</div>
<div dir="auto">This pach changes the 4096 to page size macro as the BUG on is based on that macro explicitly.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Br</div>
<div dir="auto">Vinod</div>
<div id="mail-editor-reference-message-container" dir="auto"><br>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" style="font-size: 11pt;"><strong>From:</strong> Ville Syrjälä <ville.syrjala@linux.intel.com><br>
<strong>Sent:</strong> Thursday, January 11, 2024 3:44:22 pm<br>
<strong>To:</strong> Govindapillai, Vinod <vinod.govindapillai@intel.com><br>
<strong>Cc:</strong> intel-gfx@lists.freedesktop.org <intel-gfx@lists.freedesktop.org>; Syrjala, Ville <ville.syrjala@intel.com><br>
<strong>Subject:</strong> Re: [PATCH v1 1/2] drm/i915/display: use PAGE_SIZE macro for FBC cfb alloc<br>
</div>
<br>
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On Wed, Jan 10, 2024 at 01:00:08PM +0200, Vinod Govindapillai wrote:<br>
> FBC compressed frame buffer size need to be PAGE_SIZE aligned<br>
> and the corresponding the drm_gem functions check the object<br>
> size alignment using PAGE_SIZE macro. Use the PAGE_SIZE macro<br>
> in the cfb alloc as well instead of the magic number.<br>
> <br>
> Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com><br>
> ---<br>
> drivers/gpu/drm/i915/display/intel_fbc.c | 6 ++++--<br>
> 1 file changed, 4 insertions(+), 2 deletions(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c<br>
> index f17a1afb4929..9b9c8715d664 100644<br>
> --- a/drivers/gpu/drm/i915/display/intel_fbc.c<br>
> +++ b/drivers/gpu/drm/i915/display/intel_fbc.c<br>
> @@ -764,13 +764,15 @@ static int find_compression_limit(struct intel_fbc *fbc,<br>
> <br>
> /* Try to over-allocate to reduce reallocations and fragmentation. */<br>
> ret = i915_gem_stolen_insert_node_in_range(i915, &fbc->compressed_fb,<br>
> - size <<= 1, 4096, 0, end);<br>
> + size <<= 1, PAGE_SIZE, 0,<br>
> + end);<br>
> if (ret == 0)<br>
> return limit;<br>
> <br>
> for (; limit <= intel_fbc_max_limit(i915); limit <<= 1) {<br>
> ret = i915_gem_stolen_insert_node_in_range(i915, &fbc->compressed_fb,<br>
> - size >>= 1, 4096, 0, end);<br>
> + size >>= 1, PAGE_SIZE, 0,<br>
> + end);<br>
<br>
PAGE_SIZE is 4k so I can't see this doing anything at all.<br>
<br>
The correct fix is probably either:<br>
- fix the xe gem code to always page align the size<br>
- page align it in xe's i915_gem_stolen_insert_node_in_range()<br>
<br>
> if (ret == 0)<br>
> return limit;<br>
> }<br>
> -- <br>
> 2.34.1<br>
<br>
-- <br>
Ville Syrjälä<br>
Intel<br>
</div>
</span></font><br>
</div>
</body>
</html>