[amd-gfx] [PATCH 2/3] drm/amdgpu/gfx7: set USER_SHADER_ARRAY_CONFIG based on disable_cu parameter

Alex Deucher alexdeucher at gmail.com
Fri Jun 17 15:51:40 UTC 2016


On Fri, Jun 17, 2016 at 9:17 AM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> Signed-off-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> index 8c6ad1e..b2dce60 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> @@ -3867,6 +3867,17 @@ static void gfx_v7_0_enable_gfx_cgpg(struct amdgpu_device *adev,
>         }
>  }
>
> +static void gfx_v7_0_set_user_cu_inactive_bitmap(struct amdgpu_device *adev,
> +                                                u32 bitmap)
> +{
> +       u32 data;
> +

Maybe bail early if there is no override?  Saves a reg write and
doesn't overwrite the user value if someone else (e.g., vbios) set it
previously.  Same with patch 3.

Alex

> +       data = bitmap << GC_USER_SHADER_ARRAY_CONFIG__INACTIVE_CUS__SHIFT;
> +       data &= GC_USER_SHADER_ARRAY_CONFIG__INACTIVE_CUS_MASK;
> +
> +       WREG32(mmGC_USER_SHADER_ARRAY_CONFIG, data);
> +}
> +
>  static u32 gfx_v7_0_get_cu_active_bitmap(struct amdgpu_device *adev)
>  {
>         u32 data, mask;
> @@ -5032,9 +5043,12 @@ static void gfx_v7_0_get_cu_info(struct amdgpu_device *adev)
>         int i, j, k, counter, active_cu_number = 0;
>         u32 mask, bitmap, ao_bitmap, ao_cu_mask = 0;
>         struct amdgpu_cu_info *cu_info = &adev->gfx.cu_info;
> +       unsigned disable_masks[4 * 2];
>
>         memset(cu_info, 0, sizeof(*cu_info));
>
> +       amdgpu_gfx_parse_disable_cu(disable_masks, 4, 2);
> +
>         mutex_lock(&adev->grbm_idx_mutex);
>         for (i = 0; i < adev->gfx.config.max_shader_engines; i++) {
>                 for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) {
> @@ -5042,6 +5056,9 @@ static void gfx_v7_0_get_cu_info(struct amdgpu_device *adev)
>                         ao_bitmap = 0;
>                         counter = 0;
>                         gfx_v7_0_select_se_sh(adev, i, j);
> +                       if (i < 4 && j < 2)
> +                               gfx_v7_0_set_user_cu_inactive_bitmap(
> +                                       adev, disable_masks[i * 2 + j]);
>                         bitmap = gfx_v7_0_get_cu_active_bitmap(adev);
>                         cu_info->bitmap[i][j] = bitmap;
>
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list