]> git.baikalelectronics.ru Git - kernel.git/commit
drm/v3d: alloc and init job in one shot
authorMelissa Wen <mwen@igalia.com>
Thu, 30 Sep 2021 16:17:39 +0000 (17:17 +0100)
committerMelissa Wen <melissa.srw@gmail.com>
Mon, 4 Oct 2021 09:08:16 +0000 (10:08 +0100)
commitd44276b4feadc24fb1f644ba2e4c3223dd72154f
treebab79bc1ecf8aa332b58228871cfcb2d0f5cc07c
parentfd2bef6b80c8d7c8fa4cd1964a556591dc0c2933
drm/v3d: alloc and init job in one shot

Move job memory allocation to v3d_job_init function. This aim to facilitate
error handling in job initialization, since cleanup steps are similar for
all (struct v3d_job)-based types of job involved in a command submission.
To generalize v3d_job_init(), this change takes into account that all job
structs have the first element a struct v3d_job (bin, render, tfu, csd) or
it is a v3d_job itself (clean_job) for pointer casting.

v3:
- explicitly init job as NULL (Iago)
- fix pm failure handling on v3_job_init (Iago)

Suggested-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/4d12e07bd334d2cddb51cabd359e99edde595619.1633016479.git.mwen@igalia.com
drivers/gpu/drm/v3d/v3d_gem.c