[PATCH 0/2] Fixes to drm_sched_priority (v2)

Luben Tuikov luben.tuikov at amd.com
Sat Aug 15 02:48:50 UTC 2020


Some fixes to enum drm_sched_priority which I'd wanted to do
since last year.

For instance, renaming MAX to COUNT, as usually a maximum value
is a value which is part of the set of values, (e.g. a maxima of
a function), and thus assignable, whereby a count is the size of
a set (the enumeration in this case). It also makes it clearer
when used to define size of arrays.

Removing some redundant naming and perhaps better naming could be
had for PRIORITY_SW and PRIORITY_HW, maybe "moderate" and
"temperate" respectively. However, I've left them as "sw" and
"hw".

Also remove a macro which was used in only a single place.

In the second patch, remove priority INVALID, since it is not a
priority, e.g. a scheduler cannot be assigned and run at priority
"invalid". It seems to be more of a directive, a status, of user
input, and as such has no place in the enumeration of priority
levels.

Something else I'd like to do, is to eliminate priority
enumeration "UNSET", since it is not really a priority level,
but  a directive, instructing the code to "reset the priority
of a context to the initial priority".

At the moment, this functionality is overloaded to this priority
value, and it should be an IOCTL op, as opposed to a priority value.

Tested on my desktop system, which is running a kernel with
this patch applied.

v2: Some reverts; eliminate SW and HW for HIGH, and bring back
    KERNEL--the highest!

Luben Tuikov (2):
  drm/scheduler: Scheduler priority fixes (v2)
  drm/scheduler: Remove priority macro INVALID (v2)

 drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c   |  9 +++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c   |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c  |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h  |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c | 40 +++++++++++++++++------
 drivers/gpu/drm/amd/amdgpu/amdgpu_sched.h |  3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c   |  2 +-
 drivers/gpu/drm/scheduler/sched_main.c    |  4 +--
 include/drm/gpu_scheduler.h               | 13 ++++----
 9 files changed, 49 insertions(+), 28 deletions(-)

-- 
2.28.0.215.g878e727637



More information about the amd-gfx mailing list