Re: [PATCH v1 1/2] drm/i915/display: use PAGE_SIZE macro for FBC cfb alloc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ville

The fix is in the next patch.

This pach changes the 4096 to page size macro as the BUG on is based on that macro explicitly.

Br
Vinod


From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
Sent: Thursday, January 11, 2024 3:44:22 pm
To: Govindapillai, Vinod <vinod.govindapillai@xxxxxxxxx>
Cc: intel-gfx@xxxxxxxxxxxxxxxxxxxxx <intel-gfx@xxxxxxxxxxxxxxxxxxxxx>; Syrjala, Ville <ville.syrjala@xxxxxxxxx>
Subject: Re: [PATCH v1 1/2] drm/i915/display: use PAGE_SIZE macro for FBC cfb alloc

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@xxxxxxxxx>
> ---
>  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


[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux