Stop using AMDGPU(Unique)Chipsets

Use libdrm_amdgpu's amdgpu_get_marketing_name for the chipset name, or
"Unknown AMD Radeon GPU" as a fallback.

v2: Require libdrm_amdgpu >= 2.4.72 for amdgpu_get_marketing_name

Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
This commit is contained in:
Michel Dänzer
2016-10-26 18:36:18 +09:00
parent 8a5ff54af3
commit d69fd22b6d
3 changed files with 11 additions and 14 deletions

View File

@@ -70,7 +70,7 @@ XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
# Checks for libraries.
PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.58])
PKG_CHECK_MODULES(LIBDRM_AMDGPU, [libdrm_amdgpu])
PKG_CHECK_MODULES(LIBDRM_AMDGPU, [libdrm_amdgpu >= 2.4.72])
PKG_CHECK_MODULES(GBM, [gbm])
# Obtain compiler/linker options for the driver dependencies

View File

@@ -58,7 +58,6 @@
static DevScreenPrivateKeyRec amdgpu_client_private_key;
extern SymTabRec AMDGPUChipsets[];
static Bool amdgpu_setup_kernel_mem(ScreenPtr pScreen);
const OptionInfoRec AMDGPUOptions_KMS[] = {
@@ -1160,15 +1159,12 @@ static Bool AMDGPUPreInitChipType_KMS(ScrnInfoPtr pScrn,
struct amdgpu_gpu_info *gpu_info)
{
AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
info->Chipset = info->PciInfo->device_id;
pScrn->chipset =
(char *)xf86TokenToString(AMDGPUChipsets, info->Chipset);
if (!pScrn->chipset) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"ChipID 0x%04x is not recognized\n", info->Chipset);
return FALSE;
}
pScrn->chipset = amdgpu_get_marketing_name(pAMDGPUEnt->pDev);
if (!pScrn->chipset)
pScrn->chipset = "Unknown AMD Radeon GPU";
if (info->Chipset < 0) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,

View File

@@ -58,9 +58,6 @@
#include <xf86platformBus.h>
#endif
#include "ati_pciids_gen.h"
#include "amdgpu_chipset_gen.h"
_X_EXPORT int gAMDGPUEntityIndex = -1;
/* Return the options for supported chipset 'n'; NULL otherwise */
@@ -69,11 +66,15 @@ static const OptionInfoRec *AMDGPUAvailableOptions(int chipid, int busid)
return AMDGPUOptionsWeak();
}
static SymTabRec AMDGPUAny[] = {
{ 0, "All GPUs supported by the amdgpu kernel driver" },
{ -1, NULL }
};
/* Return the string name for supported chipset 'n'; NULL otherwise. */
static void AMDGPUIdentify(int flags)
{
xf86PrintChipsets(AMDGPU_NAME,
"Driver for AMD Radeon chipsets", AMDGPUUniqueChipsets);
xf86PrintChipsets(AMDGPU_NAME, "Driver for AMD Radeon", AMDGPUAny);
}
static char *amdgpu_bus_id(ScrnInfoPtr pScrn, struct pci_device *dev)