[RFC PATCH 1/4] drm/scheduler: Add DRM_SCHED_PRIORITY_VERY_HIGH

Christian König ckoenig.leichtzumerken at gmail.com
Mon Apr 3 19:51:43 UTC 2023


Am 03.04.23 um 21:40 schrieb Joshua Ashton:
> This allows AMDGPU scheduler priority above normal to be expressed
> using the DRM_SCHED_PRIORITY enum.

That was rejected before, I just don't remember why exactly. Need to dig 
that up again.

Christian.

>
> Signed-off-by: Joshua Ashton <joshua at froggi.es>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 +-
>   drivers/gpu/drm/msm/msm_gpu.h           | 2 +-
>   include/drm/gpu_scheduler.h             | 1 +
>   3 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> index d2139ac12159..8ec255091c4a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> @@ -79,7 +79,7 @@ amdgpu_ctx_to_drm_sched_prio(int32_t ctx_prio)
>   		return DRM_SCHED_PRIORITY_HIGH;
>   
>   	case AMDGPU_CTX_PRIORITY_VERY_HIGH:
> -		return DRM_SCHED_PRIORITY_HIGH;
> +		return DRM_SCHED_PRIORITY_VERY_HIGH;
>   
>   	/* This should not happen as we sanitized userspace provided priority
>   	 * already, WARN if this happens.
> diff --git a/drivers/gpu/drm/msm/msm_gpu.h b/drivers/gpu/drm/msm/msm_gpu.h
> index fc1c0d8611a8..e3495712b236 100644
> --- a/drivers/gpu/drm/msm/msm_gpu.h
> +++ b/drivers/gpu/drm/msm/msm_gpu.h
> @@ -336,7 +336,7 @@ struct msm_gpu_perfcntr {
>    * DRM_SCHED_PRIORITY_KERNEL priority level is treated specially in some
>    * cases, so we don't use it (no need for kernel generated jobs).
>    */
> -#define NR_SCHED_PRIORITIES (1 + DRM_SCHED_PRIORITY_HIGH - DRM_SCHED_PRIORITY_MIN)
> +#define NR_SCHED_PRIORITIES (1 + DRM_SCHED_PRIORITY_VERY_HIGH - DRM_SCHED_PRIORITY_MIN)
>   
>   /**
>    * struct msm_file_private - per-drm_file context
> diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h
> index 9935d1e2ff69..a62071660602 100644
> --- a/include/drm/gpu_scheduler.h
> +++ b/include/drm/gpu_scheduler.h
> @@ -55,6 +55,7 @@ enum drm_sched_priority {
>   	DRM_SCHED_PRIORITY_MIN,
>   	DRM_SCHED_PRIORITY_NORMAL,
>   	DRM_SCHED_PRIORITY_HIGH,
> +	DRM_SCHED_PRIORITY_VERY_HIGH,
>   	DRM_SCHED_PRIORITY_KERNEL,
>   
>   	DRM_SCHED_PRIORITY_COUNT,



More information about the amd-gfx mailing list