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

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

2024-04-10 Thread Matthew Auld
ace, 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, ); + 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
) 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: Matt

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

2024-04-08 Thread Matthew Auld
and 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

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

2024-03-26 Thread Matthew Auld
) 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/i915

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

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
-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 address

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
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 there is a build fix needed

[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:

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

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

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: 33512

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 on 32b

[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
with 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

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. Simplest

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

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") Reported

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

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
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 everything

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

2024-02-16 Thread Matthew Auld
t_splice_tail(, 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
-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/drm/xe

[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: Matthe

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

2024-02-15 Thread Matthew Auld
with 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

[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

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

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

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

2023-09-11 Thread Matthew Auld
n the corner case where the alignment doesn't fit the min_block_size? Anyway, for patches 1-3, Reviewed-by: Matthew Auld + } else if (err != -ENOSPC) { + drm_buddy_free_list(mm, blocks); + return err; + } +

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

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. > >

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

[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

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

2023-03-31 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

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 +++-

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

Re: [Intel-gfx] [PATCH 7/7] drm/ttm: cleanup ttm_range_mgr_node

2023-02-21 Thread Matthew Auld
On Fri, 17 Feb 2023 at 12:23, Christian König wrote: > > We don't need multiple drm_mm nodes any more. Clean that up and remove > the extra complexity. > > Signed-off-by: Christian König Reviewed-by: Matthew Auld

Re: [PATCH 5/7] drm/gem: Remove BUG_ON in drm_gem_private_object_init

2023-02-21 Thread Matthew Auld
On Fri, 17 Feb 2023 at 12:23, Christian König wrote: > > From: Somalapuram Amaranath > > ttm_resource can allocate size in bytes to support less than page size. > > Signed-off-by: Somalapuram Amaranath > Reviewed-by: Christian König > Signed-off-by: Christian König > Link: >

Re: [PATCH 1/4] drm/gem-vram: handle NULL bo->resource in move callback

2023-02-21 Thread Matthew Auld
On 21/02/2023 16:17, Christian König wrote: Am 21.02.23 um 17:13 schrieb Matthew Auld: On 10/02/2023 11:03, Christian König wrote: Am 08.02.23 um 15:53 schrieb Matthew Auld: The ttm BO now initially has NULL bo->resource, and leaves the driver the handle that. However it looks like we for

Re: [PATCH 1/4] drm/gem-vram: handle NULL bo->resource in move callback

2023-02-21 Thread Matthew Auld
On 10/02/2023 11:03, Christian König wrote: Am 08.02.23 um 15:53 schrieb Matthew Auld: The ttm BO now initially has NULL bo->resource, and leaves the driver the handle that. However it looks like we forgot to handle that for ttm_bo_move_memcpy() users, like with vram-gem, since it just silen

Re: [Intel-gfx] [PATCH 3/3] drm/ttm: Change the meaning of the fields in the drm_mm_nodes structure from pfn to bytes v2

2023-02-14 Thread Matthew Auld
On Tue, 14 Feb 2023 at 07:43, Christian König wrote: > > From: Somalapuram Amaranath > > Change the ttm_range_man_alloc() allocation from pages to size in bytes. > Fix the dependent drm_mm_nodes start and size from pages to bytes. > > v2 (chk): Change the drm_mm_node usage in amdgpu as well.

[PATCH 3/4] drm/vmwgfx: handle NULL bo->resource in move callback

2023-02-08 Thread Matthew Auld
source is TTM_PL_SYSTEM, otherwise do the multi-hop sequence to ensure can safely call into ttm_bo_move_memcpy(), since it might also need to clear the memory. This should give the same behaviour as before. Fixes: 180253782038 ("drm/ttm: stop allocating dummy resources during BO creation") Signed-off-

[PATCH 4/4] drm/radeon: handle NULL bo->resource in move callback

2023-02-08 Thread Matthew Auld
("drm/ttm: stop allocating dummy resources during BO creation") Signed-off-by: Matthew Auld Cc: Christian König --- drivers/gpu/drm/radeon/radeon_ttm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/ra

[PATCH 2/4] drm/qxl: handle NULL bo->resource in move callback

2023-02-08 Thread Matthew Auld
source is TTM_PL_SYSTEM, otherwise do the multi-hop sequence to ensure can safely call into ttm_bo_move_memcpy(), since it might also need to clear the memory. This should give the same behaviour as before. Fixes: 180253782038 ("drm/ttm: stop allocating dummy resources during BO creation") Signed-off-

[PATCH 1/4] drm/gem-vram: handle NULL bo->resource in move callback

2023-02-08 Thread Matthew Auld
ame behaviour as before. While we are here let's also treat calling ttm_bo_move_memcpy() with NULL bo->resource as programmer error, where expectation is that upper layers should now handle it. Fixes: 180253782038 ("drm/ttm: stop allocating dummy resources during BO creation") Signed-off-

Re: [drm-misc:drm-misc-next] [drm/ttm] 1802537820: WARNING:at_drivers/gpu/drm/drm_gem_vram_helper.c:#drm_gem_vram_offset

2023-02-08 Thread Matthew Auld
On Wed, 8 Feb 2023 at 12:41, Christian König wrote: > > Am 08.02.23 um 10:38 schrieb Matthew Auld: > > On Wed, 8 Feb 2023 at 08:32, Christian König > > wrote: > >> Hey guys, > >> > >> I'm pretty sure this is a bug in bochs which happens to surface

Re: [drm-misc:drm-misc-next] [drm/ttm] 1802537820: WARNING:at_drivers/gpu/drm/drm_gem_vram_helper.c:#drm_gem_vram_offset

2023-02-08 Thread Matthew Auld
On Wed, 8 Feb 2023 at 08:32, Christian König wrote: > > Hey guys, > > I'm pretty sure this is a bug in bochs which happens to surface because > of a recent TTM change, we have seen similar problems in the past with > this driver. > > What happens is that userspace tries to bind a BO to a CRTC

Re: [PATCH] drm/i915/hwmon: Enable PL1 power limit

2023-02-07 Thread Matthew Auld
On Tue, 7 Feb 2023 at 17:19, Dixit, Ashutosh wrote: > > On Tue, 07 Feb 2023 08:12:25 -0800, Dixit, Ashutosh wrote: > > > > On Tue, 07 Feb 2023 01:32:44 -0800, Matthew Auld wrote: > > > > > > On Fri, 3 Feb 2023 at 15:54, Ashutosh Dixit > > >

Re: [PATCH] drm/i915/hwmon: Enable PL1 power limit

2023-02-07 Thread Matthew Auld
On Fri, 3 Feb 2023 at 15:54, Ashutosh Dixit wrote: > > Previous documentation suggested that PL1 power limit is always > enabled. However we now find this not to be the case on some > platforms (such as ATSM). Therefore enable PL1 power limit during hwmon > initialization. For some reason it

Re: [PATCH] drm/i915/gt: Avoid redundant pointer validity check

2023-02-06 Thread Matthew Auld
On 06/02/2023 09:45, Tvrtko Ursulin wrote: Hi, Adding Matt & Thomas as potential candidates to review. Regards, Tvrtko On 03/02/2023 19:30, Deepak R Varma wrote: The macro definition of gen6_for_all_pdes() expands to a for loop such that it breaks when the page table is null. Hence there

Re: [Intel-gfx] [PATCH] Initialize the obj flags for shmem objects

2023-02-03 Thread Matthew Auld
On 03/02/2023 12:10, Tvrtko Ursulin wrote: On 03/02/2023 11:57, Aravind Iddamsetty wrote: Obj flags for shmem objects is not being set correctly. Cc: Matthew Auld Signed-off-by: Aravind Iddamsetty Could even be: Fixes: 13d29c823738 ("drm/i915/ehl: unconditionally flush the

Re: [PATCH] Initialize the obj flags for shmem objects

2023-02-03 Thread Matthew Auld
On 03/02/2023 11:57, Aravind Iddamsetty wrote: Obj flags for shmem objects is not being set correctly. Cc: Matthew Auld Signed-off-by: Aravind Iddamsetty Subject should have "drm/i915:" prefix. This is also a bug fix due to not setting BO_ALLOC_USER (the other flags don't seem

Re: [PATCH 2/2] drm/ttm: revert "stop allocating dummy resources during BO creation"

2023-01-31 Thread Matthew Auld
On Wed, 25 Jan 2023 at 16:24, Matthew Auld wrote: > > On Wed, 25 Jan 2023 at 16:15, Christian König > wrote: > > > > Am 25.01.23 um 17:13 schrieb Matthew Auld: > > > On Wed, 25 Jan 2023 at 15:50, Christian König > > > wrote: > > >> This reve

[PATCH v2 2/6] drm/i915/ttm: audit remaining bo->resource

2023-01-30 Thread Matthew Auld
r make i915_ttm_cpu_maps_iomem() return false with NULL resource. References: 516198d317d8 ("drm/i915: audit bo->resource usage v3") Signed-off-by: Matthew Auld Cc: Christian König Cc: Nirmoy Das Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 10 -- drive

[PATCH v2 6/6] drm/ttm: prevent moving of pinned BOs

2023-01-30 Thread Matthew Auld
-by: Christian König Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 drivers/gpu/drm/nouveau/nouveau_bo.c| 3 --- drivers/gpu/drm/radeon/radeon_ttm.c | 4 drivers/gpu/drm/ttm/ttm_bo.c| 20

[PATCH v2 4/6] drm/ttm: stop allocating dummy resources during BO creation

2023-01-30 Thread Matthew Auld
From: Christian König That should not be necessary any more when drivers should at least be able to handle the move without a resource. Signed-off-by: Christian König Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld --- drivers/gpu/drm/ttm/ttm_bo.c | 7 --- 1 file changed, 7

[PATCH v2 5/6] drm/ttm: stop allocating a dummy resource for pipelined gutting

2023-01-30 Thread Matthew Auld
From: Christian König That should not be necessary any more when drivers should at least be able to handle a move without a resource. Signed-off-by: Christian König Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld --- drivers/gpu/drm/ttm/ttm_bo_util.c | 15 ++- 1 file

[PATCH v2 1/6] drm/i915/ttm: fix sparse warning

2023-01-30 Thread Matthew Auld
: kernel test robot Signed-off-by: Matthew Auld Cc: Christian König Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_ge

[PATCH v2 3/6] drm/ttm: clear the ttm_tt when bo->resource is NULL

2023-01-30 Thread Matthew Auld
ial ttm_tt would be created in ttm_bo_validate() with the clear parameter always set to true. Signed-off-by: Matthew Auld Cc: Christian König Reviewed-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/

Re: [Intel-gfx] [PATCH 2/6] drm/i915/ttm: audit remaining bo->resource

2023-01-30 Thread Matthew Auld
On Mon, 30 Jan 2023 at 11:00, Andrzej Hajda wrote: > > On 30.01.2023 11:12, Matthew Auld wrote: > > In the near future TTM will have NULL bo->resource when the object is > > initially created, plus after calling into pipeline-gutting. Try to > > handle the remaining

[PATCH 4/6] drm/ttm: stop allocating dummy resources during BO creation

2023-01-30 Thread Matthew Auld
From: Christian König That should not be necessary any more when drivers should at least be able to handle the move without a resource. Signed-off-by: Christian König Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld --- drivers/gpu/drm/ttm/ttm_bo.c | 7 --- 1 file changed, 7

[PATCH 3/6] drm/ttm: clear the ttm_tt when bo->resource is NULL

2023-01-30 Thread Matthew Auld
ial ttm_tt would be created in ttm_bo_validate() with the clear parameter always set to true. Signed-off-by: Matthew Auld Cc: Christian König Reviewed-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/

[PATCH 6/6] drm/ttm: prevent moving of pinned BOs

2023-01-30 Thread Matthew Auld
-by: Christian König Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 drivers/gpu/drm/nouveau/nouveau_bo.c| 3 --- drivers/gpu/drm/radeon/radeon_ttm.c | 4 drivers/gpu/drm/ttm/ttm_bo.c| 20

[PATCH 5/6] drm/ttm: stop allocating a dummy resource for pipelined gutting

2023-01-30 Thread Matthew Auld
From: Christian König That should not be necessary any more when drivers should at least be able to handle a move without a resource. Signed-off-by: Christian König Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld --- drivers/gpu/drm/ttm/ttm_bo_util.c | 15 ++- 1 file

  1   2   3   4   5   6   7   8   9   10   >