Re: [PATCH RESEND] drm/i915: Mark GPU wedging on driver unregister unrecoverable

2021-09-10 Thread Michał Winiarski
, while dropping intel_gt_set_wedged_on_fini() from __intel_gt_disable() proved to break some driver probe error unwind paths as well as mock selftest exit path. Signed-off-by: Janusz Krzysztofik Cc: Michał Winiarski Reviewed-by: Michał Winiarski -Michał --- Resending with Cc: dri-devel

[RFC 00/10] drm: selftests: Convert to KUnit

2022-01-17 Thread Michał Winiarski
utput and execution times: https://gitlab.freedesktop.org/-/snippets/4139 -Michał Michał Winiarski (10): drm: test-drm_cmdline_parser: Convert to KUnit drm: test-drm_plane_helper: Convert to KUnit drm: test-drm_format: Convert to KUnit drm: test-drm_framebuffer: Convert to KUnit drm: test-d

[RFC 01/10] drm: test-drm_cmdline_parser: Convert to KUnit

2022-01-17 Thread Michał Winiarski
One-to-one conversion, no functional changes. Negative tests were merged into single parameterized test case. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/Kconfig | 12 + drivers/gpu/drm/Makefile |2 +- drivers/gpu/drm/selftests/Makefile

[RFC 02/10] drm: test-drm_plane_helper: Convert to KUnit

2022-01-17 Thread Michał Winiarski
Tests were converted into parameterized test cases. Negative tests were separated. Mocking was moved to test->init(). No functional changes. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/Kconfig | 1 + drivers/gpu/drm/selftests/Makefile| 4 +- .../

[RFC 03/10] drm: test-drm_format: Convert to KUnit

2022-01-17 Thread Michał Winiarski
One-to-one conversion, no functional changes. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/selftests/Makefile| 5 +- .../gpu/drm/selftests/drm_modeset_selftests.h | 3 - drivers/gpu/drm/selftests/test-drm_format.c | 538 ++ .../drm/selftests/test

[RFC 04/10] drm: test-drm_framebuffer: Convert to KUnit

2022-01-17 Thread Michał Winiarski
Mocking was moved to .init() in order to separate it from test logic. No functional changes. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/selftests/Makefile| 3 +- .../gpu/drm/selftests/drm_modeset_selftests.h | 1 - .../gpu/drm/selftests/test-drm_framebuffer.c | 109

[RFC 05/10] drm: test-drm_damage_helper: Convert to KUnit

2022-01-17 Thread Michał Winiarski
Mocking was moved to .init() in order to separate it from test logic. No functional changes. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/selftests/Makefile| 5 +- .../gpu/drm/selftests/drm_modeset_selftests.h | 21 - .../drm/selftests/test-drm_damage_helper.c| 570

[RFC 06/10] drm: test-drm_dp_mst_helper: Convert to KUnit

2022-01-17 Thread Michał Winiarski
igt_dp_mst_calc_pbn_mode was converted one-to-one, igt_dp_mst_sideband_msg_req_decode was refactored to parameterized test. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/selftests/Makefile| 3 +- .../gpu/drm/selftests/drm_modeset_selftests.h | 2 - .../drm/selftests/test

[RFC 07/10] drm: test-drm_rect: Convert to KUnit

2022-01-17 Thread Michał Winiarski
One-to-one conversion, no functional changes. Now that all of the modeset selftests were converted, remove the helpers that are no longer used. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/selftests/Makefile| 8 +- .../gpu/drm/selftests/drm_modeset_selftests.h | 12

[RFC 08/10] drm: test-drm_mm: Convert to KUnit

2022-01-17 Thread Michał Winiarski
e the number of iterations, or force specific seed e.g. by passing the following to kunit.py: --kernel_args 'test_drm_mm.random_seed=X' Signed-off-by: Michał Winiarski --- drivers/gpu/drm/Kconfig |2 + drivers/gpu/drm/selftests/Makefile |4 +-

[RFC 09/10] drm: selftests: Convert to KUnit

2022-01-17 Thread Michał Winiarski
Now that all tests were converted, remove the content that's no longer used and rename the directory to "test". Signed-off-by: Michał Winiarski --- drivers/gpu/drm/Kconfig | 17 --- drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/i91

[RFC 10/10] drm: test: Simplify testing on UML with kunit.py

2022-01-17 Thread Michał Winiarski
DRM depends on IOMEM and DMA, introduce an additional Kconfig to pull in IOMEM and DMA emulation on UML. Also, add .kunitconfig to simplify running DRM tests with: ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/gpu/drm Signed-off-by: Michał Winiarski --- drivers/gpu/drm/.kunitconfig

Re: [RFC 00/10] drm: selftests: Convert to KUnit

2022-01-20 Thread Michał Winiarski
On 19.01.2022 00:58, Daniel Latypov wrote: change On Mon, Jan 17, 2022 at 3:24 PM Michał Winiarski wrote: KUnit unifies the test structure and provides helper tools that simplify the development. Basic use case allows running tests as regular processes, leveraging User Mode Linux. For

Re: [RFC 06/10] drm: test-drm_dp_mst_helper: Convert to KUnit

2022-01-20 Thread Michał Winiarski
On 19.01.2022 01:28, Daniel Latypov wrote: On Mon, Jan 17, 2022 at 3:24 PM Michał Winiarski wrote: igt_dp_mst_calc_pbn_mode was converted one-to-one, igt_dp_mst_sideband_msg_req_decode was refactored to parameterized test. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/selftests

[PATCH 1/2] drm/cmdline-parser: Merge negative tests

2022-08-04 Thread Michał Winiarski
Negative tests can be expressed as a single parameterized test case, which highlights that we're following the same test logic (passing negative cmdline and expecting drm_mode_parse_command_line_for_connector to fail), which improves readability. Signed-off-by: Michał Winiarski --- .../gp

[PATCH 2/2] drm/cmdline-parser: Use assert when needed

2022-08-04 Thread Michał Winiarski
Expecting to observe a specific value, when the function responsible for setting the value has failed will lead to extra noise in test output. Use assert when the situation calls for it. Also - very small tidying up around the changed areas (whitespace / variable locality). Signed-off-by: Michał

[PATCH v2 1/2] drm/cmdline-parser: Merge negative tests

2022-08-17 Thread Michał Winiarski
other testcases in DRM Signed-off-by: Michał Winiarski Tested-by: Maíra Canal --- .../gpu/drm/tests/drm_cmdline_parser_test.c | 293 ++ 1 file changed, 103 insertions(+), 190 deletions(-) diff --git a/drivers/gpu/drm/tests/drm_cmdline_parser_test.c b/drivers/gpu/drm/

[PATCH v2 2/2] drm/cmdline-parser: Use assert when needed

2022-08-17 Thread Michał Winiarski
huge) (lkp) Signed-off-by: Michał Winiarski --- .../gpu/drm/tests/drm_cmdline_parser_test.c | 80 +-- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/drivers/gpu/drm/tests/drm_cmdline_parser_test.c b/drivers/gpu/drm/tests/drm_cmdline_parser_test.c index

[PATCH 0/3] drm: Use full allocated minor range for DRM

2022-08-17 Thread Michał Winiarski
64 DRM device nodes is not enough for everyone. Upgrade it to 512K (which definitely is more than enough). Additionally - one minor tweak around minor IDR locking. Michał Winiarski (3): drm: Don't reserve minors for control nodes drm: Expand max DRM device number to full MINORBITS drm

[PATCH 3/3] drm: Use mutex for minors

2022-08-17 Thread Michał Winiarski
Operating on drm minor is not done in IRQ context, which means that we could safely downgrade to regular non-irq spinlock. But we can also go further and drop the idr_preload tricks by just using a mutex. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/drm_drv.c | 31

[PATCH 1/3] drm: Don't reserve minors for control nodes

2022-08-17 Thread Michał Winiarski
uot;drm: remove all control node code") References: commit c9ac371d4b59 ("drm: Fix render node numbering regression from control node removal.") Signed-off-by: Michał Winiarski --- drivers/gpu/drm/drm_drv.c | 4 ++-- include/drm/drm_file.h| 1 - 2 files changed, 2 insertions(+)

Re: [PATCH v2 1/2] drm/cmdline-parser: Merge negative tests

2022-08-18 Thread Michał Winiarski
On Thu, Aug 18, 2022 at 11:15:39AM -0300, Maíra Canal wrote: > > > On 8/17/22 18:12, Michał Winiarski wrote: > > Negative tests can be expressed as a single parameterized test case, > > which highlights that we're following the same test logic (passing > &g

Re: [PATCH 0/3] drm: Use full allocated minor range for DRM

2022-08-19 Thread Michał Winiarski
On Fri, Aug 19, 2022 at 08:16:07AM +, Simon Ser wrote: > (It seems like the list was dropped in my reply, sorry about that. > Re-adding it now.) > > On Thursday, August 18th, 2022 at 14:06, Michał Winiarski > wrote: > > > On Thu, Aug 18, 2022 at 07:39:13A

[PATCH v2 0/2] drm: Use full allocated minor range for DRM

2022-08-23 Thread Michał Winiarski
64 DRM device nodes is not enough for everyone. Upgrade it to ~341K (which definitely is more than enough). Additionally - one minor tweak around minor IDR locking. v1 -> v2: Don't touch DRM_MINOR_CONTROL and its range (Simon Ser) Michał Winiarski (2): drm: Expand max DRM device number

[PATCH v2 1/2] drm: Expand max DRM device number to full MINORBITS

2022-08-23 Thread Michał Winiarski
numbering scheme where 0-63 is used for primary, 64-127 is reserved (formerly for control) and 128-191 is used for render. This is continued for minors >= 192 (192-255 for primary, 256-319 reserved, 320-383 for render, and so on). Signed-off-by: Michał Winiarski --- drivers/gpu/drm/d

[PATCH v2 2/2] drm: Use mutex for minors

2022-08-23 Thread Michał Winiarski
Operating on drm minor is not done in IRQ context, which means that we could safely downgrade to regular non-irq spinlock. But we can also go further and drop the idr_preload tricks by just using a mutex. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/drm_drv.c | 31

Re: [PATCH v5 9/9] drm: selftest: convert drm_mm selftest to KUnit

2022-08-23 Thread Michał Winiarski
> > > Am 22/07/2022 um 1:25 PM schrieb Michał Winiarski : > > > > On Fri, Jul 22, 2022 at 08:04:51AM -0300, Maíra Canal wrote: > >> On 7/22/22 07:35, Matthew Auld wrote: > >>> On Fri, 8 Jul 2022 at 21:32, Maíra Canal wrote: > >>>> > &

[PATCH 2/3] drm: Expand max DRM device number to full MINORBITS

2022-08-24 Thread Michał Winiarski
vices. To avoid regressing the existing userspace, we're still maintaining the 0-127 for primary, 128-255 for render. This numbering scheme is continued for minors > 256 (256-383 for primary, 384-511 for render, and so on). Signed-off-by: Michał Winiarski --- drivers/gpu/drm/drm_drv.c | 24

[PATCH 1/2] drm/plane_helper: Print actual/expected values on failure

2022-08-25 Thread Michał Winiarski
Currently the values are printed with debug log level. Adjust the log level and link the output with the test by using kunit_err. Example output: foo: dst: 20x20+10+10, expected: 10x10+0+0 foo: EXPECTATION FAILED at drivers/gpu/drm/tests/drm_plane_helper_test.c:85 Signed-off-by: Michał Winiarski

[PATCH 2/2] drm/plane_helper: Split into parameterized test cases

2022-08-25 Thread Michał Winiarski
: 12 Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_plane_helper_test.c | 419 +++--- 1 file changed, 255 insertions(+), 164 deletions(-) diff --git a/drivers/gpu/drm/tests/drm_plane_helper_test.c b/drivers/gpu/drm/tests/drm_plane_helper_test.c index 0bbd42d2d37b

Re: [PATCH 1/2] drm/tests: Split drm_framebuffer_create_test into parameterized tests

2022-08-31 Thread Michał Winiarski
winiar...@intel.com/ for reference) Either way: Reviewed-by: Michał Winiarski -Michał > --- > drivers/gpu/drm/tests/drm_framebuffer_test.c | 23 +--- > 1 file changed, 10 insertions(+), 13 deletions(-) > > diff --git a/drivers/gpu/drm/tests/drm_frameb

Re: [PATCH 2/2] drm/plane_helper: Split into parameterized test cases

2022-08-31 Thread Michał Winiarski
On Fri, Aug 26, 2022 at 07:34:11PM -0300, Maíra Canal wrote: > Hi Michał > > Great patch! Just a few nits inline. > > On 8/25/22 09:48, Michał Winiarski wrote: > > The test was constructed as a single function (test case) which checks > > multiple conditions, calling

[PATCH v2 1/2] drm/plane_helper: Print actual/expected values on failure

2022-08-31 Thread Michał Winiarski
Currently the values are printed with debug log level. Adjust the log level and link the output with the test by using kunit_err. Example output: foo: dst: 20x20+10+10, expected: 10x10+0+0 foo: EXPECTATION FAILED at drivers/gpu/drm/tests/drm_plane_helper_test.c:85 Signed-off-by: Michał Winiarski

[PATCH v2 2/2] drm/plane_helper: Split into parameterized test cases

2022-08-31 Thread Michał Winiarski
: 12 v2: Add missing EXPECT/ASSERT (Maíra) Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_plane_helper_test.c | 456 ++ 1 file changed, 267 insertions(+), 189 deletions(-) diff --git a/drivers/gpu/drm/tests/drm_plane_helper_test.c b/drivers/gpu/drm/tests

[PATCH 1/2] drm/format: Use appropriate types in expect/assert

2022-08-31 Thread Michał Winiarski
drm_format_info_* functions don't return bool, and the info variable is a pointer. Expecting non-NULL info will cause the test to crash if it is NULL in checks that follow (which dereference it). Use appropriate KUNIT_EXPECT/KUNIT_ASSERT variants. Signed-off-by: Michał Winiarski --- driver

[PATCH 2/2] drm/format: Split into more granular test cases

2022-08-31 Thread Michał Winiarski
=== [PASSED] drm_format Testing complete. Ran 18 tests: passed: 18 Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_format_test.c | 156 1 file changed, 108 insertions(+), 48

[PATCH] drm: Simplify testing on UML with kunit.py

2022-09-01 Thread Michał Winiarski
DRM depends on IOMEM and DMA, introduce an additional Kconfig to pull in IOMEM and DMA emulation on UML. Since --kconfig_add usage is no longer needed, remove it from documentation. Signed-off-by: Michał Winiarski --- Documentation/gpu/drm-internals.rst | 7 +-- drivers/video/Kconfig

Re: [PATCH] drm: Simplify testing on UML with kunit.py

2022-09-01 Thread Michał Winiarski
On Thu, Sep 01, 2022 at 04:02:53PM +0200, Maxime Ripard wrote: > Hi, > > On Thu, Sep 01, 2022 at 03:36:21PM +0200, Michał Winiarski wrote: > > DRM depends on IOMEM and DMA, introduce an additional Kconfig to pull in > > IOMEM and DMA emulation on UML. > > Since --kco

Re: [PATCH v2 2/2] drm/tests: Change "igt_" prefix to "test_drm_"

2022-09-02 Thread Michał Winiarski
On Fri, Sep 02, 2022 at 04:03:20PM +0300, Jani Nikula wrote: > On Fri, 02 Sep 2022, Maxime Ripard wrote: > > On Fri, Sep 02, 2022 at 11:04:14AM +0300, Jani Nikula wrote: > >> On Thu, 01 Sep 2022, Maíra Canal wrote: > >> > Hi Maxime, > >> > > >> > On 9/1/22 09:55, Maxime Ripard wrote: > >> >> Hi,

Re: [PATCH 2/2] drm/format: Split into more granular test cases

2022-09-02 Thread Michał Winiarski
On Wed, Aug 31, 2022 at 07:15:11PM -0300, Maíra Canal wrote: > Hi Michał > > Some very minor nits inline, but either way: > > Reviewed-by: Maíra Canal > > On 8/31/22 18:56, Michał Winiarski wrote: > > While we have multiple test cases, most of them check multiple

Re: [PATCH v2 2/2] drm/plane_helper: Split into parameterized test cases

2022-09-02 Thread Michał Winiarski
On Thu, Sep 01, 2022 at 09:20:55AM -0300, Maíra Canal wrote: > Hi Michał > > On 8/31/22 17:45, Michał Winiarski wrote: > > The test was constructed as a single function (test case) which checks > > multiple conditions, calling the function that is tested multiple tim

Re: [PATCH v2 2/2] drm/tests: Change "igt_" prefix to "test_drm_"

2022-09-05 Thread Michał Winiarski
On Mon, Sep 05, 2022 at 02:10:00PM +0200, Maxime Ripard wrote: > On Fri, Sep 02, 2022 at 03:38:28PM +0200, Michał Winiarski wrote: > > On Fri, Sep 02, 2022 at 04:03:20PM +0300, Jani Nikula wrote: > > > On Fri, 02 Sep 2022, Maxime Ripard wrote: > > > > On Fri, Se

[PATCH v3 1/2] drm/plane_helper: Print actual/expected values on failure

2022-09-05 Thread Michał Winiarski
Currently the values are printed with debug log level. Adjust the log level and link the output with the test by using kunit_err. Example output: foo: dst: 20x20+10+10, expected: 10x10+0+0 foo: EXPECTATION FAILED at drivers/gpu/drm/tests/drm_plane_helper_test.c:85 Signed-off-by: Michał Winiarski

[PATCH v3 2/2] drm/plane_helper: Split into parameterized test cases

2022-09-05 Thread Michał Winiarski
: 12 v2: Add missing EXPECT/ASSERT (Maíra) v3: Use single EXPECT insted of condition + KUNIT_FAILURE (Maíra) Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_plane_helper_test.c | 466 ++ 1 file changed, 268 insertions(+), 198 deletions(-) diff --git a/drivers/gpu/drm

[PATCH] drm/doc: Custom Kconfig for KUnit is no longer needed

2022-09-05 Thread Michał Winiarski
When built for UML, KUnit provides virtio/PCI, which means that the DMA/IOMEM UML emulation needed by DRM is already present and does not need to be manually added with --kconfig_add. References: commit 6fc3a8636a7b ("kunit: tool: Enable virtio/PCI by default on UML") Signed-off-

Re: [PATCH] drm/doc: Custom Kconfig for KUnit is no longer needed

2022-09-06 Thread Michał Winiarski
On Tue, Sep 06, 2022 at 08:37:00AM +0700, Bagas Sanjaya wrote: > On 9/6/22 01:47, Michał Winiarski wrote: > > References: commit 6fc3a8636a7b ("kunit: tool: Enable virtio/PCI by default > > on UML") > > Use Fixes: tag for bugfix patches instead. Can documentat

[PATCH v3 0/4] drm: Use full allocated minor range for DRM

2022-09-06 Thread Michał Winiarski
nor tweak around minor DRM IDR locking and IDR lockdep annotations. v1 -> v2: Don't touch DRM_MINOR_CONTROL and its range (Simon Ser) v2 -> v3: Don't use legacy scheme for >=192 minor range (Dave Airlie) Add modparam for testing (Dave Airlie) Add lockdep annotation for IDR (

[PATCH v3 1/4] drm: Expand max DRM device number to full MINORBITS

2022-09-06 Thread Michał Winiarski
numbering scheme where 0-63 is used for primary, 64-127 is reserved (formerly for control) and 128-191 is used for render. For minors >= 192, we're allocating minors dynamically on a first-come, first-served basis. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/drm_drv.c | 8

[PATCH v3 2/4] drm: Introduce skip_legacy_minors modparam

2022-09-06 Thread Michał Winiarski
rspace side by allocating minors from the >=192 range (without the need of having >64 physical devices connected). Signed-off-by: Michał Winiarski --- drivers/gpu/drm/drm_drv.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_drv.c

[PATCH v3 3/4] drm: Use mutex for minors

2022-09-06 Thread Michał Winiarski
Operating on drm minor is not done in IRQ context, which means that we could safely downgrade to regular non-irq spinlock. But we can also go further and drop the idr_preload tricks by just using a mutex. Signed-off-by: Michał Winiarski Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_drv.c

[PATCH v3 4/4] idr: Add might_alloc() annotation

2022-09-06 Thread Michał Winiarski
Using might_alloc() lets us catch problems in a deterministic manner, even if we end up not allocating anything. Signed-off-by: Michał Winiarski --- lib/radix-tree.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/radix-tree.c b/lib/radix-tree.c index 3c78e1e8b2ad..787ab01001de

Re: [PATCH v3 0/4] drm: Use full allocated minor range for DRM

2022-09-06 Thread Michał Winiarski
On Tue, Sep 06, 2022 at 03:21:25PM +0100, Matthew Wilcox wrote: > On Tue, Sep 06, 2022 at 04:01:13PM +0200, Michał Winiarski wrote: > > 64 DRM device nodes is not enough for everyone. > > Upgrade it to ~512K (which definitely is more than enough). > > > > To allow te

[PATCH v4 0/3] drm: Use full allocated minor range for DRM

2022-09-06 Thread Michał Winiarski
er) v3 -> v4: Convert from IDR to XArray (Matthew Wilcox) Michał Winiarski (3): drm: Use XArray instead of IDR for minors drm: Expand max DRM device number to full MINORBITS drm: Introduce skip_legacy_minors modparam drivers/gpu/drm/drm_drv.c | 66 +++---

[PATCH v4 2/3] drm: Expand max DRM device number to full MINORBITS

2022-09-06 Thread Michał Winiarski
numbering scheme where 0-63 is used for primary, 64-127 is reserved (formerly for control) and 128-191 is used for render. For minors >= 192, we're allocating minors dynamically on a first-come, first-served basis. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/drm_drv.c | 9 +

[PATCH v4 1/3] drm: Use XArray instead of IDR for minors

2022-09-06 Thread Michał Winiarski
IDR is deprecated, and since XArray manages its own state with internal locking, it simplifies the locking on DRM side. Additionally, don't use the IRQ-safe variant, since operating on drm minor is not done in IRQ context. Signed-off-by: Michał Winiarski Suggested-by: Matthew W

[PATCH v4 3/3] drm: Introduce skip_legacy_minors modparam

2022-09-06 Thread Michał Winiarski
rspace side by allocating minors from the >=192 range (without the need of having >64 physical devices connected). Signed-off-by: Michał Winiarski --- drivers/gpu/drm/drm_drv.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_drv.c

Re: [PATCH v4 1/3] drm: Use XArray instead of IDR for minors

2022-09-11 Thread Michał Winiarski
On Tue, Sep 06, 2022 at 10:02:24PM +0100, Matthew Wilcox wrote: > On Tue, Sep 06, 2022 at 10:16:27PM +0200, Michał Winiarski wrote: > > IDR is deprecated, and since XArray manages its own state with internal > > locking, it simplifies the locking on DRM side. > > Additional

[PATCH v5 0/3] drm: Use full allocated minor range for DRM

2022-09-11 Thread Michał Winiarski
er) v3 -> v4: Convert from IDR to XArray (Matthew Wilcox) v4 -> v5: Fixup IDR to XArray conversion (Matthew Wilcox) Michał Winiarski (3): drm: Use XArray instead of IDR for minors drm: Expand max DRM device number to full MINORBITS drm: Introduce skip_legacy_minors modparam dr

[PATCH v5 2/3] drm: Expand max DRM device number to full MINORBITS

2022-09-11 Thread Michał Winiarski
numbering scheme where 0-63 is used for primary, 64-127 is reserved (formerly for control) and 128-191 is used for render. For minors >= 192, we're allocating minors dynamically on a first-come, first-served basis. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/drm_drv.c | 13 +++

[PATCH v5 1/3] drm: Use XArray instead of IDR for minors

2022-09-11 Thread Michał Winiarski
IDR is deprecated, and since XArray manages its own state with internal locking, it simplifies the locking on DRM side. Additionally, don't use the IRQ-safe variant, since operating on drm minor is not done in IRQ context. Signed-off-by: Michał Winiarski Suggested-by: Matthew W

[PATCH v5 3/3] drm: Introduce skip_legacy_minors modparam

2022-09-11 Thread Michał Winiarski
rspace side by allocating minors from the >=192 range (without the need of having >64 physical devices connected). Signed-off-by: Michał Winiarski --- drivers/gpu/drm/drm_drv.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_drv.c

Re: [PATCH 2/2] drm/tests: Split drm_test_dp_mst_sideband_msg_req_decode into parameterized tests

2022-09-25 Thread Michał Winiarski
On Sun, Sep 25, 2022 at 07:27:19PM -0300, Maíra Canal wrote: > The drm_test_dp_mst_sideband_msg_req_decode repeats the same test > structure with different parameters. This could be better represented > by parameterized tests, provided by KUnit. > > So, convert drm_test_dp_mst_sideband_msg_req_dec

Re: [PATCH 1/2] drm/tests: Split drm_test_dp_mst_calc_pbn_mode into parameterized tests

2022-09-25 Thread Michał Winiarski
t_calc_pbn_mode into parameterized tests. > > Signed-off-by: Maíra Canal Reviewed-by: Michał Winiarski -Michał > --- > .../gpu/drm/tests/drm_dp_mst_helper_test.c| 77 +-- > 1 file changed, 53 insertions(+), 24 deletions(-)

Re: [PATCH v2 2/2] drm/tests: Split drm_test_dp_mst_sideband_msg_req_decode into parameterized tests

2022-09-29 Thread Michał Winiarski
eterized > tests and make the tests' allocations and prints completely managed by KUnit. > > Signed-off-by: Maíra Canal > --- > v1 -> v2: > https://lore.kernel.org/dri-devel/20220925222719.345424-1-mca...@igalia.com/T/#m056610a23a63109484afeafefb5846178c4d36b2 >

Re: [PATCH v2 2/2] drm/tests: Split drm_test_dp_mst_sideband_msg_req_decode into parameterized tests

2022-09-30 Thread Michał Winiarski
On Fri, Sep 30, 2022 at 02:50:43PM +0800, David Gow wrote: > On Fri, Sep 30, 2022 at 6:33 AM Michał Winiarski > wrote: > > > > On Tue, Sep 27, 2022 at 07:12:06PM -0300, Maíra Canal wrote: > > > The drm_test_dp_mst_sideband_msg_req_decode repeats the same test >

Re: [PATCH v5 9/9] drm: selftest: convert drm_mm selftest to KUnit

2022-07-22 Thread Michał Winiarski
On Fri, Jul 22, 2022 at 08:04:51AM -0300, Maíra Canal wrote: > On 7/22/22 07:35, Matthew Auld wrote: > > On Fri, 8 Jul 2022 at 21:32, Maíra Canal wrote: > >> > >> From: Arthur Grillo > >> > >> Considering the current adoption of the KUnit framework, convert the > >> DRM mm selftest to the KUnit A

Re: [RFC PATCH 08/97] drm/i915/guc: Keep strict GuC ABI definitions

2021-05-24 Thread Michał Winiarski
; > Signed-off-by: Michal Wajdeczko > Signed-off-by: Matthew Brost > Cc: Michał Winiarski Reviewed-by: Michał Winiarski -Michał > --- > .../gpu/drm/i915/gt/uc/abi/guc_actions_abi.h | 51 + > .../gt/uc/abi/guc_communication_ctb_abi.h | 106 + > ...

Re: [PATCH v3 2/2] drm/tests: Split drm_test_dp_mst_sideband_msg_req_decode into parameterized tests

2022-10-03 Thread Michał Winiarski
n with the data going out and it doesn't transform the data > itself in any way. > > So, convert drm_test_dp_mst_sideband_msg_req_decode into parameterized > tests and make the tests' allocations and prints completely managed by KUnit. > > Signed-off-by: Maíra Canal Revie

Re: [PATCH v5 07/22] drm/client: Add some tests for drm_connector_pick_cmdline_mode()

2022-10-20 Thread Michał Winiarski
On Thu, Oct 13, 2022 at 03:18:51PM +0200, Maxime Ripard wrote: > +static struct kunit_case drm_pick_cmdline_tests[] = { > + KUNIT_CASE(drm_pick_cmdline_res_1920_1080_60), > + {} > +}; drm_test_pick_cmdline_res_1920_1080_60, since we adopted a consistent naming convention for test cases in

[PATCH v4 1/2] drm/plane_helper: Print actual/expected values on failure

2022-10-20 Thread Michał Winiarski
Currently the values are printed with debug log level. Adjust the log level and link the output with the test by using kunit_err. Example output: foo: dst: 20x20+10+10, expected: 10x10+0+0 foo: EXPECTATION FAILED at drivers/gpu/drm/tests/drm_plane_helper_test.c:85 Signed-off-by: Michał Winiarski

[PATCH v4 2/2] drm/plane_helper: Split into parameterized test cases

2022-10-20 Thread Michał Winiarski
: 12 v2: Add missing EXPECT/ASSERT (Maíra) v3: Use single EXPECT insted of condition + KUNIT_FAILURE (Maíra) v4: Rebase after "drm_test" rename Signed-off-by: Michał Winiarski Reviewed-by: Maíra Canal --- drivers/gpu/drm/tests/drm_plane_helper_test.c | 466 ++ 1 file ch

Re: [RFC PATCH 3/3] drm: add dedicated minor for accelerator devices

2022-10-25 Thread Michał Winiarski
On Mon, Oct 24, 2022 at 08:43:58PM +0300, Oded Gabbay wrote: > On Mon, Oct 24, 2022 at 6:21 PM Jeffrey Hugo wrote: > > > > On 10/22/2022 3:46 PM, Oded Gabbay wrote: > > > The accelerator devices are exposed to user-space using a dedicated > > > major. In addition, they are represented in /dev with

Re: [PATCH 1/2] drm: remove DRM_MINOR_CONTROL

2022-10-25 Thread Michał Winiarski
On Tue, Oct 11, 2022 at 01:55:01PM +0200, Christian König wrote: > Am 11.10.22 um 13:39 schrieb Simon Ser: > > On Tuesday, October 11th, 2022 at 13:04, Christian König > > wrote: > > > > > --- a/include/drm/drm_file.h > > > +++ b/include/drm/drm_file.h > > > @@ -54,7 +54,6 @@ struct file; > > >

[PATCH v3] drm: Use XArray instead of IDR for minors

2022-11-07 Thread Michał Winiarski
IDR is deprecated, and since XArray manages its own state with internal locking, it simplifies the locking on DRM side. Additionally, don't use the IRQ-safe variant, since operating on drm minor is not done in IRQ context. Signed-off-by: Michał Winiarski Suggested-by: Matthew Wilcox ---

Re: [PATCH v5 1/3] drm: Use XArray instead of IDR for minors

2022-11-07 Thread Michał Winiarski
On Sun, Nov 06, 2022 at 04:51:39PM +0200, Oded Gabbay wrote: > On Wed, Nov 2, 2022 at 4:23 PM Oded Gabbay wrote: > > > > On Mon, Sep 12, 2022 at 12:17 AM Michał Winiarski > > wrote: > > > > > > IDR is deprecated, and since XArray manages its own state wit

Re: KUnit issues - Was: [igt-dev] [PATCH RFC v2 8/8] drm/i915: check if current->mm is not NULL

2022-11-07 Thread Michał Winiarski
On Thu, Nov 03, 2022 at 04:23:02PM +0100, Mauro Carvalho Chehab wrote: > Hi, > > I'm facing a couple of issues when testing KUnit with the i915 driver. > > The DRM subsystem and the i915 driver has, for a long time, his own > way to do unit tests, which seems to be added before KUnit. > > I'm no

Re: [PATCH RESEND] drm/tests: Suballocator test

2023-03-26 Thread Michał Winiarski
On Thu, Mar 02, 2023 at 09:34:22AM +0100, Thomas Hellström wrote: > Add a suballocator test to get some test coverage for the new drm > suballocator, and perform some basic timing (elapsed time). > > Signed-off-by: Thomas Hellström > --- > drivers/gpu/drm/Kconfig | 1 + > dri

[PATCH v6 0/4] drm: Use full allocated minor range for DRM

2023-07-24 Thread Michał Winiarski
er) v3 -> v4: Convert from IDR to XArray (Matthew Wilcox) v4 -> v5: Fixup IDR to XArray conversion (Matthew Wilcox) v5 -> v6: Also convert Accel to XArray Rename skip_legacy_minors to force_extended_minors Michał Winiarski (4): drm: Use XArray instead of IDR for minors accel: Use X

[PATCH v6 1/4] drm: Use XArray instead of IDR for minors

2023-07-24 Thread Michał Winiarski
IDR is deprecated, and since XArray manages its own state with internal locking, it simplifies the locking on DRM side. Additionally, don't use the IRQ-safe variant, since operating on drm minor is not done in IRQ context. Signed-off-by: Michał Winiarski Suggested-by: Matthew W

[PATCH v6 2/4] accel: Use XArray instead of IDR for minors

2023-07-24 Thread Michał Winiarski
. Signed-off-by: Michał Winiarski --- drivers/accel/drm_accel.c | 110 +++-- drivers/gpu/drm/drm_drv.c | 66 ++-- drivers/gpu/drm/drm_file.c | 2 +- drivers/gpu/drm/drm_internal.h | 4 -- include/drm/drm_accel.h| 18

[PATCH v6 4/4] drm: Introduce force_extended_minors modparam

2023-07-24 Thread Michał Winiarski
rspace side by allocating minors from the >=192 range (without the need of having >64 physical devices connected). Signed-off-by: Michał Winiarski --- drivers/gpu/drm/drm_drv.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_drv.c

[PATCH v6 3/4] drm: Expand max DRM device number to full MINORBITS

2023-07-24 Thread Michał Winiarski
numbering scheme where 0-63 is used for primary, 64-127 is reserved (formerly for control) and 128-191 is used for render. For minors >= 192, we're allocating minors dynamically on a first-come, first-served basis. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/drm_drv.c | 12 ++

Re: [PATCH] drm: Don't reserve minors for control nodes

2020-04-21 Thread Michał Winiarski
Quoting Daniel Vetter (2020-04-21 15:13:34) > On Tue, Apr 21, 2020 at 2:50 PM Michał Winiarski wrote: > > > > From: Michał Winiarski > > > > Control nodes are no longer with us. > > While we still need to preserve render nodes numbering, there's no need >

[PATCH] drm: Don't reserve minors for control nodes

2020-04-21 Thread Michał Winiarski
From: Michał Winiarski Control nodes are no longer with us. While we still need to preserve render nodes numbering, there's no need to reserve the range formerly used for control. Let's repurpose it to be used by primary and remove control remains from the code entirely.

[PATCH v7 0/3] drm: Use full allocated minor range for DRM

2024-08-23 Thread Michał Winiarski
) v4 -> v5: Fixup IDR to XArray conversion (Matthew Wilcox) v5 -> v6: Also convert Accel to XArray Rename skip_legacy_minors to force_extended_minors v6 -> v7: Drop the force_extended_minors patch intended for debug Rebase on latest drm-tip Update the cover letter, pointing out libd

[PATCH v7 1/3] drm: Use XArray instead of IDR for minors

2024-08-23 Thread Michał Winiarski
IDR is deprecated, and since XArray manages its own state with internal locking, it simplifies the locking on DRM side. Additionally, don't use the IRQ-safe variant, since operating on drm minor is not done in IRQ context. Suggested-by: Matthew Wilcox Acked-by: James Zhu Signed-off-by: M

[PATCH v7 2/3] accel: Use XArray instead of IDR for minors

2024-08-23 Thread Michał Winiarski
. Acked-by: James Zhu Signed-off-by: Michał Winiarski --- drivers/accel/drm_accel.c | 110 +++-- drivers/gpu/drm/drm_drv.c | 66 ++-- drivers/gpu/drm/drm_file.c | 2 +- drivers/gpu/drm/drm_internal.h | 4 -- include/drm/drm_accel.h

[PATCH v7 3/3] drm: Expand max DRM device number to full MINORBITS

2024-08-23 Thread Michał Winiarski
numbering scheme where 0-63 is used for primary, 64-127 is reserved (formerly for control) and 128-191 is used for render. For minors >= 192, we're allocating minors dynamically on a first-come, first-served basis. Acked-by: James Zhu Signed-off-by: Michał Winiarski --- drivers/gpu/

Re: [PATCH v6 1/4] drm: Use XArray instead of IDR for minors

2023-08-28 Thread Michał Winiarski
On Fri, Aug 25, 2023 at 12:59:26PM -0400, James Zhu wrote: > > On 2023-07-24 17:14, Michał Winiarski wrote: > > IDR is deprecated, and since XArray manages its own state with internal > > locking, it simplifies the locking on DRM side. > > Additionally, don't us

[PATCH] iosys-map: Rename locals used inside macros

2023-10-24 Thread Michał Winiarski
Widely used variable names can be used by macro users, potentially leading to name collisions. Suffix locals used inside the macros with an underscore, to reduce the collision potential. Suggested-by: Lucas De Marchi Signed-off-by: Michał Winiarski --- include/linux/iosys-map.h | 44

Re: [PATCH v6 0/4] drm: Use full allocated minor range for DRM

2024-08-13 Thread Michał Winiarski
/ Acks. If you're interested to have a go at it - I can resend it. It should still apply on latest drm-tip. -Michał > > Alex > > On Mon, Jul 24, 2023 at 5:15 PM Michał Winiarski > wrote: > > > > 64 DRM device nodes is not enough for everyone. > > Upgrade

[PATCH] drm/tests: mm: Convert to drm_dbg_printer

2024-02-09 Thread Michał Winiarski
Fix one of the tests in drm_mm that was not converted prior to drm_debug_printer removal, causing tests build failure. Fixes: e154c4fc7bf2d ("drm: remove drm_debug_printer in favor of drm_dbg_printer") Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_mm_test.c | 2

[PATCH 0/2] drm/managed: Add drmm_release_action

2023-11-29 Thread Michał Winiarski
devres devm_release_action) and a simple test that uses it. Michał Winiarski (2): drm/managed: Add drmm_release_action drm/tests: managed: Add a simple test for drmm_managed_release drivers/gpu/drm/drm_managed.c| 39 ++ drivers/gpu/drm/tests/drm_managed_test.c | 65

[PATCH 2/2] drm/tests: managed: Add a simple test for drmm_managed_release

2023-11-29 Thread Michał Winiarski
Add a simple test that checks whether the action is indeed called right away and that it is not called on the final drm_dev_put(). Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 65 ++-- 1 file changed, 50 insertions(+), 15 deletions(-) diff

[PATCH 1/2] drm/managed: Add drmm_release_action

2023-11-29 Thread Michał Winiarski
Similar to devres equivalent, it allows to call the "release" action directly and remove the resource from the managed resources list. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/drm_managed.c | 39 +++ include/drm/drm_managed.h | 4 +++

Re: [PATCH 2/2] drm/tests: managed: Add a simple test for drmm_managed_release

2023-12-04 Thread Michał Winiarski
On Thu, Nov 30, 2023 at 09:38:35AM +0100, Maxime Ripard wrote: > Hi, > > Thanks for creating a test for that, that's really appreciated :) > > On Wed, Nov 29, 2023 at 11:14:12PM +0100, Michał Winiarski wrote: > > Add a simple test that checks whether the action is in

[PATCH v2 0/3] drm/managed: Add drmm_release_action

2023-12-04 Thread Michał Winiarski
devres devm_release_action) and a simple test that uses it. v1 -> v2: - Split the test changes (Maxime) - Simplify priv lifetime management (Maxime) Michał Winiarski (3): drm/managed: Add drmm_release_action drm/tests: managed: Extract device initialization into test init drm/tests: mana

[PATCH v2 1/3] drm/managed: Add drmm_release_action

2023-12-04 Thread Michał Winiarski
Similar to devres equivalent, it allows to call the "release" action directly and remove the resource from the managed resources list. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/drm_managed.c | 39 +++ include/drm/drm_managed.h | 4 +++

[PATCH v2 2/3] drm/tests: managed: Extract device initialization into test init

2023-12-04 Thread Michał Winiarski
It simplifies the process of extending the test suite with additional test cases without unnecessary duplication. Additionally, store drm_device inside priv to simplify the lifetime management by tying priv lifetime with parent struct device. Signed-off-by: Michał Winiarski --- drivers/gpu/drm

[PATCH v2 3/3] drm/tests: managed: Add a simple test for drmm_managed_release

2023-12-04 Thread Michał Winiarski
Add a simple test that checks whether the action is indeed called right away and that it is not called on the final drm_dev_put(). Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 24 1 file changed, 24 insertions(+) diff --git a/drivers

  1   2   3   >