[PATCH] drm/amdgpu: Add Support for enforcing isolation without Cleaner Shader

Alex Deucher alexdeucher at gmail.com
Fri May 2 16:51:14 UTC 2025


On Mon, Apr 28, 2025 at 7:28 AM Srinivasan Shanmugam
<srinivasan.shanmugam at amd.com> wrote:
>
> Adjusted the enforce isolation setting handling to include the ability
> to disable the cleaner shader without affecting isolation between tasks.
>
> Cc: Christian König <christian.koenig at amd.com>
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam at amd.com>

Please update the module parameter documentation in amdgpu_drv.c as
well.  With that fixed:
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu.h        | 1 +
>  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c     | 4 ++++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +++++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c    | 7 ++++++-
>  4 files changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index cc26cf1bd843..7e5ae8f1f0a9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -878,6 +878,7 @@ enum amdgpu_enforce_isolation_mode {
>         AMDGPU_ENFORCE_ISOLATION_DISABLE = 0,
>         AMDGPU_ENFORCE_ISOLATION_ENABLE = 1,
>         AMDGPU_ENFORCE_ISOLATION_ENABLE_LEGACY = 2,
> +       AMDGPU_ENFORCE_ISOLATION_NO_CLEANER_SHADER = 3,
>  };
>
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index 0941b3495b2c..9ea0d9b71f48 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -310,6 +310,10 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p,
>                         p->jobs[i]->enforce_isolation = true;
>                         p->jobs[i]->run_cleaner_shader = false;
>                         break;
> +               case AMDGPU_ENFORCE_ISOLATION_NO_CLEANER_SHADER:
> +                       p->jobs[i]->enforce_isolation = true;
> +                       p->jobs[i]->run_cleaner_shader = false;
> +                       break;
>                 }
>         }
>         p->gang_leader = p->jobs[p->gang_leader_idx];
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index fe68ba9997ae..8330e30f0caf 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2163,6 +2163,11 @@ static int amdgpu_device_check_arguments(struct amdgpu_device *adev)
>                         adev->enforce_isolation[i] =
>                                 AMDGPU_ENFORCE_ISOLATION_ENABLE_LEGACY;
>                         break;
> +               case 3:
> +                       /* enable only process isolation without submitting cleaner shader */
> +                       adev->enforce_isolation[i] =
> +                               AMDGPU_ENFORCE_ISOLATION_NO_CLEANER_SHADER;
> +                       break;
>                 }
>         }
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> index 8f1a2f7b03c1..9d4396ca52ac 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> @@ -1689,7 +1689,8 @@ static ssize_t amdgpu_gfx_set_enforce_isolation(struct device *dev,
>         for (i = 0; i < num_partitions; i++) {
>                 if (partition_values[i] != 0 &&
>                     partition_values[i] != 1 &&
> -                   partition_values[i] != 2)
> +                   partition_values[i] != 2 &&
> +                   partition_values[i] != 3)
>                         return -EINVAL;
>         }
>
> @@ -1708,6 +1709,10 @@ static ssize_t amdgpu_gfx_set_enforce_isolation(struct device *dev,
>                         adev->enforce_isolation[i] =
>                                 AMDGPU_ENFORCE_ISOLATION_ENABLE_LEGACY;
>                         break;
> +               case 3:
> +                       adev->enforce_isolation[i] =
> +                               AMDGPU_ENFORCE_ISOLATION_NO_CLEANER_SHADER;
> +                       break;
>                 }
>         }
>         mutex_unlock(&adev->enforce_isolation_mutex);
> --
> 2.34.1
>


More information about the amd-gfx mailing list