Home
last modified time | relevance | path

Searched hist:e482ae9b5fdc01a343f22f52930e85a6cfdf85eb (Results 1 – 2 of 2) sorted by relevance

/linux/drivers/gpu/drm/
H A Ddrm_writeback.cdiff e482ae9b5fdc01a343f22f52930e85a6cfdf85eb Thu Feb 21 01:51:37 CET 2019 Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> drm: writeback: Fix leak of writeback job

Writeback jobs are allocated when the WRITEBACK_FB_ID is set, and
deleted when the jobs complete. This results in both a memory leak of
the job and a leak of the framebuffer if the atomic commit returns
before the job is queued for processing, for instance if the atomic
check fails or if the commit runs in test-only mode.

Fix this by implementing the drm_writeback_cleanup_job() function and
calling it from __drm_atomic_helper_connector_destroy_state(). As
writeback jobs are removed from the state when they're queued for
processing, any job left in the state when the state gets destroyed
needs to be cleaned up.

The existing declaration of the drm_writeback_cleanup_job() function
without an implementation hints that this problem was considered, but
never addressed.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Brian Starkey <brian.starkey@arm.com>
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
H A Ddrm_atomic_state_helper.cdiff e482ae9b5fdc01a343f22f52930e85a6cfdf85eb Thu Feb 21 01:51:37 CET 2019 Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> drm: writeback: Fix leak of writeback job

Writeback jobs are allocated when the WRITEBACK_FB_ID is set, and
deleted when the jobs complete. This results in both a memory leak of
the job and a leak of the framebuffer if the atomic commit returns
before the job is queued for processing, for instance if the atomic
check fails or if the commit runs in test-only mode.

Fix this by implementing the drm_writeback_cleanup_job() function and
calling it from __drm_atomic_helper_connector_destroy_state(). As
writeback jobs are removed from the state when they're queued for
processing, any job left in the state when the state gets destroyed
needs to be cleaned up.

The existing declaration of the drm_writeback_cleanup_job() function
without an implementation hints that this problem was considered, but
never addressed.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Brian Starkey <brian.starkey@arm.com>
Acked-by: Liviu Dudau <liviu.dudau@arm.com>