History

Merge branch 'drm-fixes-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-fixes

A few fixes for 4.19: - Add a new polaris pci id - KFD fixes for raven and gfx7

Dave Airlie committed 8 years ago

Commit 4fcb7f82 parents 618cc15 44d8cc611 files · +49 −18Browse files

Unified · Split

11 files
  1. drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +5 −1
  2. drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h +1 −1
  3. drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c +1 −1
  4. drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +8 −6
  5. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 −0
  6. drivers/gpu/drm/amd/amdkfd/kfd_device.c +2 −1
  7. drivers/gpu/drm/amd/amdkfd/kfd_iommu.c +12 −1
  8. drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c +1 −1
  9. drivers/gpu/drm/amd/amdkfd/kfd_priv.h +1 −0
  10. drivers/gpu/drm/amd/amdkfd/kfd_topology.c +16 −5
  11. drivers/gpu/drm/amd/include/kgd_kfd_interface.h +1 −1
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c+5−1
@@ -272,7 +272,7 @@ void amdgpu_amdkfd_gpu_reset(struct kgd_dev *kgd) · 271 unmodified lines
272272
273273 int alloc_gtt_mem(struct kgd_dev *kgd, size_t size,
274274 void **mem_obj, uint64_t *gpu_addr,
275− void **cpu_ptr)
275+ void **cpu_ptr, bool mqd_gfx9)
276276 {
277277 struct amdgpu_device *adev = (struct amdgpu_device *)kgd;
278278 struct amdgpu_bo *bo = NULL;
@@ -287,6 +287,10 @@ int alloc_gtt_mem(struct kgd_dev *kgd, size_t size, · 8 unmodified lines
287287 bp.flags = AMDGPU_GEM_CREATE_CPU_GTT_USWC;
288288 bp.type = ttm_bo_type_kernel;
289289 bp.resv = NULL;
290+
291+ if (mqd_gfx9)
292+ bp.flags |= AMDGPU_GEM_CREATE_MQD_GFX9;
293+
290294 r = amdgpu_bo_create(adev, &bp, &bo);
291295 if (r) {
292296 dev_err(adev->dev,
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h+1−1
@@ -136,7 +136,7 @@ void amdgpu_amdkfd_gpu_reset(struct kgd_dev *kgd); · 135 unmodified lines
136136 /* Shared API */
137137 int alloc_gtt_mem(struct kgd_dev *kgd, size_t size,
138138 void **mem_obj, uint64_t *gpu_addr,
139− void **cpu_ptr);
139+ void **cpu_ptr, bool mqd_gfx9);
140140 void free_gtt_mem(struct kgd_dev *kgd, void *mem_obj);
141141 void get_local_mem_info(struct kgd_dev *kgd,
142142 struct kfd_local_mem_info *mem_info);
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c+1−1
@@ -685,7 +685,7 @@ static int kgd_hqd_sdma_destroy(struct kgd_dev *kgd, void *mqd, · 684 unmodified lines
685685
686686 while (true) {
687687 temp = RREG32(sdma_base_addr + mmSDMA0_RLC0_CONTEXT_STATUS);
688− if (temp & SDMA0_STATUS_REG__RB_CMD_IDLE__SHIFT)
688+ if (temp & SDMA0_RLC0_CONTEXT_STATUS__IDLE_MASK)
689689 break;
690690 if (time_after(jiffies, end_jiffies))
691691 return -ETIME;
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c+8−6
@@ -367,12 +367,14 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device, · 366 unmodified lines
367367 break;
368368 case CHIP_POLARIS10:
369369 if (type == CGS_UCODE_ID_SMU) {
370− if ((adev->pdev->device == 0x67df) &&
371− ((adev->pdev->revision == 0xe0) ||
372− (adev->pdev->revision == 0xe3) ||
373− (adev->pdev->revision == 0xe4) ||
374− (adev->pdev->revision == 0xe5) ||
375− (adev->pdev->revision == 0xe7) ||
370+ if (((adev->pdev->device == 0x67df) &&
371+ ((adev->pdev->revision == 0xe0) ||
372+ (adev->pdev->revision == 0xe3) ||
373+ (adev->pdev->revision == 0xe4) ||
374+ (adev->pdev->revision == 0xe5) ||
375+ (adev->pdev->revision == 0xe7) ||
376+ (adev->pdev->revision == 0xef))) ||
377+ ((adev->pdev->device == 0x6fdf) &&
376378 (adev->pdev->revision == 0xef))) {
377379 info->is_kicker = true;
378380 strcpy(fw_name, "amdgpu/polaris10_k_smc.bin");
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c+1−0
@@ -740,6 +740,7 @@ static const struct pci_device_id pciidlist[] = { · 739 unmodified lines
740740 {0x1002, 0x67CA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10},
741741 {0x1002, 0x67CC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10},
742742 {0x1002, 0x67CF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10},
743+ {0x1002, 0x6FDF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10},
743744 /* Polaris12 */
744745 {0x1002, 0x6980, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
745746 {0x1002, 0x6981, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
drivers/gpu/drm/amd/amdkfd/kfd_device.c+2−1
@@ -457,7 +457,8 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd, · 456 unmodified lines
457457
458458 if (kfd->kfd2kgd->init_gtt_mem_allocation(
459459 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)) {
461462 dev_err(kfd_device, "Could not allocate %d bytes\n", size);
462463 goto out;
463464 }
drivers/gpu/drm/amd/amdkfd/kfd_iommu.c+12−1
@@ -62,9 +62,20 @@ int kfd_iommu_device_init(struct kfd_dev *kfd) · 61 unmodified lines
6262 struct amd_iommu_device_info iommu_info;
6363 unsigned int pasid_limit;
6464 int err;
65+ struct kfd_topology_device *top_dev;
6566
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;
6775 return 0;
76+ }
77+
78+ top_dev->node_props.capability |= HSA_CAP_ATS_PRESENT;
6879
6980 iommu_info.flags = 0;
7081 err = amd_iommu_device_info(kfd->pdev, &iommu_info);
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c+1−1
@@ -88,7 +88,7 @@ static int init_mqd(struct mqd_manager *mm, void **mqd, · 87 unmodified lines
8888 ALIGN(sizeof(struct v9_mqd), PAGE_SIZE),
8989 &((*mqd_mem_obj)->gtt_mem),
9090 &((*mqd_mem_obj)->gpu_addr),
91− (void *)&((*mqd_mem_obj)->cpu_ptr));
91+ (void *)&((*mqd_mem_obj)->cpu_ptr), true);
9292 } else
9393 retval = kfd_gtt_sa_allocate(mm->dev, sizeof(struct v9_mqd),
9494 mqd_mem_obj);
drivers/gpu/drm/amd/amdkfd/kfd_priv.h+1−0
@@ -806,6 +806,7 @@ int kfd_topology_add_device(struct kfd_dev *gpu); · 805 unmodified lines
806806 int kfd_topology_remove_device(struct kfd_dev *gpu);
807807 struct kfd_topology_device *kfd_topology_device_by_proximity_domain(
808808 uint32_t proximity_domain);
809+struct kfd_topology_device *kfd_topology_device_by_id(uint32_t gpu_id);
809810 struct kfd_dev *kfd_device_by_id(uint32_t gpu_id);
810811 struct kfd_dev *kfd_device_by_pci_dev(const struct pci_dev *pdev);
811812 int kfd_topology_enum_kfd_devices(uint8_t idx, struct kfd_dev **kdev);
drivers/gpu/drm/amd/amdkfd/kfd_topology.c+16−5
@@ -63,22 +63,33 @@ struct kfd_topology_device *kfd_topology_device_by_proximity_domain( · 62 unmodified lines
6363 return device;
6464 }
6565
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)
6767 {
68− struct kfd_topology_device *top_dev;
69− struct kfd_dev *device = NULL;
68+ struct kfd_topology_device *top_dev = NULL;
69+ struct kfd_topology_device *ret = NULL;
7070
7171 down_read(&topology_lock);
7272
7373 list_for_each_entry(top_dev, &topology_device_list, list)
7474 if (top_dev->gpu_id == gpu_id) {
75− device = top_dev->gpu;
75+ ret = top_dev;
7676 break;
7777 }
7878
7979 up_read(&topology_lock);
8080
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;
8293 }
8394
8495 struct kfd_dev *kfd_device_by_pci_dev(const struct pci_dev *pdev)
drivers/gpu/drm/amd/include/kgd_kfd_interface.h+1−1
@@ -292,7 +292,7 @@ struct tile_config { · 291 unmodified lines
292292 struct kfd2kgd_calls {
293293 int (*init_gtt_mem_allocation)(struct kgd_dev *kgd, size_t size,
294294 void **mem_obj, uint64_t *gpu_addr,
295− void **cpu_ptr);
295+ void **cpu_ptr, bool mqd_gfx9);
296296
297297 void (*free_gtt_mem)(struct kgd_dev *kgd, void *mem_obj);
298298

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t