All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arunpravin Paneer Selvam <arunpravin.paneerselvam@amd.com>
To: Matthew Auld <matthew.auld@intel.com>, intel-xe@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org,
	"Christian König" <christian.koenig@amd.com>
Subject: Re: [PATCH 3/6] drm/buddy: check range allocation matches alignment
Date: Fri, 16 Feb 2024 16:55:32 +0530	[thread overview]
Message-ID: <2f43cb5d-492c-fd7c-4f55-e65cf50a7559@amd.com> (raw)
In-Reply-To: <20240215174431.285069-9-matthew.auld@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1327 bytes --]

Its good to check the alignment

Reviewed-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>



On 2/15/2024 11:14 PM, Matthew Auld wrote:
> Likely not a big deal for real users, but for consistency we should
> respect the min_page_size here. Main issue is that bias allocations
> turns into normal range allocation if the range and size matches
> exactly, and in the next patch we want to add some unit tests for this
> part of the api.
>
> Signed-off-by: Matthew Auld<matthew.auld@intel.com>
> Cc: Arunpravin Paneer Selvam<Arunpravin.PaneerSelvam@amd.com>
> Cc: Christian König<christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/drm_buddy.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
> index d09540d4065b..ee9913016626 100644
> --- a/drivers/gpu/drm/drm_buddy.c
> +++ b/drivers/gpu/drm/drm_buddy.c
> @@ -771,8 +771,12 @@ int drm_buddy_alloc_blocks(struct drm_buddy *mm,
>   		return -EINVAL;
>   
>   	/* Actual range allocation */
> -	if (start + size == end)
> +	if (start + size == end) {
> +		if (!IS_ALIGNED(start | end, min_block_size))
> +			return -EINVAL;
> +
>   		return __drm_buddy_alloc_range(mm, start, size, NULL, blocks);
> +	}
>   
>   	original_size = size;
>   	original_min_size = min_block_size;

[-- Attachment #2: Type: text/html, Size: 2030 bytes --]

  reply	other threads:[~2024-02-16 11:25 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15 17:44 [PATCH 1/6] drm/tests/drm_buddy: fix 32b build Matthew Auld
2024-02-15 17:44 ` [PATCH 2/6] drm/buddy: fix range bias Matthew Auld
2024-02-16 11:40   ` Arunpravin Paneer Selvam
2024-02-15 17:44 ` [PATCH 3/6] drm/buddy: check range allocation matches alignment Matthew Auld
2024-02-16 11:25   ` Arunpravin Paneer Selvam [this message]
2024-02-15 17:44 ` [PATCH 4/6] drm/tests/drm_buddy: add alloc_range_bias test Matthew Auld
2024-02-16 11:26   ` Arunpravin Paneer Selvam
2024-02-15 17:44 ` [PATCH 5/6] drm/xe/stolen: lower the default alignment Matthew Auld
2024-02-15 17:44 ` [PATCH 6/6] drm/xe/stolen: ignore first page for FBC Matthew Auld
2024-02-16 13:59   ` Maarten Lankhorst
2024-02-15 17:54 ` ✓ CI.Patch_applied: success for series starting with [1/6] drm/tests/drm_buddy: fix 32b build Patchwork
2024-02-15 17:55 ` ✗ CI.checkpatch: warning " Patchwork
2024-02-15 17:56 ` ✓ CI.KUnit: success " Patchwork
2024-02-15 18:07 ` ✓ CI.Build: " Patchwork
2024-02-15 18:08 ` ✓ CI.Hooks: " Patchwork
2024-02-15 18:09 ` ✗ CI.checksparse: warning " Patchwork
2024-02-15 18:31 ` ✓ CI.BAT: success " Patchwork
2024-02-16 11:23 ` [PATCH 1/6] " Arunpravin Paneer Selvam
2024-02-19  9:42 ` Matthew Auld
2024-02-19  9:53   ` Christian König
2024-02-19 10:28     ` Matthew Auld
2024-02-19 10:30       ` Christian König
2024-02-19 10:48         ` Matthew Auld
2024-02-19 12:24           ` Matthew Auld
2024-02-26  9:58             ` Matthew Auld
2024-02-26 10:38               ` Geert Uytterhoeven
2024-02-26 11:21                 ` Matthew Auld
2024-02-28  7:20               ` Christian König
2024-02-28  9:20                 ` Matthew Auld

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=2f43cb5d-492c-fd7c-4f55-e65cf50a7559@amd.com \
    --to=arunpravin.paneerselvam@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.auld@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.