Re: [PATCH v2] drm/xe/tests: Fix the shrinker test compiler warnings.

2024-10-04 Thread Matthew Auld
://lore.kernel.org/20240913195649.GA61514@thelio-3990X/ Fixes: 5a90b60db5e6 ("drm/xe: Add a xe_bo subtest for shrinking / swapping") Cc: dri-devel@lists.freedesktop.org Cc: Matthew Auld Reviewed-by: Matthew Auld #v1 Signed-off-by: Thomas Hellström Could probably use div_u64(). Anyway, Reviewed-b

Re: [PATCH v2 2/2] drm/xe: Invalidate media_gt TLBs in PT code

2024-08-30 Thread Matthew Auld
e dma-fence-array Fixes: 3330361543fc ("drm/xe/lnl: Add LNL platform definition") Signed-off-by: Matthew Brost Reviewed-by: Matthew Auld

Re: [PATCH v6 2/2] drm/xe/lnl: Offload system clear page activity to GPU

2024-08-19 Thread Matthew Auld
cause previous test was done on IFWI which had low mem BW from CPU. Cc: Himal Prasad Ghimiray Cc: Matthew Auld Cc: Matthew Brost Cc: "Thomas Hellström" Signed-off-by: Nirmoy Das Reviewed-by: Matthew Auld

Re: [PATCH] drm/buddy: fix issue that force_merge cannot free all roots

2024-08-14 Thread Matthew Auld
On 13/08/2024 10:44, Lin.Cao wrote: If buddy manager have more than one roots and each root have sub-block need to be free. When drm_buddy_fini called, the first loop of force_merge will merge and free all of the sub block of first root, which offset is 0x0 and size is biggest(more than have of t

Re: [PATCH v6 11/12] drm/ttm, drm/xe: Add a shrinker for xe bos

2024-08-09 Thread Matthew Auld
Hi, On 03/07/2024 16:38, Thomas Hellström wrote: Rather than relying on the TTM watermark accounting add a shrinker for xe_bos in TT or system memory. Leverage the newly added TTM per-page shrinking and shmem backup support. Although xe doesn't fully support WONTNEED (purgeable) bos yet, intro

Re: [PATCH v6 2/3] drm/xe/migrate: Parameterize ccs and bo data clear in xe_migrate_clear()

2024-08-09 Thread Matthew Auld
/CLEAR_BO_DATA_FLAG_*/XE_MIGRATE_CLEAR_FLAG_* and move to xe_migrate.h. other nits(Matt B) Cc: Himal Prasad Ghimiray Cc: Matthew Auld Cc: Matthew Brost Cc: "Thomas Hellström" Signed-off-by: Nirmoy Das Signed-off-by: Akshata Jahagirdar Seems reasonable to me, Reviewed-by: Matthew Auld

Re: [PATCH] drm/buddy: fix issue that force_merge cannot free all roots

2024-08-09 Thread Matthew Auld
Hi, On 08/08/2024 07:38, Lin.Cao wrote: If buddy manager have more than one roots and each root have sub-block need to be free. When drm_buddy_fini called, the first loop of force_merge will merge and free all of the sub block of first root, which offset is 0x0 and size is biggest(more than have

Re: [PATCH v7 1/2] drm/buddy: Add start address support to trim function

2024-07-24 Thread Matthew Auld
), Reviewed-by: Matthew Auld --- drivers/gpu/drm/drm_buddy.c | 25 +++-- drivers/gpu/drm/xe/xe_ttm_vram_mgr.c | 2 +- include/drm/drm_buddy.h | 2 ++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu

Re: [PATCH v7 1/2] drm/buddy: Add start address support to trim function

2024-07-24 Thread Matthew Auld
Ah, so we need a non power-of-two alignment. That makes sense, thanks. Marek On Tue, Jul 23, 2024, 11:04 Matthew Auld <mailto:matthew.a...@intel.com>> wrote: On 23/07/2024 14:43, Paneer Selvam, Arunpravin wrote: > Hi Matthew, > > Can we push this versio

Re: [PATCH v7 1/2] drm/buddy: Add start address support to trim function

2024-07-23 Thread Matthew Auld
On 23/07/2024 14:43, Paneer Selvam, Arunpravin wrote: Hi Matthew, Can we push this version for now as we need to mainline the DCC changes ASAP, while we continue our discussion and proceed to implement the permanent solution for address alignment? Yeah, we can always merge now and circle ba

Re: [PATCH] drm/buddy: Add start address support to trim function

2024-07-23 Thread Matthew Auld
Hi, On 22/07/2024 12:41, Paneer Selvam, Arunpravin wrote: Hi Matthew, On 7/19/2024 4:01 PM, Matthew Auld wrote: On 17/07/2024 16:02, Paneer Selvam, Arunpravin wrote: On 7/16/2024 3:34 PM, Matthew Auld wrote: On 16/07/2024 10:50, Paneer Selvam, Arunpravin wrote: Hi Matthew, On 7/10/2024

Re: [PATCH] drm/buddy: Add start address support to trim function

2024-07-19 Thread Matthew Auld
On 17/07/2024 16:02, Paneer Selvam, Arunpravin wrote: On 7/16/2024 3:34 PM, Matthew Auld wrote: On 16/07/2024 10:50, Paneer Selvam, Arunpravin wrote: Hi Matthew, On 7/10/2024 6:20 PM, Matthew Auld wrote: On 10/07/2024 07:03, Paneer Selvam, Arunpravin wrote: Thanks Alex. Hi Matthew, Any

Re: [PATCH v5 3/4] drm/xe/migrate: Clear CCS when clearing bo on xe2

2024-07-18 Thread Matthew Auld
: Matthew Auld Cc: "Thomas Hellström" Signed-off-by: Nirmoy Das --- drivers/gpu/drm/xe/xe_migrate.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c index e0a3f6921572..cc8beed2bf8e 100644 ---

Re: [PATCH v5 4/4] drm/xe/lnl: Offload system clear page activity to GPU

2024-07-18 Thread Matthew Auld
d. v3: Fix Kunit test. v4: handle data leak on cpu mmap(Thomas) Cc: Himal Prasad Ghimiray Cc: Matthew Auld Cc: "Thomas Hellström" Signed-off-by: Nirmoy Das --- drivers/gpu/drm/xe/xe_bo.c | 25 - drivers/gpu/drm/xe/xe_device.c | 7 +++ dri

Re: [PATCH] drm/buddy: Add start address support to trim function

2024-07-16 Thread Matthew Auld
On 16/07/2024 10:50, Paneer Selvam, Arunpravin wrote: Hi Matthew, On 7/10/2024 6:20 PM, Matthew Auld wrote: On 10/07/2024 07:03, Paneer Selvam, Arunpravin wrote: Thanks Alex. Hi Matthew, Any comments? Do we not pass the required address alignment when allocating the pages in the first

Re: [PATCH] drm/buddy: Add start address support to trim function

2024-07-10 Thread Matthew Auld
On 10/07/2024 07:03, Paneer Selvam, Arunpravin wrote: Thanks Alex. Hi Matthew, Any comments? Do we not pass the required address alignment when allocating the pages in the first place? Thanks, Arun. On 7/9/2024 1:42 AM, Alex Deucher wrote: On Thu, Jul 4, 2024 at 4:40 AM Arunpravin Panee

Re: [PATCH] drm/buddy: Add start address support to trim function

2024-06-21 Thread Matthew Auld
Hi, On 21/06/2024 06:29, Arunpravin Paneer Selvam wrote: - Add a new start parameter in trim function to specify exact address from where to start the trimming. This would help us in situations like if drivers would like to do address alignment for specific requirements. - Add a new fl

Re: [PATCH v1 1/1] drm/xe/bo: Fix fixed placement ggtt pinning code

2024-06-21 Thread Matthew Auld
On 21/06/2024 08:15, Alan Previn wrote: When calling xe_bo_create_pin_map_at, use the correct starting offset provided by caller at xe_ggtt_insert_bo_at. Fixes: 44e694958b95 ("drm/xe/display: Implement display support") Signed-off-by: Alan Previn --- drivers/gpu/drm/xe/xe_bo.c | 2 +- 1 file

Re: [PATCH] drm/xe: Use write-back caching mode for system memory on DGFX

2024-06-20 Thread Matthew Auld
DGFX. Coherency is maintained, but user-space clients may perceive a difference in cpu access speeds. Signed-off-by: Thomas Hellström Fixes: 622f709ca629 ("drm/xe/uapi: Add support for CPU caching mode") Cc: Pallavi Mishra Cc: Matthew Auld Cc: dri-devel@lists.freedesktop.org Cc: Joonas Lahtine

Re: [PATCH] dma-buf: add a warning when drv try to reserve 0 fence slots

2024-05-29 Thread Matthew Auld
n the first place. Signed-off-by: Christian König Reviewed-by: Matthew Auld

Re: [PATCH v2] drm/buddy: Fix the warn on's during force merge

2024-05-17 Thread Matthew Auld
k and block incompatible checks above the contains check. Signed-off-by: Arunpravin Paneer Selvam Fixes: 96950929eb23 ("drm/buddy: Implement tracking clear page feature") Reviewed-by: Matthew Auld A follow up unit test to catch this edge case would be lovely. --- drivers/gpu/

Re: [PATCH] drm/buddy: Merge back blocks in bias range function

2024-05-17 Thread Matthew Auld
On 17/05/2024 13:38, Arunpravin Paneer Selvam wrote: In bias range allocation, when we don't find the required blocks (i.e) on returning the -ENOSPC, we should merge back the split blocks. Otherwise, during force_merge we are flooded with warn on's due to block and its buddy are in same clear sta

Re: [PATCH 1/2] drm/buddy: stop using PAGE_SIZE

2024-05-17 Thread Matthew Auld
On 17/05/2024 12:00, Christian König wrote: Am 17.05.24 um 10:53 schrieb Matthew Auld: On 17/05/2024 02:11, Dave Airlie wrote: On Thu, 29 Feb 2024 at 23:48, Arnd Bergmann wrote: On Thu, Feb 29, 2024, at 11:51, Matthew Auld wrote: The drm_buddy minimum page-size requirements should be

Re: [PATCH 1/2] drm/buddy: stop using PAGE_SIZE

2024-05-17 Thread Matthew Auld
On 17/05/2024 02:11, Dave Airlie wrote: On Thu, 29 Feb 2024 at 23:48, Arnd Bergmann wrote: On Thu, Feb 29, 2024, at 11:51, Matthew Auld wrote: The drm_buddy minimum page-size requirements should be distinct from the CPU PAGE_SIZE. Only restriction is that the minimum page-size is at least 4K

Re: [PATCH v2 2/2] drm/tests: Add a unit test for range bias allocation

2024-05-13 Thread Matthew Auld
On 13/05/2024 16:11, Paneer Selvam, Arunpravin wrote: Hi Matthew, On 5/13/2024 1:49 PM, Matthew Auld wrote: On 12/05/2024 08:59, Arunpravin Paneer Selvam wrote: Allocate cleared blocks in the bias range when the DRM buddy's clear avail is zero. This will validate the bias range allocati

Re: [PATCH v2 2/2] drm/tests: Add a unit test for range bias allocation

2024-05-13 Thread Matthew Auld
rem = bias_end - bias_start; + + flags = DRM_BUDDY_CLEAR_ALLOCATION | DRM_BUDDY_RANGE_ALLOCATION; + u32 size = max(round_up(prandom_u32_state(&prng) % bias_rem, ps), ps); u32 declaration should be moved to above? Otherwise, Reviewed-by: Matth

[PATCH 01/20] drm/drm_managed: try to improve the drmm DOC

2024-05-10 Thread Matthew Auld
Hopefully make it clearer when to use devm vs drmm. Signed-off-by: Matthew Auld Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/drm_managed.c | 42 +++ 1 file changed, 42 insertions(+) diff --git a/drivers/gpu/drm/drm_managed.c b

Re: [PATCH] drm/buddy: Fix the range bias clear memory allocation issue

2024-05-07 Thread Matthew Auld
clear page feature") Reviewed-by: Matthew Auld

Re: [PATCH v10 4/9] drm/ttm/tests: Add tests with mock resource managers

2024-04-10 Thread Matthew Auld
On 22/03/2024 14:29, Karolina Stolarek wrote: Add mock resource manager to test ttm_bo_validate() with non-system placements. Update KConfig entry to enable DRM Buddy allocator, used by the mock manager. Update move function to do more than just assign a resource. Signed-off-by: Karolina Stolare

Re: [PATCH v10 3/9] drm/ttm/tests: Test simple BO creation and validation

2024-04-10 Thread Matthew Auld
int err; + + place = ttm_place_kunit_init(test, mem_type, 0); + placement = ttm_placement_kunit_init(test, place, 1); + + bo = ttm_bo_kunit_init(test, test->priv, size); + bo->type = bo_type; + + ttm_bo_reserve(bo, false, false, NULL); + ttm_bo_pin(bo); + err = ttm_bo_validate(bo, placement, &ctx); + dma_resv_unlock(bo->base.resv); + + KUNIT_EXPECT_EQ(test, err, -EINVAL); ttm_bo_put(bo) ? Reviewed-by: Matthew Auld

Re: [PATCH v10 2/9] drm/ttm/tests: Use an init function from the helpers lib

2024-04-10 Thread Matthew Auld
On 22/03/2024 14:29, Karolina Stolarek wrote: Add a new helper function that also initializes the device. Use it in ttm_tt test suite and delete the local definition. Signed-off-by: Karolina Stolarek Reviewed-by: Matthew Auld

Re: [PATCH v10 1/3] drm/buddy: Implement tracking clear page feature

2024-04-10 Thread Matthew Auld
tthew) v5: - remove force merge support to actual range allocation and not to bail out when contains && split(Matthew) - add range support to force merge function. Signed-off-by: Arunpravin Paneer Selvam Signed-off-by: Matthew Auld Suggested-by: Christian König Suggested-by:

Re: [PATCH v10 3/3] drm/tests: Add a test case for drm buddy clear allocation

2024-04-08 Thread Matthew Auld
just increment and allocate the size. - create new mm with non power-of-two size to ensure the multi-root force_merge during fini. Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Matthew Auld --- drivers/gpu/drm/tests/drm_buddy_test.c | 141 + 1 file

Re: [PATCH v9 1/3] drm/buddy: Implement tracking clear page feature

2024-04-05 Thread Matthew Auld
On 01/04/2024 12:07, Paneer Selvam, Arunpravin wrote: Hi Matthew, On 3/28/2024 10:18 PM, Matthew Auld wrote: On 28/03/2024 16:07, Paneer Selvam, Arunpravin wrote: Hi Matthew, On 3/26/2024 11:39 PM, Matthew Auld wrote: On 18/03/2024 21:40, Arunpravin Paneer Selvam wrote: - Add tracking

Re: [PATCH v9 1/3] drm/buddy: Implement tracking clear page feature

2024-03-28 Thread Matthew Auld
On 28/03/2024 16:07, Paneer Selvam, Arunpravin wrote: Hi Matthew, On 3/26/2024 11:39 PM, Matthew Auld wrote: On 18/03/2024 21:40, Arunpravin Paneer Selvam wrote: - Add tracking clear page feature. - Driver should enable the DRM_BUDDY_CLEARED flag if it    successfully clears the blocks in

Re: [PATCH v9 1/3] drm/buddy: Implement tracking clear page feature

2024-03-26 Thread Matthew Auld
tthew) Signed-off-by: Arunpravin Paneer Selvam Signed-off-by: Matthew Auld Suggested-by: Christian König Suggested-by: Matthew Auld --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 6 +- drivers/gpu/drm/drm_buddy.c | 427 ++ drivers/gpu/drm

Re: [PATCH v9 3/3] drm/tests: Add a test case for drm buddy clear allocation

2024-03-26 Thread Matthew Auld
On 18/03/2024 21:40, Arunpravin Paneer Selvam wrote: Add a new test case for the drm buddy clear and dirty allocation. Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Matthew Auld --- drivers/gpu/drm/tests/drm_buddy_test.c | 127 + 1 file changed, 127

Re: [PATCH v8 1/3] drm/buddy: Implement tracking clear page feature

2024-03-07 Thread Matthew Auld
On 07/03/2024 12:25, Paneer Selvam, Arunpravin wrote: Hi Matthew, On 3/6/2024 11:19 PM, Matthew Auld wrote: On 04/03/2024 16:32, Arunpravin Paneer Selvam wrote: - Add tracking clear page feature. - Driver should enable the DRM_BUDDY_CLEARED flag if it    successfully clears the blocks in the

Re: [PATCH] drm/tests/buddy: fix print format

2024-03-07 Thread Matthew Auld
On 07/03/2024 08:30, Maxime Ripard wrote: On Thu, 29 Feb 2024 09:52:26 +, Matthew Auld wrote: This will report a build warning once we have: 806cb2270237 ("kunit: Annotate _MSG assertion variants with gnu printf specifiers"). Applied to drm/drm-misc (drm-misc-fixes). Thanks.

Re: [PATCH v8 1/3] drm/buddy: Implement tracking clear page feature

2024-03-06 Thread Matthew Auld
ff-by: Arunpravin Paneer Selvam Signed-off-by: Matthew Auld Suggested-by: Christian König Suggested-by: Matthew Auld Is there a unit test for this? What about maybe something roughly like: - Pick small random mm_size which is not always power-of-two. - Allocate and free some random portion of the ad

Re: [PATCH v7 3/3] drm/buddy: Add defragmentation support

2024-03-04 Thread Matthew Auld
On 04/03/2024 12:22, Paneer Selvam, Arunpravin wrote: Hi Matthew, On 2/22/2024 12:12 AM, Matthew Auld wrote: On 21/02/2024 12:18, Arunpravin Paneer Selvam wrote: Add a function to support defragmentation. v1:    - Defragment the memory beginning from min_order till the required memory

Re: [PULL] drm-misc-fixes

2024-02-29 Thread Matthew Auld
bridge: aux-hpd: separate allocation and registration soc: qcom: pmic_glink_altmode: fix drm bridge use-after-free Matthew Auld (3): drm/buddy: fix range bias drm/buddy: check range allocation matches alignment drm/tests/drm_buddy: add alloc_range_bias test Note that th

[PATCH 2/2] drm/tests/buddy: stop using PAGE_SIZE

2024-02-29 Thread Matthew Auld
Gives the wrong impression that min page-size has to be tied to the CPU PAGE_SIZE. Signed-off-by: Matthew Auld Cc: Arunpravin Paneer Selvam Cc: Christian König Cc: Arnd Bergmann --- drivers/gpu/drm/tests/drm_buddy_test.c | 42 +- 1 file changed, 21 insertions(+), 21

[PATCH 1/2] drm/buddy: stop using PAGE_SIZE

2024-02-29 Thread Matthew Auld
The drm_buddy minimum page-size requirements should be distinct from the CPU PAGE_SIZE. Only restriction is that the minimum page-size is at least 4K. Signed-off-by: Matthew Auld Cc: Arunpravin Paneer Selvam Cc: Christian König Cc: Arnd Bergmann --- drivers/gpu/drm/drm_buddy.c | 2

[PATCH] drm/tests/buddy: fix print format

2024-02-29 Thread Matthew Auld
This will report a build warning once we have: 806cb2270237 ("kunit: Annotate _MSG assertion variants with gnu printf specifiers"). Reported-by: Stephen Rothwell Fixes: c70703320e55 ("drm/tests/drm_buddy: add alloc_range_bias test") Signed-off-by: Matthew Auld Cc: Arunprav

Re: [PATCH 1/6] drm/tests/drm_buddy: fix 32b build

2024-02-28 Thread Matthew Auld
On 28/02/2024 07:20, Christian König wrote: Am 26.02.24 um 10:58 schrieb Matthew Auld: On 19/02/2024 12:24, Matthew Auld wrote: On 19/02/2024 10:48, Matthew Auld wrote: On 19/02/2024 10:30, Christian König wrote: Am 19.02.24 um 11:28 schrieb Matthew Auld: On 19/02/2024 09:53, Christian

Re: [PATCH 1/2] drm/ttm: improve idle/busy handling v4

2024-02-27 Thread Matthew Auld
On 26/02/2024 20:21, Thomas Hellström wrote: Hi, Christian On Fri, 2024-02-23 at 15:30 +0100, Christian König wrote: Am 06.02.24 um 13:56 schrieb Christian König: Am 06.02.24 um 13:53 schrieb Thomas Hellström: Hi, Christian, On Fri, 2024-01-26 at 15:09 +0100, Christian König wrote: Previous

Re: [PATCH 1/6] drm/tests/drm_buddy: fix 32b build

2024-02-26 Thread Matthew Auld
Hi, On 26/02/2024 10:38, Geert Uytterhoeven wrote: Hi Matthew, On Mon, Feb 26, 2024 at 10:58 AM Matthew Auld wrote: On 19/02/2024 12:24, Matthew Auld wrote: On 19/02/2024 10:48, Matthew Auld wrote: On 19/02/2024 10:30, Christian König wrote: Am 19.02.24 um 11:28 schrieb Matthew Auld: On

Re: [PATCH 1/6] drm/tests/drm_buddy: fix 32b build

2024-02-26 Thread Matthew Auld
On 19/02/2024 12:24, Matthew Auld wrote: On 19/02/2024 10:48, Matthew Auld wrote: On 19/02/2024 10:30, Christian König wrote: Am 19.02.24 um 11:28 schrieb Matthew Auld: On 19/02/2024 09:53, Christian König wrote: Am 19.02.24 um 10:42 schrieb Matthew Auld: On 15/02/2024 17:44, Matthew Auld

Re: [PATCH 1/2] devm-helpers: Add resource managed version of mutex init

2024-02-22 Thread Matthew Auld
On 22/02/2024 14:58, Marek Behún wrote: A few drivers are doing resource-managed mutex initialization by implementing ad-hoc one-liner mutex dropping functions and using them with devm_add_action_or_reset(). Help drivers avoid these repeated one-liners by adding managed version of mutex initializ

Re: [PATCH v7 3/3] drm/buddy: Add defragmentation support

2024-02-21 Thread Matthew Auld
Suggested-by: Matthew Auld --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 17 +++- drivers/gpu/drm/drm_buddy.c | 93 +--- include/drm/drm_buddy.h | 3 + 3 files changed, 97 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/amd

Re: [PATCH v6 1/3] drm/buddy: Implement tracking clear page feature

2024-02-21 Thread Matthew Auld
On 21/02/2024 12:40, Paneer Selvam, Arunpravin wrote: On 2/16/2024 5:33 PM, Matthew Auld wrote: On 08/02/2024 15:49, Arunpravin Paneer Selvam wrote: - Add tracking clear page feature. - Driver should enable the DRM_BUDDY_CLEARED flag if it    successfully clears the blocks in the free path

Re: [PATCH 7/9] drm: tests: Fix invalid printf format specifiers in KUnit tests

2024-02-21 Thread Matthew Auld
DRM_BUDDY_CONTIGUOUS_ALLOCATION), - "buddy_alloc hit an error size=%d\n", 3 * ps); + "buddy_alloc hit an error size=%lu\n", 3 * ps); There was also a fix for this in: 335126937753 ("drm/tests/d

Re: [PATCH] drm/ttm: Fix an invalid freeing on already freed page in error path

2024-02-21 Thread Matthew Auld
top.org Cc: # v6.4+ Reviewed-by: Matthew Auld

Re: [PATCH 1/6] drm/tests/drm_buddy: fix 32b build

2024-02-19 Thread Matthew Auld
On 19/02/2024 10:48, Matthew Auld wrote: On 19/02/2024 10:30, Christian König wrote: Am 19.02.24 um 11:28 schrieb Matthew Auld: On 19/02/2024 09:53, Christian König wrote: Am 19.02.24 um 10:42 schrieb Matthew Auld: On 15/02/2024 17:44, Matthew Auld wrote: Doesn't seem to compile o

[PATCH v2 3/3] drm/tests/drm_buddy: add alloc_range_bias test

2024-02-19 Thread Matthew Auld
Sanity check range bias with DRM_BUDDY_RANGE_ALLOCATION. v2: - Be consistent with u32 here. Signed-off-by: Matthew Auld Cc: Arunpravin Paneer Selvam Cc: Christian König Reviewed-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/tests/drm_buddy_test.c | 218 + 1 file

[PATCH v2 2/3] drm/buddy: check range allocation matches alignment

2024-02-19 Thread Matthew Auld
-off-by: Matthew Auld Cc: Arunpravin Paneer Selvam Cc: Christian König Reviewed-by: Arunpravin Paneer Selvam --- 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 f3a6ac908f81

[PATCH v2 1/3] drm/buddy: fix range bias

2024-02-19 Thread Matthew Auld
the split if the size/alignment will fit the requested size. Not doing so can result in leaving split blocks unmerged when it eventually fails. Fixes: afea229fe102 ("drm: improve drm_buddy_alloc function") Signed-off-by: Matthew Auld Cc: Arunpravin Paneer Selvam Cc: Christian König Cc

Re: [PATCH] drm/tests/drm_buddy: avoid 64-bit calculation

2024-02-19 Thread Matthew Auld
On 19/02/2024 11:41, Christian König wrote: Am 19.02.24 um 12:29 schrieb Arnd Bergmann: On Mon, Feb 19, 2024, at 12:22, Christian König wrote: Am 17.02.24 um 02:31 schrieb Randy Dunlap: On 2/16/24 12:24, Arnd Bergmann wrote: From: Arnd Bergmann The newly added drm_test_buddy_alloc_contiguou

Re: [PATCH 1/6] drm/tests/drm_buddy: fix 32b build

2024-02-19 Thread Matthew Auld
On 19/02/2024 10:30, Christian König wrote: Am 19.02.24 um 11:28 schrieb Matthew Auld: On 19/02/2024 09:53, Christian König wrote: Am 19.02.24 um 10:42 schrieb Matthew Auld: On 15/02/2024 17:44, Matthew Auld wrote: Doesn't seem to compile on 32b, presumably due to u64 mod/division. Sim

Re: [PATCH 1/6] drm/tests/drm_buddy: fix 32b build

2024-02-19 Thread Matthew Auld
On 19/02/2024 09:53, Christian König wrote: Am 19.02.24 um 10:42 schrieb Matthew Auld: On 15/02/2024 17:44, Matthew Auld wrote: Doesn't seem to compile on 32b, presumably due to u64 mod/division. Simplest is to just switch over to u32 here. Also make print modifiers consistent with

Re: [PATCH 1/6] drm/tests/drm_buddy: fix 32b build

2024-02-19 Thread Matthew Auld
On 15/02/2024 17:44, Matthew Auld wrote: Doesn't seem to compile on 32b, presumably due to u64 mod/division. Simplest is to just switch over to u32 here. Also make print modifiers consistent with that. Fixes: a64056bb5a32 ("drm/tests/drm_buddy: add alloc_contiguous test") Rep

Re: [PATCH v6 3/3] drm/buddy: Add defragmentation support

2024-02-16 Thread Matthew Auld
On 16/02/2024 14:02, Christian König wrote: Am 16.02.24 um 14:21 schrieb Matthew Auld: On 16/02/2024 12:33, Christian König wrote: Am 16.02.24 um 13:23 schrieb Matthew Auld: On 08/02/2024 15:50, Arunpravin Paneer Selvam wrote: Add a function to support defragmentation. v1: Defragment the

Re: [PATCH v6 3/3] drm/buddy: Add defragmentation support

2024-02-16 Thread Matthew Auld
On 16/02/2024 12:33, Christian König wrote: Am 16.02.24 um 13:23 schrieb Matthew Auld: On 08/02/2024 15:50, Arunpravin Paneer Selvam wrote: Add a function to support defragmentation. v1: Defragment the memory beginning from min_order till the required memory space is available. Signed

Re: [PATCH v6 3/3] drm/buddy: Add defragmentation support

2024-02-16 Thread Matthew Auld
On 08/02/2024 15:50, Arunpravin Paneer Selvam wrote: Add a function to support defragmentation. v1: Defragment the memory beginning from min_order till the required memory space is available. Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Matthew Auld --- drivers/gpu/drm

Re: [PATCH v6 1/3] drm/buddy: Implement tracking clear page feature

2024-02-16 Thread Matthew Auld
e the required blocks. - Update the xe driver for the drm_buddy_free_list change in arguments. Signed-off-by: Arunpravin Paneer Selvam Signed-off-by: Matthew Auld Suggested-by: Christian König Probably needs a new unit test. I think we are missing something to forcefully re-merge everythi

Re: [PATCH] drm/buddy: Modify duplicate list_splice_tail call

2024-02-16 Thread Matthew Auld
goto err_free; } + list_splice_tail(&allocated, blocks); Sigh. Can we extend the unit test(s) to catch this? Reviewed-by: Matthew Auld + return 0; err_undo: base-commit: a64056bb5a3215bd31c8ce17d609ba0f4d5c55ea

[PATCH 6/6] drm/xe/stolen: ignore first page for FBC

2024-02-15 Thread Matthew Auld
Seems like we can potentially hit underruns if the CFB offset is within the first page of stolen. Just like i915 skip the first page. BSpec: 50214 Reported-by: Matt Roper Signed-off-by: Matthew Auld --- drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h | 3 +++ 1 file changed, 3

[PATCH 4/6] drm/tests/drm_buddy: add alloc_range_bias test

2024-02-15 Thread Matthew Auld
Sanity check range bias with DRM_BUDDY_RANGE_ALLOCATION. Signed-off-by: Matthew Auld Cc: Arunpravin Paneer Selvam Cc: Christian König --- drivers/gpu/drm/tests/drm_buddy_test.c | 218 + 1 file changed, 218 insertions(+) diff --git a/drivers/gpu/drm/tests

[PATCH 5/6] drm/xe/stolen: lower the default alignment

2024-02-15 Thread Matthew Auld
ff-by: Matthew Auld Cc: Matt Roper --- drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c index 662f1e9bfc65..2e94f90e1018 100644 --- a/drivers/gpu/d

[PATCH 3/6] drm/buddy: check range allocation matches alignment

2024-02-15 Thread Matthew Auld
-off-by: Matthew Auld Cc: Arunpravin Paneer Selvam Cc: Christian König --- 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

[PATCH 1/6] drm/tests/drm_buddy: fix 32b build

2024-02-15 Thread Matthew Auld
Doesn't seem to compile on 32b, presumably due to u64 mod/division. Simplest is to just switch over to u32 here. Also make print modifiers consistent with that. Fixes: a64056bb5a32 ("drm/tests/drm_buddy: add alloc_contiguous test") Reported-by: Geert Uytterhoeven Signed-off-by: M

[PATCH 2/6] drm/buddy: fix range bias

2024-02-15 Thread Matthew Auld
the split if the size/alignment will fit the requested size. Not doing so can result in leaving split blocks unmerged when it eventually fails. Fixes: afea229fe102 ("drm: improve drm_buddy_alloc function") Signed-off-by: Matthew Auld Cc: Arunpravin Paneer Selvam Cc: Christian König Cc

Re: [PATCH 2/2] drm/tests/drm_buddy: add alloc_contiguous test

2024-02-13 Thread Matthew Auld
On 13/02/2024 13:52, Arunpravin Paneer Selvam wrote: Sanity check DRM_BUDDY_CONTIGUOUS_ALLOCATION. References: https://gitlab.freedesktop.org/drm/amd/-/issues/3097 Signed-off-by: Matthew Auld Reviewed-by: Arunpravin Paneer Selvam It looks like you changed the patch authorship here. Cc

Re: [PATCH] drm/tests/drm_buddy: add alloc_contiguous test

2024-02-12 Thread Matthew Auld
On 12/02/2024 08:23, Arunpravin Paneer Selvam wrote: Hi Matthew, Can I push this test case along with the bug fix patch. Sure. Please go ahead. Thanks, Arun. On 2/8/2024 8:06 PM, Matthew Auld wrote: Sanity check DRM_BUDDY_CONTIGUOUS_ALLOCATION. References: https://gitlab.freedesktop.org

Re: [PATCH] drm/buddy: Fix alloc_range() error handling code

2024-02-08 Thread Matthew Auld
On 08/02/2024 14:17, Matthew Auld wrote: On 08/02/2024 13:47, Arunpravin Paneer Selvam wrote: Hi Matthew, On 2/8/2024 7:00 PM, Matthew Auld wrote: On 07/02/2024 17:44, Arunpravin Paneer Selvam wrote: Few users have observed display corruption when they boot the machine to KDE Plasma or

[PATCH] drm/tests/drm_buddy: add alloc_contiguous test

2024-02-08 Thread Matthew Auld
Sanity check DRM_BUDDY_CONTIGUOUS_ALLOCATION. References: https://gitlab.freedesktop.org/drm/amd/-/issues/3097 Signed-off-by: Matthew Auld Cc: Arunpravin Paneer Selvam Cc: Limonciello Cc: Christian König --- drivers/gpu/drm/tests/drm_buddy_test.c | 89 ++ 1 file

Re: [PATCH] drm/buddy: Fix alloc_range() error handling code

2024-02-08 Thread Matthew Auld
On 08/02/2024 13:47, Arunpravin Paneer Selvam wrote: Hi Matthew, On 2/8/2024 7:00 PM, Matthew Auld wrote: On 07/02/2024 17:44, Arunpravin Paneer Selvam wrote: Few users have observed display corruption when they boot the machine to KDE Plasma or playing games. We have root caused the problem

Re: [PATCH] drm/buddy: Fix alloc_range() error handling code

2024-02-08 Thread Matthew Auld
On 07/02/2024 17:44, Arunpravin Paneer Selvam wrote: Few users have observed display corruption when they boot the machine to KDE Plasma or playing games. We have root caused the problem that whenever alloc_range() couldn't find the required memory blocks the function was returning SUCCESS in som

Re: [PATCH v3 1/2] drm/buddy: Implement tracking clear page feature

2024-01-31 Thread Matthew Auld
On 30/01/2024 20:30, Arunpravin Paneer Selvam wrote: Hi Matthew, On 12/21/2023 12:51 AM, Matthew Auld wrote: Hi, On 14/12/2023 13:42, Arunpravin Paneer Selvam wrote: - Add tracking clear page feature. - Driver should enable the DRM_BUDDY_CLEARED flag if it    successfully clears the blocks

Re: [PATCH v5 1/3] drm/buddy: Implement tracking clear page feature

2024-01-31 Thread Matthew Auld
On 30/01/2024 19:48, Arunpravin Paneer Selvam wrote: - Add tracking clear page feature. - Driver should enable the DRM_BUDDY_CLEARED flag if it successfully clears the blocks in the free path. On the otherhand, DRM buddy marks each block as cleared. - Track the available cleared pages siz

Re: [PATCH] drm/doc/rfc: Removing missing reference to xe.rst

2024-01-19 Thread Matthew Auld
build warning: Documentation/gpu/rfc/index.rst:35: WARNING: toctree contains reference to nonexisting document 'gpu/rfc/xe' Fixes: d11dc7aa98e5 ("drm/doc/rfc: Remove Xe's pre-merge plan") Cc: Lucas De Marchi Signed-off-by: Rodrigo Vivi Reviewed-by: Matthew Auld

Re: [PATCH v3 1/2] drm/buddy: Implement tracking clear page feature

2023-12-20 Thread Matthew Auld
Hi, On 14/12/2023 13:42, Arunpravin Paneer Selvam wrote: - Add tracking clear page feature. - Driver should enable the DRM_BUDDY_CLEARED flag if it successfully clears the blocks in the free path. On the otherhand, DRM buddy marks each block as cleared. - Track the available cleared page

Re: [PATCH v2 1/3] drm/buddy: Improve contiguous memory allocation

2023-09-11 Thread Matthew Auld
the trim to work on multiple nodes)? But I guess in practice should be pretty meh, given that the extra rhs is hopefully not too big in the corner case where the alignment doesn't fit the min_block_size? Anyway, for patches 1-3, Reviewed-by: Matthew Auld +

Re: [PATCH 1/3] drm/buddy: Fix contiguous memory allocation issues

2023-08-21 Thread Matthew Auld
Hi, On 21/08/2023 11:14, Arunpravin Paneer Selvam wrote: The way now contiguous requests are implemented such that the size rounded up to power of 2 and the corresponding order block picked from the freelist. In addition to the older method, the new method will rounddown the size to power of 2

Re: [PATCH v2] drm/ttm: fix one use-after-free

2023-07-05 Thread Matthew Auld
On Wed, 5 Jul 2023 at 11:08, Lang Yu wrote: > > bo->kref is increased once(kref_init()) in ttm_bo_release, > but decreased twice(ttm_bo_put()) respectively in > ttm_bo_delayed_delete and ttm_bo_cleanup_refs, > which is unbalanced. > > Just clean up bo resource in one place for a delayed deleted bo

Re: [PATCH v2] drm: fix drmm_mutex_init()

2023-05-22 Thread Matthew Auld
On 22/05/2023 10:43, Thomas Zimmermann wrote: Hi Am 19.05.23 um 11:07 schrieb Matthew Auld: In mutex_init() lockdep identifies a lock by defining a special static key for each lock class. However if we wrap the macro in a function, like in drmm_mutex_init(), we end up generating: int

[PATCH v2] drm: fix drmm_mutex_init()

2023-05-19 Thread Matthew Auld
e13f13e039dc ("drm: Add DRM-managed mutex_init()") Cc: Stanislaw Gruszka Cc: Boris Brezillon Cc: Thomas Zimmermann Cc: Jocelyn Falempe Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Signed-off-by: Matthew Auld --- drivers/gpu/drm/drm_managed.c | 22 ++---

Re: [PATCH] drm/managed: Define drmm_mutex_init() as a macro to fix lockdep

2023-05-19 Thread Matthew Auld
On Fri, 19 May 2023 at 09:55, Boris Brezillon wrote: > > drmm_mutex_init() needs to be defined as a macro if we want > lockdep to classify locks properly. If we don't do that, all locks > will be considered as belonging to the same lock class, leading to > false positive deadlock reports. > > Sign

Re: [PATCH v5 1/7] drm: fix drmm_mutex_init()

2023-05-17 Thread Matthew Auld
On 17/05/2023 17:21, Thomas Zimmermann wrote: Hi Am 17.05.23 um 17:22 schrieb Matthew Auld: In mutex_init() lockdep seems to identify a lock by defining a static key for each lock class. However if we wrap the whole thing in a function the static key will be the same for everything calling

Re: [PATCH v5 1/7] drm: fix drmm_mutex_init()

2023-05-17 Thread Matthew Auld
On 17/05/2023 17:05, Stanislaw Gruszka wrote: On Wed, May 17, 2023 at 04:22:38PM +0100, Matthew Auld wrote: In mutex_init() lockdep seems to identify a lock by defining a static key for each lock class. However if we wrap the whole thing in a function the static key will be the same for

[PATCH v5 1/7] drm: fix drmm_mutex_init()

2023-05-17 Thread Matthew Auld
op.org Signed-off-by: Matthew Auld --- drivers/gpu/drm/drm_managed.c | 26 -- include/drm/drm_managed.h | 23 ++- 2 files changed, 22 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/drm_managed.c b/drivers/gpu/drm/drm_managed.c index

Re: [PATCH 7/7] drm/i915: Allow user to set cache at BO creation

2023-04-06 Thread Matthew Auld
On Sat, 1 Apr 2023 at 07:37, wrote: > > From: Fei Yang > > To comply with the design that buffer objects shall have immutable > cache setting through out its life cycle, {set, get}_caching ioctl's > are no longer supported from MTL onward. With that change caching > policy can only be set at obje

Re: [PATCH] drm/i915: Fix context runtime accounting

2023-03-30 Thread Matthew Auld
e. Easiest use case to observe > this behaviour was with a full screen clients with close to 100% engine > load. > > Signed-off-by: Tvrtko Ursulin > Fixes: bb6287cb1886 ("drm/i915: Track context current active time") > Cc: # v5.19+ Seems reasonable to me, fwiw, Reviewed-by: Matthew Auld

Re: [PATCH] drm/ttm: drop extra ttm_bo_put in ttm_bo_cleanup_refs

2023-03-16 Thread Matthew Auld
On Thu, 16 Mar 2023 at 07:26, Christian König wrote: > > That was accidentially left over when we switched to the delayed delete > worker. > > Suggested-by: Matthew Auld > Signed-off-by: Christian König > Fixes: ("9bff18d13473") drm/ttm: use per BO cleanup worker

Re: [Intel-gfx] [BUG 6.3-rc1] Bad lock in ttm_bo_delayed_delete()

2023-03-15 Thread Matthew Auld
On Wed, 15 Mar 2023 at 18:41, Christian König wrote: > > Am 08.03.23 um 13:43 schrieb Steven Rostedt: > > On Wed, 8 Mar 2023 07:17:38 +0100 > > Christian König wrote: > > > >> What test case/environment do you run to trigger this? > > I'm running a 32bit x86 qemu instance. Attached is the config.

Re: [PATCH v4 5/5] drm/i915/gt: Make sure that errors are propagated through request chains

2023-03-10 Thread Matthew Auld
fences upon request completion to ensure that we have a reliable perpetuation of the operation outcome. Fixes: cf586021642d80 ("drm/i915/gt: Pipelined page migration") Reported-by: Matthew Auld Suggested-by: Chris Wilson Signed-off-by: Andi Shyti Cc: sta...@vger.kernel.org Reviewed-b

Re: [Intel-gfx] [PATCH 1/3] drm/i915: Set I915_BO_ALLOC_USER for framebuffer

2023-03-06 Thread Matthew Auld
On 06/03/2023 13:31, Das, Nirmoy wrote: Hi Matt, On 3/6/2023 1:25 PM, Matthew Auld wrote: On 06/03/2023 12:07, Nirmoy Das wrote: Framebuffer is exposed to userspace so set I915_BO_ALLOC_USER flag for it. This also make sure that ttm allocates offset for lmem objects. Signed-off-by: Nirmoy

Re: [PATCH 1/3] drm/i915: Set I915_BO_ALLOC_USER for framebuffer

2023-03-06 Thread Matthew Auld
On 06/03/2023 12:07, Nirmoy Das wrote: Framebuffer is exposed to userspace so set I915_BO_ALLOC_USER flag for it. This also make sure that ttm allocates offset for lmem objects. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/i915/display/intel_dpt.c | 4 +++- drivers/gpu/drm/i915/di

Re: [Intel-gfx] [PATCH] drm/i915/gt: Make sure that errors are propagated through request chains

2023-02-24 Thread Matthew Auld
s failed and > whether the memory is still invalid. > > On copy and clear migration signal fences upon completion. > > Fixes: cf586021642d80 ("drm/i915/gt: Pipelined page migration") > Reported-by: Matthew Auld > Suggested-by: Chris Wilson > Signed-off-by: Andi Shyti > Cc: sta...@vger.kernel.org Reviewed-by: Matthew Auld

  1   2   3   4   5   6   7   8   9   10   >