Skip to content

Commit 9d65b1b

Browse files
amd-morriszhangalexdeucher
authored andcommitted
drm/amdgpu: add the accelerator PCIe class
Add the accelerator PCIe class and match the class in amdgpu for 0x1002 devices of that class. From PCI spec: "PCI Code and ID Assignment, r1.9, sec 1, 1.19" Signed-off-by: Shiwu Zhang <shiwu.zhang@amd.com> Acked-by: Lijo Lazar <lijo.lazar@amd.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> # pci_ids.h Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 11b92df commit 9d65b1b

4 files changed

Lines changed: 5 additions & 3 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2044,7 +2044,7 @@ static const struct pci_device_id pciidlist[] = {
20442044
.driver_data = CHIP_IP_DISCOVERY },
20452045

20462046
{ PCI_DEVICE(0x1002, PCI_ANY_ID),
2047-
.class = AMD_ACCELERATOR_PROCESSING << 8,
2047+
.class = PCI_CLASS_ACCELERATOR_PROCESSING << 8,
20482048
.class_mask = 0xffffff,
20492049
.driver_data = CHIP_IP_DISCOVERY },
20502050

drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void amdgpu_virt_init_setting(struct amdgpu_device *adev)
5757
/* enable virtual display */
5858
if (adev->asic_type != CHIP_ALDEBARAN &&
5959
adev->asic_type != CHIP_ARCTURUS &&
60-
((adev->pdev->class >> 8) != AMD_ACCELERATOR_PROCESSING)) {
60+
((adev->pdev->class >> 8) != PCI_CLASS_ACCELERATOR_PROCESSING)) {
6161
if (adev->mode_info.num_crtc == 0)
6262
adev->mode_info.num_crtc = 1;
6363
adev->enable_virtual_display = true;

drivers/gpu/drm/amd/include/amd_shared.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828

2929
#define AMD_MAX_USEC_TIMEOUT 1000000 /* 1000 ms */
30-
#define AMD_ACCELERATOR_PROCESSING 0x1200 /* hardcoded pci class */
3130

3231
/*
3332
* Chip flags

include/linux/pci_ids.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@
151151
#define PCI_CLASS_SP_DPIO 0x1100
152152
#define PCI_CLASS_SP_OTHER 0x1180
153153

154+
#define PCI_BASE_CLASS_ACCELERATOR 0x12
155+
#define PCI_CLASS_ACCELERATOR_PROCESSING 0x1200
156+
154157
#define PCI_CLASS_OTHERS 0xff
155158

156159
/* Vendors and devices. Sort key: vendor first, device next. */

0 commit comments

Comments
 (0)