]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amdgpu/gfx11: add FW version check for new CP GFX shadow feature
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 20 Mar 2023 16:22:49 +0000 (12:22 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 24 Apr 2023 22:15:54 +0000 (18:15 -0400)
Use this to determine if we support the new SET_Q_PREEMPTION_MODE
packet.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c

index a2d311a4da5aea62017c6591e6a6ba273cba6a48..6c5f58a34e842d74c6047458b06899da6331a3e2 100644 (file)
@@ -380,6 +380,8 @@ struct amdgpu_gfx {
        struct amdgpu_ring              sw_gfx_ring[AMDGPU_MAX_SW_GFX_RINGS];
        struct amdgpu_ring_mux          muxer;
 
+       bool                            cp_gfx_shadow; /* for gfx11 */
+
        enum amdgpu_gfx_partition       partition_mode;
        uint32_t                        num_xcd;
        uint32_t                        num_xcc_per_xcp;
index d3c89e6c0c03518558becd2ec65cd6fe698ee38c..f1ad6bd1eda80ae15fe3e1455532292bdf912d32 100644 (file)
@@ -463,6 +463,18 @@ out:
        return err;
 }
 
+static void gfx_v11_0_check_fw_cp_gfx_shadow(struct amdgpu_device *adev)
+{
+       switch (adev->ip_versions[GC_HWIP][0]) {
+       case IP_VERSION(11, 0, 0):
+       case IP_VERSION(11, 0, 2):
+       case IP_VERSION(11, 0, 3):
+       default:
+               adev->gfx.cp_gfx_shadow = false;
+               break;
+       }
+}
+
 static int gfx_v11_0_init_microcode(struct amdgpu_device *adev)
 {
        char fw_name[40];
@@ -539,6 +551,7 @@ static int gfx_v11_0_init_microcode(struct amdgpu_device *adev)
        /* only one MEC for gfx 11.0.0. */
        adev->gfx.mec2_fw = NULL;
 
+       gfx_v11_0_check_fw_cp_gfx_shadow(adev);
 out:
        if (err) {
                amdgpu_ucode_release(&adev->gfx.pfp_fw);