Jeff Johnson
26149e6fe1
drm/ttm/tests: add missing MODULE_DESCRIPTION() macros
...
make allmodconfig && make W=1 C=1 reports:
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/gpu/drm/ttm/tests/ttm_device_test.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/gpu/drm/ttm/tests/ttm_pool_test.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/gpu/drm/ttm/tests/ttm_resource_test.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/gpu/drm/ttm/tests/ttm_tt_test.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/gpu/drm/ttm/tests/ttm_bo_test.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/gpu/drm/ttm/tests/ttm_bo_validate_test.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/gpu/drm/ttm/tests/ttm_mock_manager.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.o
Add the missing invocations of the MODULE_DESCRIPTION() macro.
Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com >
Acked-by: Christian König <christian.koenig@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240624-md-drivers-gpu-drm-ttm-tests-v2-1-76bb765e19c9@quicinc.com
Signed-off-by: Christian König <christian.koenig@amd.com >
2024-06-25 09:53:13 +02:00
Karolina Stolarek
07430fa524
drm/ttm/tests: Use u32 and u64 over uint*_t types
...
Update the tests and helpers to use unsigned kernel types.
Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com >
Suggested-by: Thomas Hellström <thomas.hellstrom@linux.intel.com >
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com >
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/b36d71de78990ac5be1538cc3f735f7e40618cfe.1718192625.git.karolina.stolarek@intel.com
2024-06-24 16:01:26 +05:30
Karolina Stolarek
be487a2989
drm/ttm/tests: Correct modules' licenses
...
The test files are GPL and MIT, so update the definitions accordingly.
Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com >
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com >
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/54cd7289db67ec396b67ef48dbb45521d56ec03c.1718192625.git.karolina.stolarek@intel.com
2024-06-24 16:01:25 +05:30
Karolina Stolarek
99eec733e8
drm/ttm/tests: Add TODO file
...
List improvements for the test suite with some notes.
Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com >
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com >
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/3856fbbeaf40078d59b45971002b8f9d0d85f8f0.1718192625.git.karolina.stolarek@intel.com
2024-06-24 16:01:24 +05:30
Karolina Stolarek
d6a82a1580
drm/ttm/tests: Add tests for ttm_tt_populate
...
Add tests for functions that add and release pages to TTs. Test the
swapin operation. Export ttm_tt_unpopulate, ttm_tt_swapin and
ttm_tt_swapout symbols for testing purposes.
Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com >
Reviewed-by: Somalapuram, Amaranath <asomalap@amd.com >
Tested-by: Somalapuram, Amaranath <asomalap@amd.com >
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/ee42d83a472ba6bca22b4bce58f332f800891186.1718192625.git.karolina.stolarek@intel.com
2024-06-24 16:01:23 +05:30
Karolina Stolarek
5fe3943385
drm/ttm/tests: Add eviction testing
...
Add tests for ttm_bo_validate that focus on BO eviction and swapout.
Update device funcs definition with eviction-related callbacks. Add
alternative funcs where evict_flags() routes eviction to a domain
that can't allocate resources (dubbed "busy manager" in the tests).
Extract the common path of ttm_device init into a function.
Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com >
Reviewed-by: Somalapuram, Amaranath <asomalap@amd.com >
Tested-by: Somalapuram, Amaranath <asomalap@amd.com >
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/ae8e284d6c7e6bd0be259052bd4f42e07ce24641.1718192625.git.karolina.stolarek@intel.com
2024-06-24 16:01:21 +05:30
Karolina Stolarek
8eda41dfc9
drm/ttm/tests: Add test cases dependent on fence signaling
...
Add test cases that check how the state of dma fences in BO's
reservation object influence the ttm_bo_validation() flow. Do similar
tests for resource manager's move fence.
Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com >
Reviewed-by: Somalapuram, Amaranath <asomalap@amd.com >
Tested-by: Somalapuram, Amaranath <asomalap@amd.com >
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/068791a27abd05bf2605f23cc31864a22c20b308.1718192625.git.karolina.stolarek@intel.com
2024-06-24 16:01:20 +05:30
Karolina Stolarek
32d618e946
drm/ttm/tests: Add tests with mock resource managers
...
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 Stolarek <karolina.stolarek@intel.com >
Tested-by: Somalapuram, Amaranath <asomalap@amd.com >
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com >
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/664791dbb7cbada29e705d2fcaf176023f1b8649.1718192625.git.karolina.stolarek@intel.com
2024-06-24 16:01:17 +05:30
Karolina Stolarek
8bd1ff5ddc
drm/ttm/tests: Test simple BO creation and validation
...
Add tests for ttm_bo_init_reserved() and ttm_bo_validate() that use
sys manager. Define a simple move function in ttm_device_funcs. Expose
destroy callback of the buffer object to make testing of
ttm_bo_init_reserved() behaviour easier.
Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com >
Reviewed-by: Matthew Auld <matthew.auld@intel.com >
Reviewed-by: Somalapuram, Amaranath <asomalap@amd.com >
Tested-by: Somalapuram, Amaranath <asomalap@amd.com >
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/ffba0d62eb98b2cbc61ae7ca90fee7dc0855719c.1718192625.git.karolina.stolarek@intel.com
2024-06-24 16:01:16 +05:30
Karolina Stolarek
f7ed0a7e42
drm/ttm/tests: Use an init function from the helpers lib
...
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 <karolina.stolarek@intel.com >
Reviewed-by: Matthew Auld <matthew.auld@intel.com >
Reviewed-by: Somalapuram, Amaranath <asomalap@amd.com >
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/235f110c1bdd2da7fac62ec03d177a5160dba1d5.1718192625.git.karolina.stolarek@intel.com
2024-06-24 16:01:14 +05:30
Karolina Stolarek
dc50165601
drm/ttm/tests: Set DMA mask in KUnit device
...
In commit d393acce7b ("drm/tests: Switch to kunit devices"),
DRM test helpers migrated away from using a dummy platform driver
in favour of KUnit device. This means that DMA masks for the device
are not set but are required by ttm_pool_alloc tests.
Set the DMA mask for coherent mappings to unblock testing.
Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com >
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com >
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/dbd83b01bc835d922c070ad1c5bd9023e631e6c4.1718192625.git.karolina.stolarek@intel.com
2024-06-24 16:01:13 +05:30
Karolina Stolarek
d0745846a3
drm/ttm/tests: Delete unnecessary config option
...
DRM KUnit helpers are selected automatically when TTM tests are enabled,
so there's no need to do it directly in the .kunitconfig file.
Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com >
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com >
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/1f6f03ac5c6ba7d4b021c2a31638a0ae086486e8.1718192625.git.karolina.stolarek@intel.com
2024-06-24 16:01:13 +05:30
Karolina Stolarek
588c4c8d58
drm/ttm/tests: Fix a warning in ttm_bo_unreserve_bulk
...
BOs in a bulk move have to share the same reservation object. That is
not the case in the ttm_bo_unreserve_bulk subtest. Update
ttm_bo_kunit_init() helper to accept dma_resv object so we can define
buffer objects that share the same resv. Update calls to that helper
accordingly.
Fixes: 995279d280 ("drm/ttm/tests: Add tests for ttm_bo functions")
Suggested-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com >
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com >
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/c5bd2df114781b4eb5c1e8295b2ae4ac2c30a179.1718192625.git.karolina.stolarek@intel.com
2024-06-24 16:01:11 +05:30
Sebastian Andrzej Siewior
f85376c890
drm/ttm/tests: Let ttm_bo_test consider different ww_mutex implementation.
...
PREEMPT_RT has a different locking implementation for ww_mutex. The
base mutex of struct ww_mutex is declared as struct WW_MUTEX_BASE. The
latter is defined as `mutex' for non-PREEMPT_RT builds and `rt_mutex'
for PREEMPT_RT builds.
Using mutex_lock() directly on the base mutex in
ttm_bo_reserve_deadlock() leads to compile error on PREEMPT_RT.
The locking-selftest has its own defines to deal with this and it is
probably best to defines the needed one within the test program since
their usefulness is limited outside of well known selftests.
Provide ww_mutex_base_lock() which points to the correct function for
PREEMPT_RT and non-PREEMPT_RT builds.
Fixes: 995279d280 ("drm/ttm/tests: Add tests for ttm_bo functions")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de >
Signed-off-by: Maxime Ripard <mripard@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240619144630.4DliKOmr@linutronix.de
2024-06-20 10:02:03 +02:00
Maxime Ripard
4db102dcb0
Merge drm/drm-next into drm-misc-next
...
Kickstart 6.9 development cycle.
Signed-off-by: Maxime Ripard <mripard@kernel.org >
2024-01-29 14:20:23 +01:00
Karolina Stolarek
b9bc054951
drm/ttm/tests: Fix argument in ttm_tt_kunit_init()
...
Remove a leftover definition of page order and pass an empty flag value
in ttm_pool_pre_populated().
Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com >
Tested-by: Amaranath Somalapuram <Amaranath.Somalapuram@amd.com >
Reviewed-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@intel.com >
Acked-by: Christian König <christian.koenig@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/db34f34a039cf951c5933e8ae046b4ed72d20dcb.1704959786.git.karolina.stolarek@intel.com
Signed-off-by: Christian König <christian.koenig@amd.com >
2024-01-11 15:11:45 +01:00
Kirill A. Shutemov
5e0a760b44
mm, treewide: rename MAX_ORDER to MAX_PAGE_ORDER
...
commit 23baf831a3 ("mm, treewide: redefine MAX_ORDER sanely") has
changed the definition of MAX_ORDER to be inclusive. This has caused
issues with code that was not yet upstream and depended on the previous
definition.
To draw attention to the altered meaning of the define, rename MAX_ORDER
to MAX_PAGE_ORDER.
Link: https://lkml.kernel.org/r/20231228144704.14033-2-kirill.shutemov@linux.intel.com
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
2024-01-08 15:27:15 -08:00
Kirill A. Shutemov
fd37721803
mm, treewide: introduce NR_PAGE_ORDERS
...
NR_PAGE_ORDERS defines the number of page orders supported by the page
allocator, ranging from 0 to MAX_ORDER, MAX_ORDER + 1 in total.
NR_PAGE_ORDERS assists in defining arrays of page orders and allows for
more natural iteration over them.
[kirill.shutemov@linux.intel.com: fixup for kerneldoc warning]
Link: https://lkml.kernel.org/r/20240101111512.7empzyifq7kxtzk3@box
Link: https://lkml.kernel.org/r/20231228144704.14033-1-kirill.shutemov@linux.intel.com
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com >
Reviewed-by: Zi Yan <ziy@nvidia.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
2024-01-08 15:27:15 -08:00
Karolina Stolarek
995279d280
drm/ttm/tests: Add tests for ttm_bo functions
...
Test reservation and release of TTM buffer objects. Add tests to check
pin and unpin operations.
Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com >
Tested-by: Amaranath Somalapuram <Amaranath.Somalapuram@amd.com >
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/fcd53970f55ae4be8c738e03f9fcf45366d20b47.1701257386.git.karolina.stolarek@intel.com
Signed-off-by: Christian König <christian.koenig@amd.com >
2023-12-14 11:12:32 +01:00
Karolina Stolarek
e6f7c641fa
drm/ttm/tests: Add tests for ttm_tt
...
Test initialization, creation and destruction of ttm_tt instances.
Export ttm_tt_destroy and ttm_tt_create symbols for testing purposes.
Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Tested-by: Amaranath Somalapuram <Amaranath.Somalapuram@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/4459cb89c666bfa377753ae18d0c8917131638e8.1701257386.git.karolina.stolarek@intel.com
Signed-off-by: Christian König <christian.koenig@amd.com >
2023-12-14 11:12:29 +01:00
Karolina Stolarek
9afc1e0aa4
drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man
...
Test initialization of ttm_resource using different memory domains.
Add tests for a system memory manager and functions that can be
tested without a fully-featured resource manager. Update
ttm_bo_kunit_init() to initialize BO's kref and a genuine GEM drm
object. Export ttm_resource_alloc for test purposes only.
Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com >
Tested-by: Amaranath Somalapuram <Amaranath.Somalapuram@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/68b8b293b6bf5f1170d49a1a089ccce9172e2855.1701257386.git.karolina.stolarek@intel.com
Signed-off-by: Christian König <christian.koenig@amd.com >
2023-12-14 11:12:10 +01:00
Karolina Stolarek
9c319a0f6d
drm/ttm/tests: Fix type conversion in ttm_pool_test
...
Fix a warning about casting an integer of different size in
ttm_pool_alloc_basic_dma_addr() subtest. Cast the DMA address to
uintptr_t before casting it to a generic pointer.
Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com >
Cc: Christian König <christian.koenig@amd.com >
Reported-by: kernel test robot <lkp@intel.com >
Closes: https://lore.kernel.org/oe-kbuild-all/202308150419.PaHfWntn-lkp@intel.com/
Link: https://patchwork.freedesktop.org/patch/msgid/20230816105508.1135410-1-karolina.stolarek@intel.com
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
2023-08-22 13:56:11 +02:00
Karolina Stolarek
204042049a
drm/ttm/tests: Add tests for ttm_pool
...
Add KUnit tests that exercise page allocation using page pools
and freeing pages, either by returning them to the pool or
freeing them. Add a basic test for ttm_pool cleanup. Introduce
helpers to create a dummy ttm_buffer_object.
Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/427ea373357d0b6cb376c9d7ebc33c930bf1d28a.1691487006.git.karolina.stolarek@intel.com
Signed-off-by: Christian König <christian.koenig@amd.com >
2023-08-09 18:04:23 +02:00
Karolina Stolarek
24ac009ec3
drm/ttm/tests: Add tests for ttm_device
...
Test initialization and cleanup of the ttm_device struct, including
some error paths. Verify the creation of page pools if use_dma_alloc
param is true.
Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/2abb0e53e7d56b0a24d0255f9075e2123b991278.1691487006.git.karolina.stolarek@intel.com
Signed-off-by: Christian König <christian.koenig@amd.com >
2023-08-09 18:04:23 +02:00
Karolina Stolarek
e3912d09bf
drm/ttm: Introduce KUnit test
...
Add the initial version of unit tests for ttm_device struct, together
with helper functions.
Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/3d1cc45c8a0cf536b92a850e0025f6c555de0169.1691487006.git.karolina.stolarek@intel.com
Signed-off-by: Christian König <christian.koenig@amd.com >
2023-08-09 18:04:22 +02:00