[PATCH drm-misc-next v7 0/5] drm: rename CMA helpers to DMA helpers

2022-08-01 Thread Danilo Krummrich
`select DRM_KMS_{CMA => DMA}_HELPER` and `select DRM_GEM_{CMA => DMA}_HELPER` in drivers/gpu/drm/logicvc/Kconfig and drivers/gpu/drm/mxsfb/Kconfig which slipped through in a rebase. - Another rebase. Danilo Krummrich (5): drm/fb: remove unused includes of drm_fb_cma_help

[PATCH drm-misc-next v7 1/5] drm/fb: remove unused includes of drm_fb_cma_helper.h

2022-08-01 Thread Danilo Krummrich
Quite a lot of drivers include the drm_fb_cma_helper.h header file without actually making use of it's provided API, hence remove those includes. Suggested-by: Sam Ravnborg Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_drv.c | 1 - drivers/gpu/dr

[PATCH drm-misc-next v7 4/5] drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr}

2022-08-01 Thread Danilo Krummrich
tested with: ``` make ARCH={x86_64,arm,arm64} allyesconfig make ARCH={x86_64,arm,arm64} drivers/gpu/drm` ``` Acked-by: Sam Ravnborg Suggested-by: Laurent Pinchart Reviewed-by: Laurent Pinchart Signed-off-by: Danilo Krummrich --- .../arm/display/komeda/komeda_framebuffer.c | 4

[PATCH drm-misc-next v7 2/5] drm/fb: rename FB CMA helpers to FB DMA helpers

2022-08-01 Thread Danilo Krummrich
e ``` Only a few more manual modifications were needed, e.g. reverting the following modifications in some DRM Kconfig files - select CMA if HAVE_DMA_CONTIGUOUS + select DMA if HAVE_DMA_CONTIGUOUS as well as manually picking the occurrences of 'CMA'/'cma' in co

[PATCH drm-misc-next v7 5/5] drm/todo: remove task to rename CMA helpers

2022-08-01 Thread Danilo Krummrich
Both, GEM and FB, CMA helpers were renamed to "GEM DMA" and "FB DMA", hence the task can be removed. Acked-by: Sam Ravnborg Acked-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Signed-off-by: Danilo Krummrich --- Documentation/gpu/todo.rst | 13 -

[PATCH] drm/virtio: remove drm_plane_cleanup() destroy hook

2022-08-03 Thread Danilo Krummrich
drmm_universal_plane_alloc() already registers drm_plane_cleanup() as managed release action via drmm_add_action_or_reset(). Hence, drm_plane_cleanup() should not be set as drm_plane_funcs.destroy hook. Fixes: 7847628862a8 ("drm/virtio: plane: use drm managed resources") Signed-off-

[PATCH drm-misc-next 0/3] Fixes for vc4 hotplug rework

2022-08-18 Thread Danilo Krummrich
/driver is unbound, but the DRM potentially isn't freed yet and userspace can still call into the driver. Danilo Krummrich (3): drm/vc4: hdmi: unlock mutex when device is unplugged drm/vc4: plane: protect device resources after removal drm/vc4: crtc: protect device resources after removal

[PATCH drm-misc-next 3/3] drm/vc4: crtc: protect device resources after removal

2022-08-18 Thread Danilo Krummrich
tions which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Fixes: 7cc4214c27cf ("drm/vc4: crtc: Switch to drmm_kzalloc") Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/vc4/vc4_crtc.c | 41 +- 1 file changed, 40 insertions

[PATCH drm-misc-next 1/3] drm/vc4: hdmi: unlock mutex when device is unplugged

2022-08-18 Thread Danilo Krummrich
resources after removal") Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/vc4/vc4_hdmi.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 84e5a91c2ea7..4d3ff51ad2a8 100644 --- a/drivers/gpu/drm/

[PATCH drm-misc-next v2 0/4] Fixes for vc4 hotplug rework

2022-08-19 Thread Danilo Krummrich
ss in vc4_hvs.c Danilo Krummrich (4): drm/vc4: hdmi: unlock mutex when device is unplugged drm/vc4: plane: protect device resources after removal drm/vc4: crtc: protect device resources after removal drm/vc4: hvs: protect drm_print_regset32() drivers/gpu/drm/vc4/v

[PATCH drm-misc-next v2 1/4] drm/vc4: hdmi: unlock mutex when device is unplugged

2022-08-19 Thread Danilo Krummrich
resources after removal") Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/vc4/vc4_hdmi.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 84e5a91c2ea7..4d3ff51ad2a8 100644 --- a/drivers/gpu/drm/

[PATCH drm-misc-next v2 3/4] drm/vc4: crtc: protect device resources after removal

2022-08-19 Thread Danilo Krummrich
tions which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Fixes: 7cc4214c27cf ("drm/vc4: crtc: Switch to drmm_kzalloc") Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/vc4/vc4_crtc.c | 41 +- 1 file changed, 40 insertions

[PATCH drm-misc-next v2 2/4] drm/vc4: plane: protect device resources after removal

2022-08-19 Thread Danilo Krummrich
tions which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Fixes: 9872c7a31921 ("drm/vc4: plane: Switch to drmm_universal_plane_alloc()") Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/vc4/vc4_plane.c | 20 1 file changed, 20 insertions(+

[PATCH drm-misc-next v2 4/4] drm/vc4: hvs: protect drm_print_regset32()

2022-08-19 Thread Danilo Krummrich
("drm/vc4: hvs: Protect device resources after removal") Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/vc4/vc4_hvs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c index 9e823e0de197..4ac9f5a2d5f9 10

Re: [PATCH drm-misc-next 2/3] drm/vc4: plane: protect device resources after removal

2022-08-19 Thread Danilo Krummrich
Hi Maxime, On 8/19/22 09:26, Maxime Ripard wrote: Hi, On Fri, Aug 19, 2022 at 02:29:04AM +0200, Danilo Krummrich wrote: (Hardware) resources which are bound to the driver and device lifecycle must not be accessed after the device and driver are unbound. However, the DRM device isn't fre

[PATCH drm-misc-next 0/8] drm/arm/malidp: use drm managed resources

2022-08-19 Thread Danilo Krummrich
Hi, This patch series converts the driver to use drm managed resources to prevent potential use-after-free issues on driver unbind/rebind and to get rid of the usage of deprecated APIs. Danilo Krummrich (8): drm/arm/malidp: use drmm_* to allocate driver structures drm/arm/malidp: replace drm

[PATCH drm-misc-next 2/8] drm/arm/malidp: replace drm->dev_private with drm_to_malidp()

2022-08-19 Thread Danilo Krummrich
Using drm_device->dev_private is deprecated. Since we've switched to devm_drm_dev_alloc(), struct drm_device is now embedded in struct malidp_drm, hence we can use container_of() to get the struct drm_device instance instead. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/malid

[PATCH drm-misc-next 1/8] drm/arm/malidp: use drmm_* to allocate driver structures

2022-08-19 Thread Danilo Krummrich
Use drm managed resources to allocate driver structures and get rid of the deprecated drm_dev_alloc() call and replace it with devm_drm_dev_alloc(). This also serves as preparation to get rid of drm_device->dev_private and to fix use-after-free issues on driver unload. Signed-off-by: Dan

[PATCH drm-misc-next 3/8] drm/arm/malidp: crtc: use drmm_crtc_init_with_planes()

2022-08-19 Thread Danilo Krummrich
Use drmm_crtc_init_with_planes() instead of drm_crtc_init_with_planes() to get rid of the explicit destroy hook in struct drm_plane_funcs. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/malidp_crtc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu

[PATCH drm-misc-next 6/8] drm/arm/malidp: plane: protect device resources after removal

2022-08-19 Thread Danilo Krummrich
e critical sections which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/malidp_planes.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/g

[PATCH drm-misc-next 5/8] drm/arm/malidp: use drm_dev_unplug()

2022-08-19 Thread Danilo Krummrich
patches. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/malidp_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 678c5b0d8014..aedd30f5f451 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b

[PATCH drm-misc-next 8/8] drm/arm/malidp: drv: protect device resources after removal

2022-08-19 Thread Danilo Krummrich
e critical sections which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/malidp_drv.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_d

[PATCH drm-misc-next 0/7] drm/arm/hdlcd: use drm managed resources

2022-08-19 Thread Danilo Krummrich
Hi, This patch series converts the driver to use drm managed resources to prevent potential use-after-free issues on driver unbind/rebind and to get rid of the usage of deprecated APIs. Danilo Krummrich (7): drm/arm/hdlcd: use drmm_* to allocate driver structures drm/arm/hdlcd: replace drm

[PATCH drm-misc-next 3/7] drm/arm/hdlcd: crtc: use drmm_crtc_init_with_planes()

2022-08-19 Thread Danilo Krummrich
Use drmm_crtc_init_with_planes() instead of drm_crtc_init_with_planes() to get rid of the explicit drm_crtc_cleanup() call. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_crtc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/arm

[PATCH drm-misc-next 7/7] drm/arm/hdlcd: debugfs: protect device resources after removal

2022-08-19 Thread Danilo Krummrich
e critical sections which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_drv.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/h

[PATCH drm-misc-next 2/7] drm/arm/hdlcd: replace drm->dev_private with drm_to_hdlcd_priv()

2022-08-19 Thread Danilo Krummrich
Using drm_device->dev_private is deprecated. Since we've switched to devm_drm_dev_alloc(), struct drm_device is now embedded in struct hdlcd_drm_private, hence we can use container_of() to get the struct drm_device instance instead. Signed-off-by: Danilo Krummrich --- drivers/gpu

[PATCH drm-misc-next 1/7] drm/arm/hdlcd: use drmm_* to allocate driver structures

2022-08-19 Thread Danilo Krummrich
Use drm managed resources to allocate driver structures and get rid of the deprecated drm_dev_alloc() call and replace it with devm_drm_dev_alloc(). This also serves as preparation to get rid of drm_device->dev_private and to fix use-after-free issues on driver unload. Signed-off-by: Dan

[PATCH drm-misc-next 4/7] drm/arm/hdlcd: plane: use drm managed resources

2022-08-19 Thread Danilo Krummrich
Use drm managed resource allocation (drmm_universal_plane_alloc()) in order to get rid of the explicit destroy hook in struct drm_plane_funcs. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_crtc.c | 20 +++- 1 file changed, 7 insertions(+), 13 deletions(-) diff

[PATCH drm-misc-next 5/7] drm/arm/hdlcd: use drm_dev_unplug()

2022-08-19 Thread Danilo Krummrich
patches. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index 120c87934a91..e41def6d47cc 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b

[PATCH drm-misc-next 6/7] drm/arm/hdlcd: crtc: protect device resources after removal

2022-08-19 Thread Danilo Krummrich
e critical sections which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_crtc.c | 49 ++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c

Re: [PATCH drm-misc-next v2 2/4] drm/vc4: plane: protect device resources after removal

2022-08-24 Thread Danilo Krummrich
Hi Maxime, On 8/24/22 17:48, Maxime Ripard wrote: @@ -1252,12 +1261,17 @@ void vc4_plane_async_set_fb(struct drm_plane *plane, struct drm_framebuffer *fb) WARN_ON_ONCE(plane->state->crtc_x < 0 || plane->state->crtc_y < 0); addr = bo->dma_addr + fb->offsets[0]; + if (!drm_dev_

[PATCH drm-misc-next v3 3/4] drm/vc4: crtc: protect device resources after removal

2022-08-24 Thread Danilo Krummrich
tions which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Fixes: 7cc4214c27cf ("drm/vc4: crtc: Switch to drmm_kzalloc") Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/vc4/vc4_crtc.c | 41 +- 1 file changed, 40 insertions

[PATCH drm-misc-next v3 2/4] drm/vc4: plane: protect device resources after removal

2022-08-24 Thread Danilo Krummrich
tions which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Fixes: 9872c7a31921 ("drm/vc4: plane: Switch to drmm_universal_plane_alloc()") Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/vc4/vc4_plane.c | 20 1 file changed, 20 insertions(+

[PATCH drm-misc-next v3 4/4] drm/vc4: hvs: protect drm_print_regset32()

2022-08-24 Thread Danilo Krummrich
("drm/vc4: hvs: Protect device resources after removal") Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/vc4/vc4_hvs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c index 9e823e0de197..4ac9f5a2d5f9 10

[PATCH drm-misc-next v3 1/4] drm/vc4: hdmi: unlock mutex when device is unplugged

2022-08-24 Thread Danilo Krummrich
resources after removal") Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/vc4/vc4_hdmi.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 84e5a91c2ea7..4d3ff51ad2a8 100644 --- a/drivers/gpu/drm/

[PATCH drm-misc-next 2/3] drm/vc4: plane: protect device resources after removal

2022-08-24 Thread Danilo Krummrich
tions which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Fixes: 9872c7a31921 ("drm/vc4: plane: Switch to drmm_universal_plane_alloc()") Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/vc4/vc4_drv.h | 1 + drivers/gpu/drm/vc4/vc4_plane.c | 25 +

[PATCH drm-misc-next 4/8] drm/arm/malidp: plane: use drm managed resources

2022-08-24 Thread Danilo Krummrich
Use drm managed resource allocation (drmm_universal_plane_alloc()) in order to get rid of the explicit destroy hook in struct drm_plane_funcs. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/malidp_planes.c | 28 +++- 1 file changed, 7 insertions(+), 21 deletions

[PATCH drm-misc-next 7/8] drm/arm/malidp: crtc: protect device resources after removal

2022-08-24 Thread Danilo Krummrich
e critical sections which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/malidp_crtc.c | 41 +-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/arm/malidp_crtc.c

[PATCH drm-misc-next v3 0/4] Fixes for vc4 hotplug rework

2022-08-24 Thread Danilo Krummrich
ss in vc4_hvs.c Changes in v3: - vc4_plane: Actually protect entire functions to increase readability (Maxime) Danilo Krummrich (4): drm/vc4: hdmi: unlock mutex when device is unplugged drm/vc4: plane: protect device resources after removal drm/vc4: crtc: protect device resources after removal

[PATCH 0/3] drm: rename CMA helpers to DMA helpers

2022-07-05 Thread Danilo Krummrich
CMA helpers and implies that people seem to be confused about the naming. The patches are compile-time tested building a x86_64 kernel with `make allyesconfig && make drivers/gpu/drm`. Danilo Krummrich (3): drm/fb: rename FB CMA helpers to FB DMA helpers drm/gem: rename GEM CMA he

[PATCH 3/3] drm/todo: remove task to rename CMA helpers

2022-07-05 Thread Danilo Krummrich
Both, GEM and FB, CMA helpers were renamed to "GEM DMA" and "FB DMA", hence the task can be removed. Signed-off-by: Danilo Krummrich --- Documentation/gpu/todo.rst | 13 - 1 file changed, 13 deletions(-) diff --git a/Documentation/gpu/todo.rst b/Documentatio

[PATCH 1/3] drm/fb: rename FB CMA helpers to FB DMA helpers

2022-07-05 Thread Danilo Krummrich
e ``` Only a few more manual modifications were needed, e.g. reverting the following modifications in some DRM Kconfig files - select CMA if HAVE_DMA_CONTIGUOUS + select DMA if HAVE_DMA_CONTIGUOUS as well as manually picking the occurrences of 'CMA'/'cma' in

[PATCH v2 0/4] drm: rename CMA helpers to DMA helpers

2022-07-06 Thread Danilo Krummrich
us) - Added a patch to rename struct drm_gem_dma_object.{paddr => dma_addr} Danilo Krummrich (4): drm/fb: rename FB CMA helpers to FB DMA helpers drm/gem: rename GEM CMA helpers to GEM DMA helpers drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} drm/todo: remove task to rena

[PATCH v2 3/4] drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr}

2022-07-06 Thread Danilo Krummrich
r' is a very commonly used term and symbol name a simple regex does not do the trick. Instead, users of the struct were fixed up iteratively with a trial and error approach building with `make allyesconfig && make drivers/gpu/drm`. Signed-off-by: Danilo Krummrich --- .../

[PATCH v2 4/4] drm/todo: remove task to rename CMA helpers

2022-07-06 Thread Danilo Krummrich
Both, GEM and FB, CMA helpers were renamed to "GEM DMA" and "FB DMA", hence the task can be removed. Acked-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Signed-off-by: Danilo Krummrich --- Documentation/gpu/todo.rst | 13 - 1 file changed, 13 deleti

[PATCH v2 1/4] drm/fb: rename FB CMA helpers to FB DMA helpers

2022-07-06 Thread Danilo Krummrich
e ``` Only a few more manual modifications were needed, e.g. reverting the following modifications in some DRM Kconfig files - select CMA if HAVE_DMA_CONTIGUOUS + select DMA if HAVE_DMA_CONTIGUOUS as well as manually picking the occurrences of 'CMA'/'c

Re: [PATCH v2 3/4] drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr}

2022-07-07 Thread Danilo Krummrich
Hi Laurent, On 7/6/22 19:28, Laurent Pinchart wrote: Hi Danilo, Thank you for the patch. On Wed, Jul 06, 2022 at 02:43:51PM +0200, Danilo Krummrich wrote: The field paddr of struct drm_gem_dma_object holds a DMA address, which might actually be a physical address. However, depending on the

[PATCH v3 0/4] drm: rename CMA helpers to DMA helpers

2022-07-07 Thread Danilo Krummrich
us) - Added a patch to rename struct drm_gem_dma_object.{paddr => dma_addr} Changes in v3: - Use a ccoccinelle script for "drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr}" for fixing up missing drivers and compile-test on x86_64, arm and arm64. Danilo Krummr

[PATCH v3 1/4] drm/fb: rename FB CMA helpers to FB DMA helpers

2022-07-07 Thread Danilo Krummrich
e ``` Only a few more manual modifications were needed, e.g. reverting the following modifications in some DRM Kconfig files - select CMA if HAVE_DMA_CONTIGUOUS + select DMA if HAVE_DMA_CONTIGUOUS as well as manually picking the occurrences of 'CMA'/'c

[PATCH v3 4/4] drm/todo: remove task to rename CMA helpers

2022-07-07 Thread Danilo Krummrich
Both, GEM and FB, CMA helpers were renamed to "GEM DMA" and "FB DMA", hence the task can be removed. Acked-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart Signed-off-by: Danilo Krummrich --- Documentation/gpu/todo.rst | 13 - 1 file changed, 13 deleti

[PATCH v3 3/4] drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr}

2022-07-07 Thread Danilo Krummrich
tested with: ``` make ARCH={x86_64,arm,arm64} allyesconfig make ARCH={x86_64,arm,arm64} drivers/gpu/drm` ``` Reviewed-by: Laurent Pinchart Signed-off-by: Danilo Krummrich --- .../arm/display/komeda/komeda_framebuffer.c | 4 +-- drivers/gpu/drm/arm/malidp_mw.c | 2

Re: [PATCH v3 0/4] drm: rename CMA helpers to DMA helpers

2022-07-11 Thread Danilo Krummrich
On 7/7/22 19:39, Danilo Krummrich wrote: This patch series renames all CMA helpers to DMA helpers - considering the hierarchy of APIs (mm/cma -> dma -> gem/fb dma helpers) calling them DMA helpers seems to be more applicable. Additionally, commit e57924d4ae80 ("drm/doc: Task to

[PATCH RESEND drm-misc-next 1/8] drm/arm/malidp: use drmm_* to allocate driver structures

2022-09-05 Thread Danilo Krummrich
Use drm managed resources to allocate driver structures and get rid of the deprecated drm_dev_alloc() call and replace it with devm_drm_dev_alloc(). This also serves as preparation to get rid of drm_device->dev_private and to fix use-after-free issues on driver unload. Signed-off-by: Dan

[PATCH RESEND drm-misc-next 0/8] drm/arm/malidp: use drm managed resources

2022-09-05 Thread Danilo Krummrich
Hi, This patch series converts the driver to use drm managed resources to prevent potential use-after-free issues on driver unbind/rebind and to get rid of the usage of deprecated APIs. Danilo Krummrich (8): drm/arm/malidp: use drmm_* to allocate driver structures drm/arm/malidp: replace drm

[PATCH RESEND drm-misc-next 2/8] drm/arm/malidp: replace drm->dev_private with drm_to_malidp()

2022-09-05 Thread Danilo Krummrich
Using drm_device->dev_private is deprecated. Since we've switched to devm_drm_dev_alloc(), struct drm_device is now embedded in struct malidp_drm, hence we can use container_of() to get the struct drm_device instance instead. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/malid

[PATCH RESEND drm-misc-next 3/8] drm/arm/malidp: crtc: use drmm_crtc_init_with_planes()

2022-09-05 Thread Danilo Krummrich
Use drmm_crtc_init_with_planes() instead of drm_crtc_init_with_planes() to get rid of the explicit destroy hook in struct drm_plane_funcs. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/malidp_crtc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu

[PATCH RESEND drm-misc-next 4/8] drm/arm/malidp: plane: use drm managed resources

2022-09-05 Thread Danilo Krummrich
Use drm managed resource allocation (drmm_universal_plane_alloc()) in order to get rid of the explicit destroy hook in struct drm_plane_funcs. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/malidp_planes.c | 28 +++- 1 file changed, 7 insertions(+), 21 deletions

[PATCH RESEND drm-misc-next 5/8] drm/arm/malidp: use drm_dev_unplug()

2022-09-05 Thread Danilo Krummrich
patches. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/malidp_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 678c5b0d8014..aedd30f5f451 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b

[PATCH RESEND drm-misc-next 6/8] drm/arm/malidp: plane: protect device resources after removal

2022-09-05 Thread Danilo Krummrich
e critical sections which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/malidp_planes.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/g

[PATCH RESEND drm-misc-next 7/8] drm/arm/malidp: crtc: protect device resources after removal

2022-09-05 Thread Danilo Krummrich
e critical sections which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/malidp_crtc.c | 41 +-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/arm/malidp_crtc.c

[PATCH RESEND drm-misc-next 8/8] drm/arm/malidp: drv: protect device resources after removal

2022-09-05 Thread Danilo Krummrich
e critical sections which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/malidp_drv.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_d

[PATCH RESEND drm-misc-next 0/7] drm/arm/hdlcd: use drm managed resources

2022-09-05 Thread Danilo Krummrich
Hi, This patch series converts the driver to use drm managed resources to prevent potential use-after-free issues on driver unbind/rebind and to get rid of the usage of deprecated APIs. Danilo Krummrich (7): drm/arm/hdlcd: use drmm_* to allocate driver structures drm/arm/hdlcd: replace drm

[PATCH RESEND drm-misc-next 2/7] drm/arm/hdlcd: replace drm->dev_private with drm_to_hdlcd_priv()

2022-09-05 Thread Danilo Krummrich
Using drm_device->dev_private is deprecated. Since we've switched to devm_drm_dev_alloc(), struct drm_device is now embedded in struct hdlcd_drm_private, hence we can use container_of() to get the struct drm_device instance instead. Signed-off-by: Danilo Krummrich --- drivers/gpu

[PATCH RESEND drm-misc-next 3/7] drm/arm/hdlcd: crtc: use drmm_crtc_init_with_planes()

2022-09-05 Thread Danilo Krummrich
Use drmm_crtc_init_with_planes() instead of drm_crtc_init_with_planes() to get rid of the explicit drm_crtc_cleanup() call. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_crtc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/arm

[PATCH RESEND drm-misc-next 1/7] drm/arm/hdlcd: use drmm_* to allocate driver structures

2022-09-05 Thread Danilo Krummrich
Use drm managed resources to allocate driver structures and get rid of the deprecated drm_dev_alloc() call and replace it with devm_drm_dev_alloc(). This also serves as preparation to get rid of drm_device->dev_private and to fix use-after-free issues on driver unload. Signed-off-by: Dan

[PATCH RESEND drm-misc-next 5/7] drm/arm/hdlcd: use drm_dev_unplug()

2022-09-05 Thread Danilo Krummrich
patches. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index 120c87934a91..e41def6d47cc 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b

[PATCH RESEND drm-misc-next 4/7] drm/arm/hdlcd: plane: use drm managed resources

2022-09-05 Thread Danilo Krummrich
Use drm managed resource allocation (drmm_universal_plane_alloc()) in order to get rid of the explicit destroy hook in struct drm_plane_funcs. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_crtc.c | 20 +++- 1 file changed, 7 insertions(+), 13 deletions(-) diff

[PATCH RESEND drm-misc-next 6/7] drm/arm/hdlcd: crtc: protect device resources after removal

2022-09-05 Thread Danilo Krummrich
e critical sections which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_crtc.c | 49 ++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c

[PATCH RESEND drm-misc-next 7/7] drm/arm/hdlcd: debugfs: protect device resources after removal

2022-09-05 Thread Danilo Krummrich
e critical sections which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_drv.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/h

Re: [PATCH RESEND drm-misc-next 4/7] drm/arm/hdlcd: plane: use drm managed resources

2022-09-12 Thread Danilo Krummrich
[drm] It looks like the .destroy hook is still required or I'm missing some other required series where the WARN has been removed? Best regards, Liviu On Mon, Sep 05, 2022 at 05:27:16PM +0200, Danilo Krummrich wrote: Use drm managed resource allocation (drmm_universal_plane_alloc(

Re: [PATCH RESEND drm-misc-next 4/7] drm/arm/hdlcd: plane: use drm managed resources

2022-09-13 Thread Danilo Krummrich
On 9/13/22 10:58, Liviu Dudau wrote: On Mon, Sep 12, 2022 at 09:50:26PM +0200, Danilo Krummrich wrote: Hi Liviu, Hi Danilo, Thanks for having a look! This is not about this patch, it's about patch 3/7 "drm/arm/hdlcd: crtc: use drmm_crtc_init_with_planes()". Agree! Howev

[PATCH drm-misc-next v2 0/6] drm/arm/hdlcd: use drm managed resources

2022-09-13 Thread Danilo Krummrich
Hi, This patch series converts the driver to use drm managed resources to prevent potential use-after-free issues on driver unbind/rebind and to get rid of the usage of deprecated APIs. Changes in v2: - drop patch "drm/arm/hdlcd: crtc: use drmm_crtc_init_with_planes()" Danilo Kr

[PATCH drm-misc-next v2 2/6] drm/arm/hdlcd: replace drm->dev_private with drm_to_hdlcd_priv()

2022-09-13 Thread Danilo Krummrich
Using drm_device->dev_private is deprecated. Since we've switched to devm_drm_dev_alloc(), struct drm_device is now embedded in struct hdlcd_drm_private, hence we can use container_of() to get the struct drm_device instance instead. Signed-off-by: Danilo Krummrich --- drivers/gpu

[PATCH drm-misc-next v2 4/6] drm/arm/hdlcd: use drm_dev_unplug()

2022-09-13 Thread Danilo Krummrich
patches. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index 120c87934a91..e41def6d47cc 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b

[PATCH drm-misc-next v2 3/6] drm/arm/hdlcd: plane: use drm managed resources

2022-09-13 Thread Danilo Krummrich
Use drm managed resource allocation (drmm_universal_plane_alloc()) in order to get rid of the explicit destroy hook in struct drm_plane_funcs. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_crtc.c | 20 +++- 1 file changed, 7 insertions(+), 13 deletions(-) diff

[PATCH drm-misc-next v2 6/6] drm/arm/hdlcd: debugfs: protect device resources after removal

2022-09-13 Thread Danilo Krummrich
e critical sections which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_drv.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/h

[PATCH drm-misc-next v2 1/6] drm/arm/hdlcd: use drmm_* to allocate driver structures

2022-09-13 Thread Danilo Krummrich
Use drm managed resources to allocate driver structures and get rid of the deprecated drm_dev_alloc() call and replace it with devm_drm_dev_alloc(). This also serves as preparation to get rid of drm_device->dev_private and to fix use-after-free issues on driver unload. Signed-off-by: Dan

[PATCH drm-misc-next v2 5/6] drm/arm/hdlcd: crtc: protect device resources after removal

2022-09-13 Thread Danilo Krummrich
e critical sections which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_crtc.c | 52 ++-- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c

[PATCH drm-misc-next 0/8] drm/fsl-dcu: use drm managed resources

2022-09-14 Thread Danilo Krummrich
Hi, This patch series converts the driver to use drm managed resources to prevent potential use-after-free issues on driver unbind/rebind and to get rid of the usage of deprecated APIs. Danilo Krummrich (8): drm/fsl-dcu: use drmm_* to allocate driver structures drm/fsl-dcu: replace drm

[PATCH drm-misc-next 2/8] drm/fsl-dcu: replace drm->dev_private with drm_to_fsl_dcu_drm_dev()

2022-09-14 Thread Danilo Krummrich
Using drm_device->dev_private is deprecated. Since we've switched to devm_drm_dev_alloc(), struct drm_device is now embedded in struct malidp_drm, hence we can use container_of() to get the struct drm_device instance instead. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm

[PATCH drm-misc-next 1/8] drm/fsl-dcu: use drmm_* to allocate driver structures

2022-09-14 Thread Danilo Krummrich
Use drm managed resources to allocate driver structures and get rid of the deprecated drm_dev_alloc() call and replace it with devm_drm_dev_alloc(). This also serves as preparation to get rid of drm_device->dev_private and to fix use-after-free issues on driver unload. Signed-off-by: Dan

[PATCH drm-misc-next 5/8] drm/fsl-dcu: use drm_dev_unplug()

2022-09-14 Thread Danilo Krummrich
patches. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c index 4139f674c5de..3ac57516c3fe 100644 --- a/drivers/gpu

[PATCH drm-misc-next 6/8] drm/fsl-dcu: plane: protect device resources after removal

2022-09-14 Thread Danilo Krummrich
e critical sections which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_

[PATCH drm-misc-next 3/8] drm/fsl-dcu: crtc: use drmm_crtc_init_with_planes()

2022-09-14 Thread Danilo Krummrich
Use drmm_crtc_init_with_planes() instead of drm_crtc_init_with_planes() to get rid of the explicit destroy hook in struct drm_plane_funcs. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a

[PATCH drm-misc-next 4/8] drm/fsl-dcu: plane: use drm managed resources

2022-09-14 Thread Danilo Krummrich
Use drm managed resource allocation (drmm_universal_plane_alloc()) in order to get rid of the explicit destroy hook in struct drm_plane_funcs. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c | 4 ++-- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 25

[PATCH drm-misc-next 8/8] drm/fsl-dcu: remove trailing return statements

2022-09-14 Thread Danilo Krummrich
Remove the trailing return statements at the end of void functions. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c | 1 - drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c

[PATCH drm-misc-next 7/8] drm/fsl-dcu: crtc: protect device resources after removal

2022-09-14 Thread Danilo Krummrich
e critical sections which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c | 37 ++ 1 file changed, 37 insertions(+) diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c b/drive

Re: [PATCH RESEND drm-misc-next 4/7] drm/arm/hdlcd: plane: use drm managed resources

2022-09-30 Thread Danilo Krummrich
Hi Liviu, On 9/30/22 18:56, Liviu Dudau wrote: On Wed, Sep 14, 2022 at 12:03:58AM +0200, Danilo Krummrich wrote: Do you mind trying again with my v2 (although v2 shouldn't make a difference for this issue) and provide the back-trace when it hangs? Hi Danilo, I've finally got a r

[PATCH drm-misc-next v3 0/7] drm/arm/hdlcd: use drm managed resources

2022-09-30 Thread Danilo Krummrich
3: - Fix alternate return paths in srcu read-side critical sections causing a stall when unregistering the driver. - Fix potential null pointer dereference in hdlcd_crtc_cleanup() introduced dropping the patch in v2. - Add a patch to remove explicit calls to drm_mode_config_cleanup(

[PATCH drm-misc-next v3 1/7] drm/arm/hdlcd: use drmm_* to allocate driver structures

2022-09-30 Thread Danilo Krummrich
Use drm managed resources to allocate driver structures and get rid of the deprecated drm_dev_alloc() call and replace it with devm_drm_dev_alloc(). This also serves as preparation to get rid of drm_device->dev_private and to fix use-after-free issues on driver unload. Signed-off-by: Dan

[PATCH drm-misc-next v3 2/7] drm/arm/hdlcd: replace drm->dev_private with drm_to_hdlcd_priv()

2022-09-30 Thread Danilo Krummrich
Using drm_device->dev_private is deprecated. Since we've switched to devm_drm_dev_alloc(), struct drm_device is now embedded in struct hdlcd_drm_private, hence we can use container_of() to get the struct drm_device instance instead. Signed-off-by: Danilo Krummrich --- drivers/gpu

[PATCH drm-misc-next v3 3/7] drm/arm/hdlcd: plane: use drm managed resources

2022-09-30 Thread Danilo Krummrich
Use drm managed resource allocation (drmm_universal_plane_alloc()) in order to get rid of the explicit destroy hook in struct drm_plane_funcs. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_crtc.c | 20 +++- 1 file changed, 7 insertions(+), 13 deletions(-) diff

[PATCH drm-misc-next v3 5/7] drm/arm/hdlcd: crtc: protect device resources after removal

2022-09-30 Thread Danilo Krummrich
e critical sections which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_crtc.c | 60 +--- 1 file changed, 55 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c

[PATCH drm-misc-next v3 4/7] drm/arm/hdlcd: use drm_dev_unplug()

2022-09-30 Thread Danilo Krummrich
patches. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index 120c87934a91..e41def6d47cc 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b

[PATCH drm-misc-next v3 6/7] drm/arm/hdlcd: debugfs: protect device resources after removal

2022-09-30 Thread Danilo Krummrich
e critical sections which are accessing those resources with drm_dev_enter() and drm_dev_exit(). Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_drv.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/h

[PATCH drm-misc-next v3 7/7] drm/arm/hdlcd: remove calls to drm_mode_config_cleanup()

2022-09-30 Thread Danilo Krummrich
. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/arm/hdlcd_drv.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index 020c7d0c70a5..e242b6223d77 100644 --- a/drivers/gpu/drm/arm

[PATCH drm-misc-next v2 0/9] drm/fsl-dcu: use drm managed resources

2022-10-01 Thread Danilo Krummrich
alternate return paths within the read-side critical sections, hence fix them. - Add a patch to remove explicit calls to drm_mode_config_cleanup() and switch to drmm_mode_config_init() explicitly. Danilo Krummrich (9): drm/fsl-dcu: use drmm_* to allocate driver structures drm/fsl-dcu

[PATCH drm-misc-next v2 1/9] drm/fsl-dcu: use drmm_* to allocate driver structures

2022-10-01 Thread Danilo Krummrich
Use drm managed resources to allocate driver structures and get rid of the deprecated drm_dev_alloc() call and replace it with devm_drm_dev_alloc(). This also serves as preparation to get rid of drm_device->dev_private and to fix use-after-free issues on driver unload. Signed-off-by: Dan

[PATCH drm-misc-next v2 2/9] drm/fsl-dcu: replace drm->dev_private with drm_to_fsl_dcu_drm_dev()

2022-10-01 Thread Danilo Krummrich
Using drm_device->dev_private is deprecated. Since we've switched to devm_drm_dev_alloc(), struct drm_device is now embedded in struct malidp_drm, hence we can use container_of() to get the struct drm_device instance instead. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm

[PATCH drm-misc-next v2 3/9] drm/fsl-dcu: crtc: use drmm_crtc_init_with_planes()

2022-10-01 Thread Danilo Krummrich
Use drmm_crtc_init_with_planes() instead of drm_crtc_init_with_planes() to get rid of the explicit destroy hook in struct drm_plane_funcs. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a

  1   2   3   4   5   6   7   8   9   10   >