Several fixes for v3d about memory leak, runtime PM, and locking, and a
Kconfig improvement for ethosu. -----BEGIN PGP SIGNATURE----- iJUEABMJAB0WIQTkHFbLp4ejekA/qfgnX84Zoj2+dgUCaddf9AAKCRAnX84Zoj2+ dvihAYCtQsSwH6VCpDf9bknrlqXpiUu+JlU2tSrK5plyTioCfFmdE1EhZmy7RJRo EAFpb4ABf16BBat7a3SJ/8KYeNtoYggURn4JvNKKPMF1lSYa9PNmKQsJsfMGmHt5 IIKRgFYQXw== =/nuD -----END PGP SIGNATURE----- Merge tag 'drm-misc-fixes-2026-04-09' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes Several fixes for v3d about memory leak, runtime PM, and locking, and a Kconfig improvement for ethosu. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maxime Ripard <mripard@redhat.com> Link: https://patch.msgid.link/20260409-omniscient-tomato-coucal-edbadc@penduickmaster
commit
93be8c74b6
|
|
@ -4,6 +4,7 @@ config DRM_ACCEL_ARM_ETHOSU
|
|||
tristate "Arm Ethos-U65/U85 NPU"
|
||||
depends on HAS_IOMEM
|
||||
depends on DRM_ACCEL
|
||||
depends on ARM || ARM64 || COMPILE_TEST
|
||||
select DRM_GEM_DMA_HELPER
|
||||
select DRM_SCHED
|
||||
select GENERIC_ALLOCATOR
|
||||
|
|
|
|||
|
|
@ -738,12 +738,15 @@ static int vc4_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_struct
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
mutex_lock(&bo->madv_lock);
|
||||
if (bo->madv != VC4_MADV_WILLNEED) {
|
||||
DRM_DEBUG("mmapping of %s BO not allowed\n",
|
||||
bo->madv == VC4_MADV_DONTNEED ?
|
||||
"purgeable" : "purged");
|
||||
mutex_unlock(&bo->madv_lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
mutex_unlock(&bo->madv_lock);
|
||||
|
||||
return drm_gem_dma_mmap(&bo->base, vma);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ vc4_free_hang_state(struct drm_device *dev, struct vc4_hang_state *state)
|
|||
for (i = 0; i < state->user_state.bo_count; i++)
|
||||
drm_gem_object_put(state->bo[i]);
|
||||
|
||||
kfree(state->bo);
|
||||
kfree(state);
|
||||
}
|
||||
|
||||
|
|
@ -170,10 +171,8 @@ vc4_save_hang_state(struct drm_device *dev)
|
|||
spin_lock_irqsave(&vc4->job_lock, irqflags);
|
||||
exec[0] = vc4_first_bin_job(vc4);
|
||||
exec[1] = vc4_first_render_job(vc4);
|
||||
if (!exec[0] && !exec[1]) {
|
||||
spin_unlock_irqrestore(&vc4->job_lock, irqflags);
|
||||
return;
|
||||
}
|
||||
if (!exec[0] && !exec[1])
|
||||
goto err_free_state;
|
||||
|
||||
/* Get the bos from both binner and renderer into hang state. */
|
||||
state->bo_count = 0;
|
||||
|
|
@ -190,10 +189,8 @@ vc4_save_hang_state(struct drm_device *dev)
|
|||
kernel_state->bo = kzalloc_objs(*kernel_state->bo, state->bo_count,
|
||||
GFP_ATOMIC);
|
||||
|
||||
if (!kernel_state->bo) {
|
||||
spin_unlock_irqrestore(&vc4->job_lock, irqflags);
|
||||
return;
|
||||
}
|
||||
if (!kernel_state->bo)
|
||||
goto err_free_state;
|
||||
|
||||
k = 0;
|
||||
for (i = 0; i < 2; i++) {
|
||||
|
|
@ -285,6 +282,12 @@ vc4_save_hang_state(struct drm_device *dev)
|
|||
vc4->hang_state = kernel_state;
|
||||
spin_unlock_irqrestore(&vc4->job_lock, irqflags);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
err_free_state:
|
||||
spin_unlock_irqrestore(&vc4->job_lock, irqflags);
|
||||
kfree(kernel_state);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -481,6 +481,7 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data)
|
|||
|
||||
pm_runtime_use_autosuspend(dev);
|
||||
pm_runtime_set_autosuspend_delay(dev, 40); /* a little over 2 frames. */
|
||||
pm_runtime_put_autosuspend(dev);
|
||||
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue