Remove generated header files
cover Remove generated header files
From: Michel Dänzer <[email protected]>
This series removes the reliance on information in generated header files, and removes the generated header files. The main motivation for this is to remove the need to add PCI ID entries for each supported GPU.
Patch 6 relies on amdgpu_get_marketing_name from
https://patchwork.freedesktop.org/patch/110050/ , it will be updated to require the libdrm release containing that before pushing.
The series won't be pushed before the upcoming 1.2.0 release anyway.
Michel Dänzer (7):
Move struct amdgpu_gpu_info out of amdgpu_get_tile_config Use family information from libdrm_amdgpu / kernel Stop using generated amdgpu_device_match
Remove amdpciids.h
Stop using AMDGPUPciChipsets
Stop using AMDGPU(Unique)Chipsets
Remove generated header files
src/Makefile.am | 8 -- src/amdgpu_chipinfo_gen.h | 194 ---------------------------------- src/amdgpu_chipset_gen.h | 216 -------------------------------------- src/amdgpu_drv.h | 5 +- src/amdgpu_kms.c | 52 ++++----- src/amdgpu_pci_chipset_gen.h | 195 ---------------------------------- src/amdgpu_pci_device_match_gen.h | 195 ---------------------------------- src/amdgpu_probe.c | 22 ++-- src/amdgpu_probe.h | 29 ----- src/amdpciids.h | 39 ------- src/ati_pciids_gen.h | 191 --------------------------------- src/pcidb/ati_pciids.csv | 192 --------------------------------- src/pcidb/parse_pci_ids.pl | 82 --------------- 13 files changed, 32 insertions(+), 1388 deletions(-) delete mode 100644 src/amdgpu_chipinfo_gen.h delete mode 100644 src/amdgpu_chipset_gen.h delete mode 100644 src/amdgpu_pci_chipset_gen.h delete mode 100644 src/amdgpu_pci_device_match_gen.h delete mode 100644 src/amdpciids.h delete mode 100644 src/ati_pciids_gen.h delete mode 100644 src/pcidb/ati_pciids.csv delete mode 100755 src/pcidb/parse_pci_ids.pl
Signature · 6 lines
2.10.2 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20161101093125.17965-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org
PATCH 1/7 Move struct amdgpu_gpu_info out of amdgpu_get_tile_config
From: Michel Dänzer <[email protected]>
Preparation for the following change, no functional change intended.
--- src/amdgpu_kms.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)
src/amdgpu_kms.c +8 -10
@@ -1194,16 +1194,10 @@ static Bool AMDGPUPreInitChipType_KMS(ScrnInfoPtr pScrn)return TRUE; } -static Bool amdgpu_get_tile_config (ScrnInfoPtr pScrn) +static Bool amdgpu_get_tile_config (AMDGPUInfoPtr info, +struct amdgpu_gpu_info *gpu_info) { -AMDGPUInfoPtr info =AMDGPUPTR (pScrn); -AMDGPUEntPtr pAMDGPUEnt =AMDGPUEntPriv (pScrn); -struct amdgpu_gpu_info gpu_info; - -memset (&gpu_info,0 ,sizeof (gpu_info)); -amdgpu_query_gpu_info (pAMDGPUEnt->pDev, &gpu_info); - -switch ((gpu_info.gb_addr_cfg &0x70 ) >>4 ) { +switch ((gpu_info->gb_addr_cfg &0x70 ) >>4 ) {case 0 : info->group_bytes =256 ;break ;
@@ -1277,6 +1271,7 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags) {AMDGPUInfoPtr info;AMDGPUEntPtr pAMDGPUEnt; +struct amdgpu_gpu_info gpu_info;DevUnion *pPriv;Gamma zeros = {0.0 ,0.0 ,0.0 };int cpp;
@@ -1333,6 +1328,9 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)if (!AMDGPUPreInitWeight (pScrn)) goto fail; +memset (&gpu_info,0 ,sizeof (gpu_info)); +amdgpu_query_gpu_info (pAMDGPUEnt->pDev, &gpu_info); +if (!AMDGPUPreInitChipType_KMS (pScrn)) goto fail;
@@ -1359,7 +1357,7 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)/* set default group bytes, overridden by kernel info below */ info->group_bytes =256 ; info->have_tiling_info = FALSE; -amdgpu_get_tile_config (pScrn); +amdgpu_get_tile_config (info, &gpu_info); }if (info->use_glamor) {
Signature · 6 lines
2.10.2 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/7 Use family information from libdrm_amdgpu / kernel
In reply to a message not in the archiveFrom: Michel Dänzer <[email protected]>
--- src/amdgpu_drv.h | 2 +- src/amdgpu_kms.c | 18 +++++------------- 2 files changed, 6 insertions(+), 14 deletions(-)
src/amdgpu_drv.h +1 -1
@@ -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 );
src/amdgpu_kms.c +5 -13
@@ -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; }
@@ -1331,7 +1324,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;
@@ -1412,8 +1405,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 {
Signature · 6 lines
2.10.2 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/7 Stop using generated amdgpu_device_match
In reply to a message not in the archiveFrom: Michel Dänzer <[email protected]>
Just match on PCI device ID 0x1002.
--- src/amdgpu_probe.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
src/amdgpu_probe.c +6 -3
@@ -44,7 +44,6 @@#include "amdgpu_probe.h" #include "amdgpu_version.h" #include "amdgpu_drv.h" -#include "amdpciids.h" #include "xf86.h"
@@ -59,12 +58,11 @@#include <xf86platformBus.h> #endif +#include "ati_pciids_gen.h" #include "amdgpu_chipset_gen.h" #include "amdgpu_pci_chipset_gen.h" -#include "amdgpu_pci_device_match_gen.h" - _X_EXPORT int gAMDGPUEntityIndex = -1;/* Return the options for supported chipset 'n'; NULL otherwise */
@@ -386,6 +384,11 @@ error: }#endif +static const struct pci_id_match amdgpu_device_match[] = { + {0x1002 ,PCI_MATCH_ANY ,PCI_MATCH_ANY ,PCI_MATCH_ANY ,0 ,0 ,0 }, + {0 ,0 ,0 }, +}; + _X_EXPORT DriverRec AMDGPU = {AMDGPU_VERSION_CURRENT ,AMDGPU_DRIVER_NAME ,
Signature · 6 lines
2.10.2 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/7 Remove amdpciids.h
In reply to a message not in the archiveFrom: Michel Dänzer <[email protected]>
Not useful anymore.
--- src/Makefile.am | 1 - src/amdgpu_drv.h | 3 +-- src/amdgpu_kms.c | 4 +--- src/amdpciids.h | 39 --------------------------------------- 4 files changed, 2 insertions(+), 45 deletions(-) delete mode 100644 src/amdpciids.h
src/Makefile.am +0 -1
@@ -68,7 +68,6 @@ EXTRA_DIST = \ amdgpu_version.h \ amdgpu_video.h \ simple_list.h \ - amdpciids.h \ ati_pciids_gen.h \ amdgpu_chipinfo_gen.h \ amdgpu_chipset_gen.h \
src/amdgpu_drv.h +1 -2
@@ -86,7 +86,6 @@#include "compat-api.h" #include "simple_list.h" -#include "amdpciids.h" struct _SyncFence ;
@@ -191,7 +190,7 @@ struct amdgpu_client_priv { typedef struct { EntityInfoPtr pEnt; - pciVideoPtr PciInfo; + struct pci_device *PciInfo; int Chipset; uint32_t family; struct gbm_device *gbm;
src/amdgpu_kms.c +1 -3
@@ -41,8 +41,6 @@#include "shadow.h" #include <xf86Priv.h> -#include "amdpciids.h" -/* DPMS */ #ifdef HAVE_XEXTPROTO_71 #include <X11/extensions/dpmsconst.h>
@@ -1163,7 +1161,7 @@ static Bool AMDGPUPreInitChipType_KMS(ScrnInfoPtr pScrn, {AMDGPUInfoPtr info =AMDGPUPTR (pScrn); - info->Chipset =PCI_DEV_DEVICE_ID (info->PciInfo); + info->Chipset = info->PciInfo->device_id; pScrn->chipset = (char *)xf86TokenToString (AMDGPUChipsets, info->Chipset);if (!pScrn->chipset) {
src/amdpciids.h deleted +0 -39
@@ -1,39 +0,0 @@ -/* -* Copyright 2014 Advanced Micro Devices, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR -* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -* OTHER DEALINGS IN THE SOFTWARE. -* -*/ - - -#ifndef _AMDPCIIDS_H -#define _AMDPCIIDS_H - -#define PCI_VENDOR_ATI 0x1002 - -#include "ati_pciids_gen.h" - -typedef struct pci_device *pciVideoPtr ; - -#define PCI_DEV_DEVICE_ID (_pcidev) ((_pcidev)->device_id) - -#define ATI_DEVICE_MATCH (d, i) \ - { PCI_VENDOR_ATI, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) } - -#endif /* AMDPCIIDS_H */
Signature · 6 lines
2.10.2 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/7 Stop using AMDGPUPciChipsets
In reply to a message not in the archiveFrom: Michel Dänzer <[email protected]>
Not actually used by Xorg.
--- src/amdgpu_probe.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
src/amdgpu_probe.c +1 -3
@@ -61,8 +61,6 @@#include "ati_pciids_gen.h" #include "amdgpu_chipset_gen.h" -#include "amdgpu_pci_chipset_gen.h" - _X_EXPORT int gAMDGPUEntityIndex = -1;/* Return the options for supported chipset 'n'; NULL otherwise */
@@ -177,7 +175,7 @@ static Bool amdgpu_get_scrninfo(int entity_num, struct pci_device *pci_dev)DevUnion *pPriv;AMDGPUEntPtr pAMDGPUEnt; - pScrn =xf86ConfigPciEntity (pScrn,0 , entity_num, AMDGPUPciChipsets, + pScrn =xf86ConfigPciEntity (pScrn,0 , entity_num,NULL ,NULL ,NULL ,NULL ,NULL ,NULL );if (!pScrn)
Signature · 6 lines
2.10.2 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/7 Stop using AMDGPU(Unique)Chipsets
In reply to a message not in the archiveFrom: Michel Dänzer <[email protected]>
Use libdrm_amdgpu's amdgpu_get_marketing_name for the chipset name, or "Unknown AMD Radeon GPU" as a fallback.
--- src/amdgpu_kms.c | 12 ++++-------- src/amdgpu_probe.c | 11 ++++++----- 2 files changed, 10 insertions(+), 13 deletions(-)
src/amdgpu_kms.c +4 -8
@@ -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,
src/amdgpu_probe.c +6 -5
@@ -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)
Signature · 6 lines
2.10.2 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/7 Remove generated header files
In reply to a message not in the archiveFrom: Michel Dänzer <[email protected]>
No longer used.
--- src/Makefile.am | 7 -- src/amdgpu_chipinfo_gen.h | 194 ---------------------------------- src/amdgpu_chipset_gen.h | 216 -------------------------------------- src/amdgpu_pci_chipset_gen.h | 195 ---------------------------------- src/amdgpu_pci_device_match_gen.h | 195 ---------------------------------- src/amdgpu_probe.h | 29 ----- src/ati_pciids_gen.h | 191 --------------------------------- src/pcidb/ati_pciids.csv | 192 --------------------------------- src/pcidb/parse_pci_ids.pl | 82 --------------- 9 files changed, 1301 deletions(-) delete mode 100644 src/amdgpu_chipinfo_gen.h delete mode 100644 src/amdgpu_chipset_gen.h delete mode 100644 src/amdgpu_pci_chipset_gen.h delete mode 100644 src/amdgpu_pci_device_match_gen.h delete mode 100644 src/ati_pciids_gen.h delete mode 100644 src/pcidb/ati_pciids.csv delete mode 100755 src/pcidb/parse_pci_ids.pl
src/Makefile.am +0 -7
@@ -68,12 +68,5 @@ EXTRA_DIST = \ amdgpu_version.h \ amdgpu_video.h \ simple_list.h \ - ati_pciids_gen.h \ - amdgpu_chipinfo_gen.h \ - amdgpu_chipset_gen.h \ - amdgpu_pci_chipset_gen.h \ - amdgpu_pci_device_match_gen.h \ - pcidb/ati_pciids.csv \ - pcidb/parse_pci_ids.pl \ amdgpu_dri2.h \ drmmode_display.h
src/amdgpu_chipinfo_gen.h deleted +0 -194
194 lines not on this page · raw message
src/amdgpu_chipset_gen.h deleted +0 -216
216 lines not on this page · raw message
src/amdgpu_pci_chipset_gen.h deleted +0 -195
195 lines not on this page · raw message
src/amdgpu_pci_device_match_gen.h deleted +0 -195
195 lines not on this page · raw message
src/amdgpu_probe.h +0 -29
@@ -54,35 +54,6 @@extern DriverRec AMDGPU ; -typedef enum { -CHIP_FAMILY_UNKNOW , -CHIP_FAMILY_LEGACY , -CHIP_FAMILY_AMDGPU , -CHIP_FAMILY_TAHITI , -CHIP_FAMILY_PITCAIRN , -CHIP_FAMILY_VERDE , -CHIP_FAMILY_OLAND , -CHIP_FAMILY_HAINAN , -CHIP_FAMILY_BONAIRE , -CHIP_FAMILY_KAVERI , -CHIP_FAMILY_KABINI , -CHIP_FAMILY_HAWAII , -CHIP_FAMILY_MULLINS , -CHIP_FAMILY_TOPAZ , -CHIP_FAMILY_TONGA , -CHIP_FAMILY_CARRIZO , -CHIP_FAMILY_FIJI , -CHIP_FAMILY_STONEY , -CHIP_FAMILY_POLARIS10 , -CHIP_FAMILY_POLARIS11 , -CHIP_FAMILY_LAST -}AMDGPUChipFamily ; - -typedef struct { -uint32_t pci_device_id; -AMDGPUChipFamily chip_family; -}AMDGPUCardInfo ; - typedef struct { Bool HasCRTC2; /* All cards except original Radeon */
src/ati_pciids_gen.h deleted +0 -191
191 lines not on this page · raw message
src/pcidb/ati_pciids.csv deleted +0 -192
192 lines not on this page · raw message
src/pcidb/parse_pci_ids.pl deleted +0 -82
82 lines not on this page · raw message
Signature · 6 lines
2.10.2 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Deucher, Alexander
Reviewed-by Alex DeucherQuoted 14 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Michel Dänzer
Sent: Tuesday, November 01, 2016 5:31 AM
To: [email protected]
Subject: [PATCH xf86-video-amdgpu 0/7] Remove generated header filesFrom: Michel Dänzer <[email protected]>
This series removes the reliance on information in generated header files, and removes the generated header files. The main motivation for this is to remove the need to add PCI ID entries for each supported GPU.
Quoted 5 lines
Patch 6 relies on
amdgpu_get_marketing_namefrom
https://patchwork.freedesktop.org/patch/110050/ , it will be updated to require the libdrm release containing that before pushing.The series won't be pushed before the upcoming 1.2.0 release anyway.
Series is:
Quoted 33 lines
Michel Dänzer (7):
Move structamdgpu_gpu_infoout ofamdgpu_get_tile_configUse family information fromlibdrm_amdgpu/ kernel Stop using generatedamdgpu_device_match
Removeamdpciids.h
Stop using AMDGPUPciChipsets
Stop using AMDGPU(Unique)Chipsets
Remove generated header filessrc/Makefile.am | 8 -- src/amdgpu_chipinfo_gen.h | 194 ---------------------------------- src/amdgpu_chipset_gen.h | 216 -------------------------------------- src/amdgpu_drv.h | 5 +- src/amdgpu_kms.c | 52 ++++----- src/amdgpu_pci_chipset_gen.h | 195 ---------------------------------- src/amdgpu_pci_device_match_gen.h | 195 ---------------------------------- src/amdgpu_probe.c | 22 ++-- src/amdgpu_probe.h | 29 ----- src/amdpciids.h | 39 ------- src/ati_pciids_gen.h | 191 --------------------------------- src/pcidb/ati_pciids.csv | 192 --------------------------------- src/pcidb/parse_pci_ids.pl | 82 --------------- 13 files changed, 32 insertions(+), 1388 deletions(-) delete mode 100644 src/amdgpu_chipinfo_gen.h delete mode 100644 src/amdgpu_chipset_gen.h delete mode 100644 src/amdgpu_pci_chipset_gen.h delete mode 100644 src/amdgpu_pci_device_match_gen.h delete mode 100644 src/amdpciids.h delete mode 100644 src/ati_pciids_gen.h delete mode 100644 src/pcidb/ati_pciids.csv delete mode 100755 src/pcidb/parse_pci_ids.pl
Quoted 7 lines
--
2.10.2_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx