]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf...
[linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_gfx.c
index 3380daf42da8af2a3884d3bf576ccbdbae846055..35ed46b9249c13ccc0a3b13758f76a70fa08da90 100644 (file)
@@ -375,8 +375,11 @@ int amdgpu_gfx_mqd_sw_init(struct amdgpu_device *adev,
                 * KIQ MQD no matter SRIOV or Bare-metal
                 */
                r = amdgpu_bo_create_kernel(adev, mqd_size, PAGE_SIZE,
-                                           AMDGPU_GEM_DOMAIN_VRAM, &ring->mqd_obj,
-                                           &ring->mqd_gpu_addr, &ring->mqd_ptr);
+                                           AMDGPU_GEM_DOMAIN_VRAM |
+                                           AMDGPU_GEM_DOMAIN_GTT,
+                                           &ring->mqd_obj,
+                                           &ring->mqd_gpu_addr,
+                                           &ring->mqd_ptr);
                if (r) {
                        dev_warn(adev->dev, "failed to create ring mqd ob (%d)", r);
                        return r;
@@ -696,6 +699,50 @@ late_fini:
        return r;
 }
 
+int amdgpu_gfx_ras_sw_init(struct amdgpu_device *adev)
+{
+       int err = 0;
+       struct amdgpu_gfx_ras *ras = NULL;
+
+       /* adev->gfx.ras is NULL, which means gfx does not
+        * support ras function, then do nothing here.
+        */
+       if (!adev->gfx.ras)
+               return 0;
+
+       ras = adev->gfx.ras;
+
+       err = amdgpu_ras_register_ras_block(adev, &ras->ras_block);
+       if (err) {
+               dev_err(adev->dev, "Failed to register gfx ras block!\n");
+               return err;
+       }
+
+       strcpy(ras->ras_block.ras_comm.name, "gfx");
+       ras->ras_block.ras_comm.block = AMDGPU_RAS_BLOCK__GFX;
+       ras->ras_block.ras_comm.type = AMDGPU_RAS_ERROR__MULTI_UNCORRECTABLE;
+       adev->gfx.ras_if = &ras->ras_block.ras_comm;
+
+       /* If not define special ras_late_init function, use gfx default ras_late_init */
+       if (!ras->ras_block.ras_late_init)
+               ras->ras_block.ras_late_init = amdgpu_ras_block_late_init;
+
+       /* If not defined special ras_cb function, use default ras_cb */
+       if (!ras->ras_block.ras_cb)
+               ras->ras_block.ras_cb = amdgpu_gfx_process_ras_data_cb;
+
+       return 0;
+}
+
+int amdgpu_gfx_poison_consumption_handler(struct amdgpu_device *adev,
+                                               struct amdgpu_iv_entry *entry)
+{
+       if (adev->gfx.ras && adev->gfx.ras->poison_consumption_handler)
+               return adev->gfx.ras->poison_consumption_handler(adev, entry);
+
+       return 0;
+}
+
 int amdgpu_gfx_process_ras_data_cb(struct amdgpu_device *adev,
                void *err_data,
                struct amdgpu_iv_entry *entry)
This page took 0.037375 seconds and 4 git commands to generate.