Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/msm: Remove abuse of drm_exec internals

The code was reading drm_exec internal state to determine whether
the drm_exec structure had been initialized or not, and therefore
needed cleaning up, relying on undocumented behaviour.

Instead add a bool to struct msm_gem_submit to indicate whether
drm_exec cleaning up is needed.

Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Rob Clark <rob.clark@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/715502/
Message-ID: <20260331092023.81616-3-thomas.hellstrom@linux.intel.com>
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>

authored by

Thomas Hellström and committed by
Rob Clark
8c0e0b46 64ac64bb

+4 -1
+1
drivers/gpu/drm/msm/msm_gem.h
··· 452 452 bool bos_pinned : 1; 453 453 bool fault_dumped:1;/* Limit devcoredump dumping to one per submit */ 454 454 bool in_rb : 1; /* "sudo" mode, copy cmds into RB */ 455 + bool has_exec : 1; /* @exec is initialized. */ 455 456 struct msm_ringbuffer *ring; 456 457 unsigned int nr_cmds; 457 458 unsigned int nr_bos;
+3 -1
drivers/gpu/drm/msm/msm_gem_submit.c
··· 278 278 int ret = 0; 279 279 280 280 drm_exec_init(&submit->exec, flags, submit->nr_bos); 281 + submit->has_exec = true; 281 282 282 283 drm_exec_until_all_locked (&submit->exec) { 283 284 ret = drm_gpuvm_prepare_vm(submit->vm, exec, 1); ··· 305 304 return submit_lock_objects_vmbind(submit); 306 305 307 306 drm_exec_init(&submit->exec, flags, submit->nr_bos); 307 + submit->has_exec = true; 308 308 309 309 drm_exec_until_all_locked (&submit->exec) { 310 310 ret = drm_exec_lock_obj(&submit->exec, ··· 525 523 if (error) 526 524 submit_unpin_objects(submit); 527 525 528 - if (submit->exec.objects) 526 + if (submit->has_exec) 529 527 drm_exec_fini(&submit->exec); 530 528 531 529 /* if job wasn't enqueued to scheduler, early retirement: */