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

2022-09-14 Thread Danilo Krummrich
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_plane.c b

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

[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 v2 5/6] drm/arm/hdlcd: crtc: protect device resources after removal

2022-09-13 Thread Danilo Krummrich
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 b/drivers

[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 6/6] drm/arm/hdlcd: debugfs: protect device resources after removal

2022-09-13 Thread Danilo Krummrich
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/hdlcd_drv.c

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

[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

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()". Agre

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

2022-09-12 Thread Danilo Krummrich
.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()) in order to get rid of the

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

2022-09-05 Thread Danilo Krummrich
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/hdlcd_drv.c

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

2022-09-05 Thread Danilo Krummrich
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 b/drivers

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

[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 8/8] drm/arm/malidp: drv: protect device resources after removal

2022-09-05 Thread Danilo Krummrich
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_drv.c index

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

2022-09-05 Thread Danilo Krummrich
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 b/drivers

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

2022-09-05 Thread Danilo Krummrich
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/gpu/drm/arm

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

[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 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 drm-misc-next v3 0/4] Fixes for vc4 hotplug rework

2022-08-24 Thread Danilo Krummrich
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 drm/vc4: hvs

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

2022-08-24 Thread Danilo Krummrich
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 b/drivers

[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 2/3] drm/vc4: plane: protect device resources after removal

2022-08-24 Thread Danilo Krummrich
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 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 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..4ac9f5a2d

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

2022-08-24 Thread Danilo Krummrich
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 3/4] drm/vc4: crtc: protect device resources after removal

2022-08-24 Thread Danilo Krummrich
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(+),

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

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

2022-08-19 Thread Danilo Krummrich
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 b/drivers

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

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

2022-08-19 Thread Danilo Krummrich
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/hdlcd_drv.c

[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 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 8/8] drm/arm/malidp: drv: protect device resources after removal

2022-08-19 Thread Danilo Krummrich
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_drv.c index

[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 6/8] drm/arm/malidp: plane: protect device resources after removal

2022-08-19 Thread Danilo Krummrich
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/gpu/drm/arm

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

[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

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 freed

[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..4ac9f5a2d

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

2022-08-19 Thread Danilo Krummrich
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 3/4] drm/vc4: crtc: protect device resources after removal

2022-08-19 Thread Danilo Krummrich
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 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 0/4] Fixes for vc4 hotplug rework

2022-08-19 Thread Danilo Krummrich
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/vc4_crtc.c | 41

[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 3/3] drm/vc4: crtc: protect device resources after removal

2022-08-18 Thread Danilo Krummrich
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 0/3] Fixes for vc4 hotplug rework

2022-08-18 Thread Danilo Krummrich
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 drivers/gpu/drm

[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 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-misc-next v7 2/5] drm/fb: rename FB CMA helpers to FB DMA helpers

2022-08-01 Thread Danilo Krummrich
ollowing 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 comments and documentation which relate to "FB CMA", but not "GEM CMA". This patc

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

2022-08-01 Thread Danilo Krummrich
-time 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 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/drm/arm

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

2022-08-01 Thread Danilo Krummrich
Fix `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

Re: [PATCH 00/10] drm: use idr_init_base() over idr_init() if applicable

2022-07-28 Thread Danilo Krummrich
On 7/28/22 16:44, Maxime Ripard wrote: On Thu, Jul 28, 2022 at 04:41:41PM +0200, Maxime Ripard wrote: On Fri, 1 Jul 2022 20:52:53 +0200, d...@redhat.com wrote: From: Danilo Krummrich This patch series initializes IDRs with idr_init_base(, 1) rather than idr_init() in case for the particular

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

2022-07-21 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-misc-next v6 2/5] drm/fb: rename FB CMA helpers to FB DMA helpers

2022-07-21 Thread Danilo Krummrich
ollowing 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 comments and documentation which relate to "FB CMA", but not "GEM CMA". This patc

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

2022-07-21 Thread Danilo Krummrich
-time 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 v6 1/5] drm/fb: remove unused includes of drm_fb_cma_helper.h

2022-07-21 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/drm/arm

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

2022-07-21 Thread Danilo Krummrich
- Rebased all patches on drm-misc/drm-misc-next. Changes in v5: - Rebase of v4, meanwhile some merge conflicts came up on drm-misc/drm-misc-next. Changes in v6: - Added a patch to remove unused include occurances of drm_fb_cma_helper.h in various drivers. Danilo Krummri

Re: [PATCH drm-misc-next v5 1/4] drm/fb: rename FB CMA helpers to FB DMA helpers

2022-07-21 Thread Danilo Krummrich
Hi Sam, On 7/20/22 19:23, Sam Ravnborg wrote: Hi Danilo, On Wed, Jul 20, 2022 at 05:31:25PM +0200, Danilo Krummrich wrote: Rename "FB CMA" helpers to "FB DMA" helpers - considering the hierarchy of APIs (mm/cma -> dma -> fb dma) calling them "FB DMA" s

Re: [PATCH RESEND 1/2] drm/virtio: plane: use drm managed resources

2022-07-21 Thread Danilo Krummrich
Hi Sam, On 7/20/22 17:17, Sam Ravnborg wrote: Hi Danilo, thanks for submitting this patch. On Wed, Jul 20, 2022 at 04:02:13PM +0200, Danilo Krummrich wrote: Use drm managed resource allocation (drmm_universal_plane_alloc()) in order to cleanup/simplify drm plane .destroy callback. Signed

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

2022-07-20 Thread Danilo Krummrich
-time 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

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

2022-07-20 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 dele

[PATCH drm-misc-next v5 1/4] drm/fb: rename FB CMA helpers to FB DMA helpers

2022-07-20 Thread Danilo Krummrich
ollowing 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 comments and documentation which relate to "FB CMA", but not "GEM CMA&quo

[PATCH drm-misc-next v5 0/4] drm: rename CMA helpers to DMA helpers

2022-07-20 Thread Danilo Krummrich
- Rebased all patches on drm-misc/drm-misc-next. Changes in v5: - Rebase of v4, meanwhile some merge conflicts came up on drm-misc/drm-misc-next. 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:

[PATCH RESEND 2/2] drm/virtio: kms: use drm managed resources

2022-07-20 Thread Danilo Krummrich
Allocate driver structures with drm managed resource allocators in order to cleanup/simplify the drm driver .release callback. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/virtio/virtgpu_kms.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers

[PATCH RESEND 1/2] drm/virtio: plane: use drm managed resources

2022-07-20 Thread Danilo Krummrich
Use drm managed resource allocation (drmm_universal_plane_alloc()) in order to cleanup/simplify drm plane .destroy callback. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/virtio/virtgpu_plane.c | 30 +++--- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git

[PATCH RESEND 0/2] drm/virtio: use drm managed resources

2022-07-20 Thread Danilo Krummrich
This patch series converts plain memory allocations for driver structures and planes to drm managed allocations in order to cleanup/simply the corresponding release/destroy callbacks. Danilo Krummrich (2): drm/virtio: plane: use drm managed resources drm/virtio: kms: use drm managed resources

[PATCH RESEND 10/10] drm/todo: remove task for idr_init_base()

2022-07-20 Thread Danilo Krummrich
All IDRs in the DRM core and drivers which are applicable for using idr_init_base() over idr_init() should be set up to use a proper base in order to avoid unnecessary tree walks. Signed-off-by: Danilo Krummrich Acked-by: Christian König --- Documentation/gpu/todo.rst | 12 1 file

[PATCH RESEND 07/10] drm/sis: use idr_init_base() to initialize dev_priv->object_idr

2022-07-20 Thread Danilo Krummrich
. Signed-off-by: Danilo Krummrich Acked-by: Christian König --- drivers/gpu/drm/sis/sis_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sis/sis_drv.c b/drivers/gpu/drm/sis/sis_drv.c index e35e719cf315..6173020a9bf5 100644 --- a/drivers/gpu/drm/sis/sis_drv.c

[PATCH RESEND 04/10] drm: use idr_init_base() to initialize master->lessee_idr

2022-07-20 Thread Danilo Krummrich
. Signed-off-by: Danilo Krummrich Acked-by: Christian König --- drivers/gpu/drm/drm_auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c index 63395bebaa6b..cf92a9ae8034 100644 --- a/drivers/gpu/drm/drm_auth.c +++ b/dr

[PATCH RESEND 02/10] drm/amdgpu: use idr_init_base() to initialize fpriv->bo_list_handles

2022-07-20 Thread Danilo Krummrich
. Signed-off-by: Danilo Krummrich Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index 6de63ea6687e..103927c48d05 100644

[PATCH RESEND 06/10] drm: use idr_init_base() to initialize mode_config.tile_idr

2022-07-20 Thread Danilo Krummrich
. Signed-off-by: Danilo Krummrich Acked-by: Christian König --- drivers/gpu/drm/drm_mode_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c index e2a295a4ee0b..3d1c1ade5a25 100644 --- a/dr

[PATCH RESEND 08/10] drm/v3d: use idr_init_base() to initialize v3d_priv->perfmon.idr

2022-07-20 Thread Danilo Krummrich
. Signed-off-by: Danilo Krummrich Acked-by: Christian König --- drivers/gpu/drm/v3d/v3d_perfmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/v3d/v3d_perfmon.c b/drivers/gpu/drm/v3d/v3d_perfmon.c index f6a88abccc7d..48972c49 100644 --- a/driver

[PATCH RESEND 09/10] drm/via: use idr_init_base() to initialize dev_priv->object_idr

2022-07-20 Thread Danilo Krummrich
. Signed-off-by: Danilo Krummrich Acked-by: Christian König --- drivers/gpu/drm/via/via_map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/via/via_map.c b/drivers/gpu/drm/via/via_map.c index a9f6b0c11966..c20bb20c0e09 100644 --- a/drivers/gpu/drm/via/via_map.c

[PATCH RESEND 00/10] drm: use idr_init_base() over idr_init() if applicable

2022-07-20 Thread Danilo Krummrich
This patch series initializes IDRs with idr_init_base(, 1) rather than idr_init() in case for the particular IDR no IDs < 1 are ever requested - this avoids unnecessary tree walks. Danilo Krummrich (10): drm/amdgpu: use idr_init_base() to initialize mgr->ctx_handles drm/amdgp

[PATCH RESEND 03/10] drm: use idr_init_base() to initialize master->magic_map

2022-07-20 Thread Danilo Krummrich
. Signed-off-by: Danilo Krummrich Acked-by: Christian König --- drivers/gpu/drm/drm_auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c index 6e433d465f41..63395bebaa6b 100644 --- a/drivers/gpu/drm/drm_auth.c +++ b/dr

[PATCH RESEND 05/10] drm: use idr_init_base() to initialize mode_config.object_idr

2022-07-20 Thread Danilo Krummrich
. Signed-off-by: Danilo Krummrich Acked-by: Christian König --- drivers/gpu/drm/drm_mode_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c index 37b4b9f0e468..e2a295a4ee0b 100644 --- a/dr

[PATCH RESEND 01/10] drm/amdgpu: use idr_init_base() to initialize mgr->ctx_handles

2022-07-20 Thread Danilo Krummrich
idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient"), let us set an arbitrary base other than idr_init(), which uses base 0. Since, for this IDR, no ID < 1 is ever requested, using idr_init_base(, 1) avoids unnecessary tree walks. Signed-o

Re: [PATCH 0/3] drm/vc4: use drm managed resources

2022-07-14 Thread Danilo Krummrich
Hi Maxime, On 7/13/22 11:10, Maxime Ripard wrote: Hi Danilo, On Wed, Jul 13, 2022 at 10:54:57AM +0200, Danilo Krummrich wrote: This patch series converts DRM modeset object allocations from devm_*() to drmm_*() memory allocators, or their corresponding convenience wrappers, respectively

[PATCH 2/2] drm/virtio: kms: use drm managed resources

2022-07-14 Thread Danilo Krummrich
Allocate driver structures with drm managed resource allocators in order to cleanup/simplify the drm driver .release callback. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/virtio/virtgpu_kms.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers

[PATCH 1/2] drm/virtio: plane: use drm managed resources

2022-07-14 Thread Danilo Krummrich
Use drm managed resource allocation (drmm_universal_plane_alloc()) in order to cleanup/simplify drm plane .destroy callback. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/virtio/virtgpu_plane.c | 30 +++--- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git

[PATCH 0/2] drm/virtio: use drm managed resources

2022-07-14 Thread Danilo Krummrich
This patch series converts plain memory allocations for driver structures and planes to drm managed allocations in order to cleanup/simply the corresponding release/destroy callbacks. Danilo Krummrich (2): drm/virtio: plane: use drm managed resources drm/virtio: kms: use drm managed resources

<    3   4   5   6   7   8   9   >