summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-10-26 17:42:36 +0900
committerMichel Dänzer <michel.daenzer@amd.com>2016-11-21 17:53:43 +0900
commit40ddc52b2ae32b17ef7eea1602fdf59b63f06f17 (patch)
tree755da39de089761cb81edb68cbfcb7dc223d8b89 /src
parent5c9d1c5097e326c69f1be4427c62a0d348e8a4a6 (diff)
Use family information from libdrm_amdgpu / kernel
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src')
-rw-r--r--src/amdgpu_drv.h2
-rw-r--r--src/amdgpu_kms.c18
2 files changed, 6 insertions, 14 deletions
diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h
index 0f6bbf4..bafb6d4 100644
--- a/src/amdgpu_drv.h
+++ b/src/amdgpu_drv.h
@@ -193,7 +193,7 @@ typedef struct {
EntityInfoPtr pEnt;
pciVideoPtr PciInfo;
int Chipset;
- AMDGPUChipFamily ChipFamily;
+ uint32_t family;
struct gbm_device *gbm;
Bool(*CloseScreen) (CLOSE_SCREEN_ARGS_DECL);
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 4fb23bf..84a6cc4 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -53,7 +53,6 @@
#include <X11/extensions/damageproto.h>
-#include "amdgpu_chipinfo_gen.h"
#include "amdgpu_bo_helper.h"
#include "amdgpu_pixmap.h"
@@ -1159,10 +1158,10 @@ static Bool AMDGPUPreInitAccel_KMS(ScrnInfoPtr pScrn)
return TRUE;
}
-static Bool AMDGPUPreInitChipType_KMS(ScrnInfoPtr pScrn)
+static Bool AMDGPUPreInitChipType_KMS(ScrnInfoPtr pScrn,
+ struct amdgpu_gpu_info *gpu_info)
{
AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
- int i;
info->Chipset = PCI_DEV_DEVICE_ID(info->PciInfo);
pScrn->chipset =
@@ -1183,13 +1182,7 @@ static Bool AMDGPUPreInitChipType_KMS(ScrnInfoPtr pScrn)
"Chipset: \"%s\" (ChipID = 0x%04x)\n",
pScrn->chipset, info->Chipset);
- for (i = 0; i < sizeof(AMDGPUCards) / sizeof(AMDGPUCardInfo); i++) {
- if (info->Chipset == AMDGPUCards[i].pci_device_id) {
- AMDGPUCardInfo *card = &AMDGPUCards[i];
- info->ChipFamily = card->chip_family;
- break;
- }
- }
+ info->family = gpu_info->family_id;
return TRUE;
}
@@ -1332,7 +1325,7 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
memset(&gpu_info, 0, sizeof(gpu_info));
amdgpu_query_gpu_info(pAMDGPUEnt->pDev, &gpu_info);
- if (!AMDGPUPreInitChipType_KMS(pScrn))
+ if (!AMDGPUPreInitChipType_KMS(pScrn, &gpu_info))
goto fail;
info->dri2.available = FALSE;
@@ -1413,8 +1406,7 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
else
pAMDGPUEnt->HasCRTC2 = TRUE;
- if (info->ChipFamily >= CHIP_FAMILY_TAHITI &&
- info->ChipFamily <= CHIP_FAMILY_HAINAN) {
+ if (info->family < AMDGPU_FAMILY_CI) {
info->cursor_w = CURSOR_WIDTH;
info->cursor_h = CURSOR_HEIGHT;
} else {