A bit of struct drm_sched_job cleanup
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 5 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | drm/sched: Add job popping APIdrivers/ include/ | +22 | 3 replies | |
| 2/4 | drm/amdgpu: Use the new low level job popping helperdrivers/ | +1 | 0 replies | |
| 3/4 | drm/sched: Remove to_drm_sched_job internal helperdrivers/ drivers/ | +14 | 2 replies | |
| 4/4 | drm/sched: Make the type of drm_sched_job->last_dependency consistentinclude/ | +20 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/4] A bit of struct drm_sched_job cleanup
At one point I thought I wanted to add a member to struct drm_sched_job. As I noticed there is a hole in the struct, I went to re-order some members to get rid of it (the hole), at which point I was greeted by a subtle bug cause by the frequent pattern of:
job = to_drm_sched_job(spsc_queue_peek|pop(...))
Because to_drm_sched_job is a container of, it implies a lot of the scheduler (and amdgpu) assumes job->queue_node is the first struct element. Dare to change that, code will compile but weird things will happen at runtime.
So I thought lets clean that up and remove that hardcoded sneaky assumption and that is what this series does.
1) Adds a helper so amdgpu can touch the scheduler internals a little bit less.
2) Removes the assumption job->queue_node must be the first element.
3) And finally removes the hole from struct drm_sched_job, fixing one instance of type confusion in passing too.
Tvrtko Ursulin (4):
drm/sched: Add job popping API
drm/amdgpu: Use the new low level job popping helper drm/sched: Remove to_drm_sched_job internal helper drm/sched: Make the type of drm_sched_job->last_dependency consistent
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 5 +- drivers/gpu/drm/scheduler/sched_entity.c | 20 ++++---- drivers/gpu/drm/scheduler/sched_main.c | 10 ++-- include/drm/gpu_scheduler.h | 59 ++++++++++++++++-------- 4 files changed, 57 insertions(+), 37 deletions(-)
Signature · 1 line
2.47.1