Re: [PATCH v4 5/7] PCI/IOV: Check that VF BAR fits within the reservation

2024-10-30 Thread Michał Winiarski
On Mon, Oct 28, 2024 at 11:56:04AM -0500, Bjorn Helgaas wrote: > On Fri, Oct 25, 2024 at 11:50:36PM +0200, Michał Winiarski wrote: > > VF MMIO resource reservation, either created by system firmware and > > inherited by Linux PCI subsystem or created by the subsystem itself, >

Re: [PATCH v4 5/7] PCI/IOV: Check that VF BAR fits within the reservation

2024-10-28 Thread Michał Winiarski
On Fri, Oct 25, 2024 at 11:50:36PM +0200, Michał Winiarski wrote: > VF MMIO resource reservation, either created by system firmware and > inherited by Linux PCI subsystem or created by the subsystem itself, > should contain enough space to fit the BAR of all SR-IOV Virtual > Functi

[PATCH v4 0/7] PCI: VF resizable BAR

2024-10-25 Thread Michał Winiarski
ending the BAR (Christian) - Tidy the commit messages, use 80 line limit where necessary (Bjorn) - Add kerneldocs to exported functions (Bjorn) - Add pci_resource_to_iov() / pci_resource_from_iov() helpers (Ilpo) - Use FIELD_GET(), tidy whitespace (Ilpo) Michał Winiarski (7): PCI/IOV: Restore VF

[PATCH v4 2/7] PCI: Add a helper to identify IOV resources

2024-10-25 Thread Michał Winiarski
There are multiple places where special handling is required for IOV resources. Extract it to pci_resource_is_iov() helper and drop a few ifdefs. Signed-off-by: Michał Winiarski Reviewed-by: Ilpo Järvinen --- drivers/pci/pci.h | 19 +++ drivers/pci/setup-bus.c | 7

[PATCH v4 3/7] PCI: Add a helper to convert between standard and IOV resources

2024-10-25 Thread Michał Winiarski
There are multiple places where conversions between IOV resources and standard resources are done. Extract the logic to pci_resource_to_iov() and pci_resource_from_iov() helpers. Suggested-by: Ilpo Järvinen Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 20

[PATCH v4 7/7] drm/xe/pf: Set VF LMEM BAR size

2024-10-25 Thread Michał Winiarski
allows to fit the number of enabled VFs. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/xe/regs/xe_bars.h | 1 + drivers/gpu/drm/xe/xe_pci_sriov.c | 22 ++ 2 files changed, 23 insertions(+) diff --git a/drivers/gpu/drm/xe/regs/xe_bars.h b/drivers/gpu/drm/xe/regs

[PATCH v4 4/7] PCI: Allow IOV resources to be resized in pci_resize_resource()

2024-10-25 Thread Michał Winiarski
Similar to regular resizable BAR, VF BAR can also be resized. The structures are very similar, which means we can reuse most of the implementation. Extend the pci_resize_resource() function to accept IOV resources. See PCIe r4.0, sec 9.3.7.4. Signed-off-by: Michał Winiarski --- drivers/pci

[PATCH v4 6/7] PCI: Allow drivers to control VF BAR size

2024-10-25 Thread Michał Winiarski
() helper to get the VF BAR sizes that will allow up to num_vfs to be successfully enabled with the current underlying reservation size. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 80 + include/linux/pci.h | 6 2 files changed, 86

[PATCH v4 5/7] PCI/IOV: Check that VF BAR fits within the reservation

2024-10-25 Thread Michał Winiarski
assumption only holds in an environment where VF BAR size can't be modified. Add an additional check that verifies that VF BAR for all enabled VFs fits within the underlying reservation resource. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 8 ++-- 1 file changed, 6 insertions(

[PATCH v4 1/7] PCI/IOV: Restore VF resizable BAR state after reset

2024-10-25 Thread Michał Winiarski
Similar to regular resizable BAR, VF BAR can also be resized, e.g. by the system firmware or the PCI subsystem itself. Add the capability ID and restore it as a part of IOV state. See PCIe r4.0, sec 9.3.7.4. Signed-off-by: Michał Winiarski Reviewed-by: Ilpo Järvinen --- drivers/pci/iov.c

Re: [PATCH v3 3/5] PCI: Allow IOV resources to be resized in pci_resize_resource

2024-10-10 Thread Michał Winiarski
On Thu, Oct 10, 2024 at 02:17:11PM +0300, Ilpo Järvinen wrote: > On Thu, 10 Oct 2024, Michał Winiarski wrote: > > > Similar to regular resizable BAR, VF BAR can also be resized. > > The structures are very similar, which means we can reuse most of the > > implementa

[PATCH v3 5/5] drm/xe/pf: Extend the VF LMEM BAR

2024-10-10 Thread Michał Winiarski
: Michał Winiarski --- drivers/gpu/drm/xe/regs/xe_bars.h | 1 + drivers/gpu/drm/xe/xe_sriov_pf.c | 8 2 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/xe/regs/xe_bars.h b/drivers/gpu/drm/xe/regs/xe_bars.h index ce05b6ae832f1..880140d6ccdca 100644 --- a/drivers/gpu/drm/xe

[PATCH v3 4/5] PCI/IOV: Allow extending VF BAR within original resource boundary

2024-10-10 Thread Michał Winiarski
. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 92 - drivers/pci/pci.h | 1 + include/linux/pci.h | 3 ++ 3 files changed, 95 insertions(+), 1 deletion(-) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 591a3eae1618a

[PATCH v3 3/5] PCI: Allow IOV resources to be resized in pci_resize_resource

2024-10-10 Thread Michał Winiarski
Similar to regular resizable BAR, VF BAR can also be resized. The structures are very similar, which means we can reuse most of the implementation. See PCIe r4.0, sec 9.3.7.4. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 20 drivers/pci/pci.c | 9

[PATCH v3 2/5] PCI: Add a helper to identify IOV resources

2024-10-10 Thread Michał Winiarski
There are multiple places where special handling is required for IOV resources. Extract it to a helper and drop a few ifdefs. Signed-off-by: Michał Winiarski --- drivers/pci/pci.h | 18 ++ drivers/pci/setup-bus.c | 5 + drivers/pci/setup-res.c | 4 +--- 3 files

[PATCH v3 1/5] PCI/IOV: Restore VF resizable BAR state after reset

2024-10-10 Thread Michał Winiarski
Similar to regular resizable BAR, VF BAR can also be resized, e.g. by the system firmware, or the PCI subsystem itself. Add the capability ID and restore it as a part of IOV state. See PCIe r4.0, sec 9.3.7.4. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 29

[PATCH v3 0/5] PCI: VF resizable BAR

2024-10-10 Thread Michał Winiarski
ing VF rebar state to separate commit (Christian) - Reorganize memory decoding check (Christian) - Don't use dev_WARN (Ilpo) - Fix build without CONFIG_PCI_IOV (CI) Michał Winiarski (5): PCI/IOV: Restore VF resizable BAR state after reset PCI: Add a helper to identify IOV resources PCI

Re: [PATCH v2 2/3] PCI: Allow extending VF BAR within original resource boundary

2024-10-10 Thread Michał Winiarski
On Fri, Sep 20, 2024 at 12:07:34PM +0200, Christian König wrote: > Am 20.09.24 um 00:35 schrieb Michał Winiarski: > > VF MMIO resource reservation, either created by system firmware and > > inherited by Linux PCI subsystem or created by the subsystem itself, > > contains en

Re: [PATCH v2 1/3] PCI: Add support for VF Resizable Bar extended cap

2024-10-10 Thread Michał Winiarski
On Fri, Sep 20, 2024 at 11:57:34AM +0200, Christian König wrote: > Am 20.09.24 um 00:35 schrieb Michał Winiarski: > > Similar to regular resizable BAR, VF BAR can also be resized. > > The structures are very similar, which means we can reuse most of the > > implementatio

Re: [PATCH v2 2/3] PCI: Allow extending VF BAR within original resource boundary

2024-10-10 Thread Michał Winiarski
On Fri, Sep 20, 2024 at 02:30:00PM +0300, Ilpo Järvinen wrote: > On Fri, 20 Sep 2024, Michał Winiarski wrote: > > > VF MMIO resource reservation, either created by system firmware and > > inherited by Linux PCI subsystem or created by the subsystem itself, > > contains eno

[PATCH v2 3/3] drm/xe/pf: Extend the VF LMEM BAR

2024-09-19 Thread Michał Winiarski
: Michał Winiarski --- drivers/gpu/drm/xe/regs/xe_bars.h | 1 + drivers/gpu/drm/xe/xe_sriov_pf.c | 8 2 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/xe/regs/xe_bars.h b/drivers/gpu/drm/xe/regs/xe_bars.h index ce05b6ae832f1..880140d6ccdca 100644 --- a/drivers/gpu/drm/xe

[PATCH v2 2/3] PCI: Allow extending VF BAR within original resource boundary

2024-09-19 Thread Michał Winiarski
. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 92 - drivers/pci/pci.h | 1 + include/linux/pci.h | 3 ++ 3 files changed, 95 insertions(+), 1 deletion(-) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index e8ccd2ae0f024

[PATCH v2 1/3] PCI: Add support for VF Resizable Bar extended cap

2024-09-19 Thread Michał Winiarski
Similar to regular resizable BAR, VF BAR can also be resized. The structures are very similar, which means we can reuse most of the implementation. See PCIe r4.0, sec 9.3.7.4. Signed-off-by: Michał Winiarski --- drivers/pci/iov.c | 28 ++ drivers/pci/pci.c

[PATCH v2 0/3] PCI: VF resizable BAR

2024-09-19 Thread Michał Winiarski
Xe driver - Reduce the number of ifdefs (Christian) - Drop patch 2/2 from v1 (Christian) - Add a helper to avoid upsetting static analysis tools (Krzysztof) Michał Winiarski (3): PCI: Add support for VF Resizable Bar extended cap PCI: Allow extending VF BAR within original resource boundary

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

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

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

Re: [PATCH v3 4/4] drm/xe/FLR: Support PCIe FLR

2024-04-25 Thread Michał Winiarski
On Thu, Apr 25, 2024 at 11:47:46AM +0530, Aravind Iddamsetty wrote: > > On 25/04/24 04:59, Michał Winiarski wrote: > > On Wed, Apr 24, 2024 at 10:42:59AM +0530, Aravind Iddamsetty wrote: > >> On 24/04/24 05:19, Michał Winiarski wrote: > >>> On Mon, Apr 22,

Re: [PATCH v3 4/4] drm/xe/FLR: Support PCIe FLR

2024-04-24 Thread Michał Winiarski
On Wed, Apr 24, 2024 at 10:42:59AM +0530, Aravind Iddamsetty wrote: > > On 24/04/24 05:19, Michał Winiarski wrote: > > On Mon, Apr 22, 2024 at 12:27:56PM +0530, Aravind Iddamsetty wrote: > >> PCI subsystem provides callbacks to inform the driver about a request to > >&

Re: [PATCH v3 4/4] drm/xe/FLR: Support PCIe FLR

2024-04-23 Thread Michał Winiarski
On Mon, Apr 22, 2024 at 12:27:56PM +0530, Aravind Iddamsetty wrote: > PCI subsystem provides callbacks to inform the driver about a request to > do function level reset by user, initiated by writing to sysfs entry > /sys/bus/pci/devices/.../reset. This will allow the driver to handle FLR > without

[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] drm/tests: mm: Call drm_mm_print in drm_test_mm_debug

2024-01-16 Thread Michał Winiarski
The original intent behind the test was to sanity check whether calling the debug iterator (drm_mm_print) doesn't cause any problems. Unfortunately - this call got accidentally removed during KUnit transition. Restore it. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_mm_t

[PATCH v5 4/5] drm/tests: managed: Extract device initialization into test init

2024-01-15 Thread Michał Winiarski
It simplifies the process of extending the test suite with additional test cases without unnecessary duplication. Signed-off-by: Michał Winiarski Acked-by: Maxime Ripard --- drivers/gpu/drm/tests/drm_managed_test.c | 41 +++- 1 file changed, 26 insertions(+), 15 deletions

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

2024-01-15 Thread Michał Winiarski
Add a simple test that checks whether the action is called when drmm_managed_release is called. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 25 1 file changed, 25 insertions(+) diff --git a/drivers/gpu/drm/tests/drm_managed_test.c b

[PATCH v5 2/5] drm/tests: managed: Rename the suite name to match other DRM tests

2024-01-15 Thread Michał Winiarski
DRM tests use "_" rather than "-" as word separator. Rename the test suite to match other tests. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tests/drm_manag

[PATCH v5 3/5] drm/tests: managed: Add comments about test intent

2024-01-15 Thread Michał Winiarski
Add comments explaining the intention behind the test and certain implementation details related to device lifetime. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/tests/drm_managed_test.c

[PATCH v5 1/5] drm/managed: Add drmm_release_action

2024-01-15 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 Reviewed-by: Maxime Ripard --- drivers/gpu/drm/drm_managed.c | 39 +++ i

[PATCH v5 0/5] drm/managed: Add drmm_release_action

2024-01-15 Thread Michał Winiarski
ease test (Maxime) - Rename suite to "drm_managed" (Maxime) - Drop redundant messages from asserts (Maxime) Michał Winiarski (5): drm/managed: Add drmm_release_action drm/tests: managed: Rename the suite name to match other DRM tests drm/tests: managed: Add comments about test intent

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

2024-01-15 Thread Michał Winiarski
On Wed, Jan 10, 2024 at 04:56:27PM +0100, Maxime Ripard wrote: > On Fri, Jan 05, 2024 at 11:13:24AM +0100, Michał Winiarski wrote: > > 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(). > &g

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

2024-01-05 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 | 28 1 file changed, 28 insertions(+) diff --git a/drivers

[PATCH v4 5/6] drm/tests: managed: Extract device initialization into test init

2024-01-05 Thread Michał Winiarski
It simplifies the process of extending the test suite with additional test cases without unnecessary duplication. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 37 +++- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/drivers

[PATCH v4 4/6] drm/tests: managed: Add comments and expect fail messages

2024-01-05 Thread Michał Winiarski
Add comments explaining the intention behind the test and certain implementation details related to device lifetime. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tests

[PATCH v4 3/6] drm/tests: managed: Remove the waitqueue usage

2024-01-05 Thread Michał Winiarski
t the "action_done" state directly. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/gpu/drm/tests/drm_managed_test.c b/drivers/gpu/drm/tests/drm_managed_test.c index 659af5abb8014

[PATCH v4 2/6] drm/tests: managed: Rename the suite name to match other DRM tests

2024-01-05 Thread Michał Winiarski
DRM tests use "_" rather than "-" as word separator. Rename the test suite to match other tests. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tests/drm_manag

[PATCH v4 1/6] drm/managed: Add drmm_release_action

2024-01-05 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 Reviewed-by: Maxime Ripard --- drivers/gpu/drm/drm_managed.c | 39 +++ i

[PATCH v4 0/6] drm/managed: Add drmm_release_action

2024-01-05 Thread Michał Winiarski
n't be embedded inside test priv (Maxime) - Bring back priv lifetime management from v1 to avoid use-after-free v3 -> v4: - Split test changes into smaller patches (Maxime) - Remove the waitqueue usage in tests - Rename the test suite to match other DRM tests Michał Winiarski (6): dr

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

2024-01-05 Thread Michał Winiarski
On Fri, Dec 15, 2023 at 05:31:38PM +0100, Maxime Ripard wrote: > Hi, > > On Mon, Dec 11, 2023 at 11:09:39PM +0100, Michał Winiarski wrote: > > 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()

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

2023-12-11 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 | 29 1 file changed, 29 insertions(+) diff --git a/drivers

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

2023-12-11 Thread Michał Winiarski
It simplifies the process of extending the test suite with additional test cases without unnecessary duplication. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 51 +--- 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/drivers

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

2023-12-11 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 v3 0/3] drm/managed: Add drmm_release_action

2023-12-11 Thread Michał Winiarski
n't be embedded inside test priv (Maxime) - Bring back priv lifetime management from v1 to avoid use-after-free Michał Winiarski (3): drm/managed: Add drmm_release_action drm/tests: managed: Extract device initialization into test init drm/tests: managed: Add a simple test for drmm_mana

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

2023-12-05 Thread Michał Winiarski
On Tue, Dec 05, 2023 at 02:50:22PM +0100, Maxime Ripard wrote: > Hi, > > Thanks for the rework > > On Tue, Dec 05, 2023 at 02:22:10AM +0100, Michał Winiarski wrote: > > Add a simple test that checks whether the action is indeed called right > > away and that it

[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

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

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

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

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

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

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

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

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

[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

[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

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

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

[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

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

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

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

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

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

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

  1   2   >