diff options
author | Dave Airlie <airlied@redhat.com> | 2018-09-26 21:06:46 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2018-09-26 21:06:46 -0400 |
commit | bf78296ab1cb215d0609ac6cff4e43e941e51265 (patch) | |
tree | a193615b327d9ee538e71ca5f13bbfb4f3db4e6b /drivers/gpu/drm/amd | |
parent | 18eb2f6e19d77900695987e3a2b775cccbe5b84e (diff) | |
parent | 6bf4ca7fbc85d80446ac01c0d1d77db4d91a6d84 (diff) |
BackMerge v4.19-rc5 into drm-next
Sean Paul requested an -rc5 backmerge from some sun4i fixes.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_device.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_iommu.c | 13 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 21 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/include/kgd_kfd_interface.h | 2 |
12 files changed, 50 insertions, 19 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c index 5661c343a71d..0f9947edb12a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | |||
@@ -250,7 +250,7 @@ void amdgpu_amdkfd_gpu_reset(struct kgd_dev *kgd) | |||
250 | 250 | ||
251 | int alloc_gtt_mem(struct kgd_dev *kgd, size_t size, | 251 | int alloc_gtt_mem(struct kgd_dev *kgd, size_t size, |
252 | void **mem_obj, uint64_t *gpu_addr, | 252 | void **mem_obj, uint64_t *gpu_addr, |
253 | void **cpu_ptr) | 253 | void **cpu_ptr, bool mqd_gfx9) |
254 | { | 254 | { |
255 | struct amdgpu_device *adev = (struct amdgpu_device *)kgd; | 255 | struct amdgpu_device *adev = (struct amdgpu_device *)kgd; |
256 | struct amdgpu_bo *bo = NULL; | 256 | struct amdgpu_bo *bo = NULL; |
@@ -265,6 +265,10 @@ int alloc_gtt_mem(struct kgd_dev *kgd, size_t size, | |||
265 | bp.flags = AMDGPU_GEM_CREATE_CPU_GTT_USWC; | 265 | bp.flags = AMDGPU_GEM_CREATE_CPU_GTT_USWC; |
266 | bp.type = ttm_bo_type_kernel; | 266 | bp.type = ttm_bo_type_kernel; |
267 | bp.resv = NULL; | 267 | bp.resv = NULL; |
268 | |||
269 | if (mqd_gfx9) | ||
270 | bp.flags |= AMDGPU_GEM_CREATE_MQD_GFX9; | ||
271 | |||
268 | r = amdgpu_bo_create(adev, &bp, &bo); | 272 | r = amdgpu_bo_create(adev, &bp, &bo); |
269 | if (r) { | 273 | if (r) { |
270 | dev_err(adev->dev, | 274 | dev_err(adev->dev, |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h index 41e7dfc3ced3..056fc6ef6c63 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | |||
@@ -136,7 +136,7 @@ void amdgpu_amdkfd_gpu_reset(struct kgd_dev *kgd); | |||
136 | /* Shared API */ | 136 | /* Shared API */ |
137 | int alloc_gtt_mem(struct kgd_dev *kgd, size_t size, | 137 | int alloc_gtt_mem(struct kgd_dev *kgd, size_t size, |
138 | void **mem_obj, uint64_t *gpu_addr, | 138 | void **mem_obj, uint64_t *gpu_addr, |
139 | void **cpu_ptr); | 139 | void **cpu_ptr, bool mqd_gfx9); |
140 | void free_gtt_mem(struct kgd_dev *kgd, void *mem_obj); | 140 | void free_gtt_mem(struct kgd_dev *kgd, void *mem_obj); |
141 | void get_local_mem_info(struct kgd_dev *kgd, | 141 | void get_local_mem_info(struct kgd_dev *kgd, |
142 | struct kfd_local_mem_info *mem_info); | 142 | struct kfd_local_mem_info *mem_info); |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c index 6f0b5267addb..b2e45c8e2e0d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c | |||
@@ -686,7 +686,7 @@ static int kgd_hqd_sdma_destroy(struct kgd_dev *kgd, void *mqd, | |||
686 | 686 | ||
687 | while (true) { | 687 | while (true) { |
688 | temp = RREG32(sdma_base_addr + mmSDMA0_RLC0_CONTEXT_STATUS); | 688 | temp = RREG32(sdma_base_addr + mmSDMA0_RLC0_CONTEXT_STATUS); |
689 | if (temp & SDMA0_STATUS_REG__RB_CMD_IDLE__SHIFT) | 689 | if (temp & SDMA0_RLC0_CONTEXT_STATUS__IDLE_MASK) |
690 | break; | 690 | break; |
691 | if (time_after(jiffies, end_jiffies)) | 691 | if (time_after(jiffies, end_jiffies)) |
692 | return -ETIME; | 692 | return -ETIME; |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c index 693ec5ea4950..8816c697b205 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | |||
@@ -367,12 +367,14 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device, | |||
367 | break; | 367 | break; |
368 | case CHIP_POLARIS10: | 368 | case CHIP_POLARIS10: |
369 | if (type == CGS_UCODE_ID_SMU) { | 369 | if (type == CGS_UCODE_ID_SMU) { |
370 | if ((adev->pdev->device == 0x67df) && | 370 | if (((adev->pdev->device == 0x67df) && |
371 | ((adev->pdev->revision == 0xe0) || | 371 | ((adev->pdev->revision == 0xe0) || |
372 | (adev->pdev->revision == 0xe3) || | 372 | (adev->pdev->revision == 0xe3) || |
373 | (adev->pdev->revision == 0xe4) || | 373 | (adev->pdev->revision == 0xe4) || |
374 | (adev->pdev->revision == 0xe5) || | 374 | (adev->pdev->revision == 0xe5) || |
375 | (adev->pdev->revision == 0xe7) || | 375 | (adev->pdev->revision == 0xe7) || |
376 | (adev->pdev->revision == 0xef))) || | ||
377 | ((adev->pdev->device == 0x6fdf) && | ||
376 | (adev->pdev->revision == 0xef))) { | 378 | (adev->pdev->revision == 0xef))) { |
377 | info->is_kicker = true; | 379 | info->is_kicker = true; |
378 | strcpy(fw_name, "amdgpu/polaris10_k_smc.bin"); | 380 | strcpy(fw_name, "amdgpu/polaris10_k_smc.bin"); |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index b7ec2b0e5a9b..663043c8f0f5 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |||
@@ -1262,10 +1262,10 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p, | |||
1262 | error_abort: | 1262 | error_abort: |
1263 | dma_fence_put(&job->base.s_fence->finished); | 1263 | dma_fence_put(&job->base.s_fence->finished); |
1264 | job->base.s_fence = NULL; | 1264 | job->base.s_fence = NULL; |
1265 | amdgpu_mn_unlock(p->mn); | ||
1265 | 1266 | ||
1266 | error_unlock: | 1267 | error_unlock: |
1267 | amdgpu_job_free(job); | 1268 | amdgpu_job_free(job); |
1268 | amdgpu_mn_unlock(p->mn); | ||
1269 | return r; | 1269 | return r; |
1270 | } | 1270 | } |
1271 | 1271 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 53e038963936..723f0f7754bd 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | |||
@@ -837,6 +837,7 @@ static const struct pci_device_id pciidlist[] = { | |||
837 | {0x1002, 0x67CA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, | 837 | {0x1002, 0x67CA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, |
838 | {0x1002, 0x67CC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, | 838 | {0x1002, 0x67CC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, |
839 | {0x1002, 0x67CF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, | 839 | {0x1002, 0x67CF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, |
840 | {0x1002, 0x6FDF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10}, | ||
840 | /* Polaris12 */ | 841 | /* Polaris12 */ |
841 | {0x1002, 0x6980, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, | 842 | {0x1002, 0x6980, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, |
842 | {0x1002, 0x6981, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, | 843 | {0x1002, 0x6981, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, |
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c index b4d9e6b4f583..9b4e6ad4a7df 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c | |||
@@ -457,7 +457,8 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd, | |||
457 | 457 | ||
458 | if (kfd->kfd2kgd->init_gtt_mem_allocation( | 458 | if (kfd->kfd2kgd->init_gtt_mem_allocation( |
459 | kfd->kgd, size, &kfd->gtt_mem, | 459 | kfd->kgd, size, &kfd->gtt_mem, |
460 | &kfd->gtt_start_gpu_addr, &kfd->gtt_start_cpu_ptr)){ | 460 | &kfd->gtt_start_gpu_addr, &kfd->gtt_start_cpu_ptr, |
461 | false)) { | ||
461 | dev_err(kfd_device, "Could not allocate %d bytes\n", size); | 462 | dev_err(kfd_device, "Could not allocate %d bytes\n", size); |
462 | goto out; | 463 | goto out; |
463 | } | 464 | } |
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_iommu.c b/drivers/gpu/drm/amd/amdkfd/kfd_iommu.c index 7a61f38c09e6..01494752c36a 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_iommu.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_iommu.c | |||
@@ -62,9 +62,20 @@ int kfd_iommu_device_init(struct kfd_dev *kfd) | |||
62 | struct amd_iommu_device_info iommu_info; | 62 | struct amd_iommu_device_info iommu_info; |
63 | unsigned int pasid_limit; | 63 | unsigned int pasid_limit; |
64 | int err; | 64 | int err; |
65 | struct kfd_topology_device *top_dev; | ||
65 | 66 | ||
66 | if (!kfd->device_info->needs_iommu_device) | 67 | top_dev = kfd_topology_device_by_id(kfd->id); |
68 | |||
69 | /* | ||
70 | * Overwrite ATS capability according to needs_iommu_device to fix | ||
71 | * potential missing corresponding bit in CRAT of BIOS. | ||
72 | */ | ||
73 | if (!kfd->device_info->needs_iommu_device) { | ||
74 | top_dev->node_props.capability &= ~HSA_CAP_ATS_PRESENT; | ||
67 | return 0; | 75 | return 0; |
76 | } | ||
77 | |||
78 | top_dev->node_props.capability |= HSA_CAP_ATS_PRESENT; | ||
68 | 79 | ||
69 | iommu_info.flags = 0; | 80 | iommu_info.flags = 0; |
70 | err = amd_iommu_device_info(kfd->pdev, &iommu_info); | 81 | err = amd_iommu_device_info(kfd->pdev, &iommu_info); |
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c index f5fc3675f21e..0cedb37cf513 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | |||
@@ -88,7 +88,7 @@ static int init_mqd(struct mqd_manager *mm, void **mqd, | |||
88 | ALIGN(sizeof(struct v9_mqd), PAGE_SIZE), | 88 | ALIGN(sizeof(struct v9_mqd), PAGE_SIZE), |
89 | &((*mqd_mem_obj)->gtt_mem), | 89 | &((*mqd_mem_obj)->gtt_mem), |
90 | &((*mqd_mem_obj)->gpu_addr), | 90 | &((*mqd_mem_obj)->gpu_addr), |
91 | (void *)&((*mqd_mem_obj)->cpu_ptr)); | 91 | (void *)&((*mqd_mem_obj)->cpu_ptr), true); |
92 | } else | 92 | } else |
93 | retval = kfd_gtt_sa_allocate(mm->dev, sizeof(struct v9_mqd), | 93 | retval = kfd_gtt_sa_allocate(mm->dev, sizeof(struct v9_mqd), |
94 | mqd_mem_obj); | 94 | mqd_mem_obj); |
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h index 05283c99d731..b0064b08aa11 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h | |||
@@ -782,6 +782,7 @@ int kfd_topology_add_device(struct kfd_dev *gpu); | |||
782 | int kfd_topology_remove_device(struct kfd_dev *gpu); | 782 | int kfd_topology_remove_device(struct kfd_dev *gpu); |
783 | struct kfd_topology_device *kfd_topology_device_by_proximity_domain( | 783 | struct kfd_topology_device *kfd_topology_device_by_proximity_domain( |
784 | uint32_t proximity_domain); | 784 | uint32_t proximity_domain); |
785 | struct kfd_topology_device *kfd_topology_device_by_id(uint32_t gpu_id); | ||
785 | struct kfd_dev *kfd_device_by_id(uint32_t gpu_id); | 786 | struct kfd_dev *kfd_device_by_id(uint32_t gpu_id); |
786 | struct kfd_dev *kfd_device_by_pci_dev(const struct pci_dev *pdev); | 787 | struct kfd_dev *kfd_device_by_pci_dev(const struct pci_dev *pdev); |
787 | int kfd_topology_enum_kfd_devices(uint8_t idx, struct kfd_dev **kdev); | 788 | int kfd_topology_enum_kfd_devices(uint8_t idx, struct kfd_dev **kdev); |
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c index 19ecc8233d66..0dff66be8d7a 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c | |||
@@ -63,22 +63,33 @@ struct kfd_topology_device *kfd_topology_device_by_proximity_domain( | |||
63 | return device; | 63 | return device; |
64 | } | 64 | } |
65 | 65 | ||
66 | struct kfd_dev *kfd_device_by_id(uint32_t gpu_id) | 66 | struct kfd_topology_device *kfd_topology_device_by_id(uint32_t gpu_id) |
67 | { | 67 | { |
68 | struct kfd_topology_device *top_dev; | 68 | struct kfd_topology_device *top_dev = NULL; |
69 | struct kfd_dev *device = NULL; | 69 | struct kfd_topology_device *ret = NULL; |
70 | 70 | ||
71 | down_read(&topology_lock); | 71 | down_read(&topology_lock); |
72 | 72 | ||
73 | list_for_each_entry(top_dev, &topology_device_list, list) | 73 | list_for_each_entry(top_dev, &topology_device_list, list) |
74 | if (top_dev->gpu_id == gpu_id) { | 74 | if (top_dev->gpu_id == gpu_id) { |
75 | device = top_dev->gpu; | 75 | ret = top_dev; |
76 | break; | 76 | break; |
77 | } | 77 | } |
78 | 78 | ||
79 | up_read(&topology_lock); | 79 | up_read(&topology_lock); |
80 | 80 | ||
81 | return device; | 81 | return ret; |
82 | } | ||
83 | |||
84 | struct kfd_dev *kfd_device_by_id(uint32_t gpu_id) | ||
85 | { | ||
86 | struct kfd_topology_device *top_dev; | ||
87 | |||
88 | top_dev = kfd_topology_device_by_id(gpu_id); | ||
89 | if (!top_dev) | ||
90 | return NULL; | ||
91 | |||
92 | return top_dev->gpu; | ||
82 | } | 93 | } |
83 | 94 | ||
84 | struct kfd_dev *kfd_device_by_pci_dev(const struct pci_dev *pdev) | 95 | struct kfd_dev *kfd_device_by_pci_dev(const struct pci_dev *pdev) |
diff --git a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h index cb4deb28bb7f..f43ed96cfa6c 100644 --- a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h +++ b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h | |||
@@ -322,7 +322,7 @@ struct tile_config { | |||
322 | struct kfd2kgd_calls { | 322 | struct kfd2kgd_calls { |
323 | int (*init_gtt_mem_allocation)(struct kgd_dev *kgd, size_t size, | 323 | int (*init_gtt_mem_allocation)(struct kgd_dev *kgd, size_t size, |
324 | void **mem_obj, uint64_t *gpu_addr, | 324 | void **mem_obj, uint64_t *gpu_addr, |
325 | void **cpu_ptr); | 325 | void **cpu_ptr, bool mqd_gfx9); |
326 | 326 | ||
327 | void (*free_gtt_mem)(struct kgd_dev *kgd, void *mem_obj); | 327 | void (*free_gtt_mem)(struct kgd_dev *kgd, void *mem_obj); |
328 | 328 | ||