]> Git Repo - J-linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
Merge tag 'fs_for_v5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack...
[J-linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_ctx.c
index 8842c55d4490b3fdb57ffda94a7cfee219bfc14d..c80d8339f58c4726999de96a0b4a53b422efa156 100644 (file)
@@ -46,7 +46,7 @@ const unsigned int amdgpu_ctx_num_entities[AMDGPU_HW_IP_NUM] = {
 static int amdgpu_ctx_priority_permit(struct drm_file *filp,
                                      enum drm_sched_priority priority)
 {
-       if (priority < 0 || priority >= DRM_SCHED_PRIORITY_MAX)
+       if (priority < 0 || priority >= DRM_SCHED_PRIORITY_COUNT)
                return -EINVAL;
 
        /* NORMAL and below are accessible by everyone */
@@ -65,7 +65,7 @@ static int amdgpu_ctx_priority_permit(struct drm_file *filp,
 static enum gfx_pipe_priority amdgpu_ctx_sched_prio_to_compute_prio(enum drm_sched_priority prio)
 {
        switch (prio) {
-       case DRM_SCHED_PRIORITY_HIGH_HW:
+       case DRM_SCHED_PRIORITY_HIGH:
        case DRM_SCHED_PRIORITY_KERNEL:
                return AMDGPU_GFX_PIPE_PRIO_HIGH;
        default:
@@ -114,7 +114,11 @@ static int amdgpu_ctx_init_entity(struct amdgpu_ctx *ctx, u32 hw_ip,
        scheds = adev->gpu_sched[hw_ip][hw_prio].sched;
        num_scheds = adev->gpu_sched[hw_ip][hw_prio].num_scheds;
 
-       if (hw_ip == AMDGPU_HW_IP_VCN_ENC || hw_ip == AMDGPU_HW_IP_VCN_DEC) {
+       /* disable load balance if the hw engine retains context among dependent jobs */
+       if (hw_ip == AMDGPU_HW_IP_VCN_ENC ||
+           hw_ip == AMDGPU_HW_IP_VCN_DEC ||
+           hw_ip == AMDGPU_HW_IP_UVD_ENC ||
+           hw_ip == AMDGPU_HW_IP_UVD) {
                sched = drm_sched_pick_best(scheds, num_scheds);
                scheds = &sched;
                num_scheds = 1;
@@ -385,16 +389,15 @@ int amdgpu_ctx_ioctl(struct drm_device *dev, void *data,
        enum drm_sched_priority priority;
 
        union drm_amdgpu_ctx *args = data;
-       struct amdgpu_device *adev = dev->dev_private;
+       struct amdgpu_device *adev = drm_to_adev(dev);
        struct amdgpu_fpriv *fpriv = filp->driver_priv;
 
-       r = 0;
        id = args->in.ctx_id;
-       priority = amdgpu_to_sched_priority(args->in.priority);
+       r = amdgpu_to_sched_priority(args->in.priority, &priority);
 
        /* For backwards compatibility reasons, we need to accept
         * ioctls with garbage in the priority field */
-       if (priority == DRM_SCHED_PRIORITY_INVALID)
+       if (r == -EINVAL)
                priority = DRM_SCHED_PRIORITY_NORMAL;
 
        switch (args->in.op) {
This page took 0.030123 seconds and 4 git commands to generate.