Re: [1/4] amdgpu: add the function to get the marketing name (v2)
On 13/09/16 12:14 AM, Alex Deucher wrote: > From: Junwei Zhang> > This function is used to look up the marking name > for a specific board. > > v2: agd: Squash in subsequent updates to the table. As is, this breaks make check: > +struct amdgpu_asic_id_table_t { Make this static, so the amdgpu_asic_id_table_t symbol doesn't get exported from libdrm_amdgpu. BTW, is there any particular reason for putting this table in a separate header file? > @@ -303,3 +304,17 @@ int amdgpu_device_deinitialize(amdgpu_device_handle dev) > amdgpu_device_reference(, NULL); > return 0; > } > + > +const char *amdgpu_get_marketing_name(amdgpu_device_handle dev) amdgpu_get_marketing_name needs to be added to amdgpu-symbols-check. > + if ((t->did == dev->info.asic_id) && > + (t->rid == dev->info.pci_rev_id)) Wrong indentation of the second line. With these issues fixed, Reviewed-by: Michel Dänzer Would be nice to land this in master soon, as we're going to use it in xf86-video-amdgpu: https://patchwork.freedesktop.org/patch/119501/ -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH] drm/amdgpu: Add a ring type KIQ definition
Just send to amd-gfx is enough, Please use --cover-letter and please use git-send-email Besides, is KIQ primary part submitted to all open staging ? if not why submit those three patches BR Monk -Original Message- From: Trigger Huang [mailto:trigger.hu...@amd.com] Sent: Tuesday, November 01, 2016 3:20 PM To: amd-gfx@lists.freedesktop.org Cc: Liu, Monk; Yu, Xiangliang ; Huang, Trigger Subject: [PATCH] drm/amdgpu: Add a ring type KIQ definition Add a new ring type definition for KIQ. KIQ is used for interaction between driver and CP. Signed-off-by: Xiangliang Yu Signed-off-by: Trigger Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h index 1ee1b65..92bc89b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h @@ -44,7 +44,8 @@ enum amdgpu_ring_type { AMDGPU_RING_TYPE_COMPUTE, AMDGPU_RING_TYPE_SDMA, AMDGPU_RING_TYPE_UVD, - AMDGPU_RING_TYPE_VCE + AMDGPU_RING_TYPE_VCE, + AMDGPU_RING_TYPE_KIQ }; struct amdgpu_device; -- 2.7.4 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH xf86-video-amdgpu 7/7] Remove generated header files
From: Michel DänzerNo longer used. Signed-off-by: Michel Dänzer --- 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 diff --git a/src/Makefile.am b/src/Makefile.am index 8cc1362..7468bba 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 diff --git a/src/amdgpu_chipinfo_gen.h b/src/amdgpu_chipinfo_gen.h deleted file mode 100644 index 90b13bb..000 --- a/src/amdgpu_chipinfo_gen.h +++ /dev/null @@ -1,194 +0,0 @@ -/* This file is autogenerated please do not edit */ -static AMDGPUCardInfo AMDGPUCards[] = { - { 0x6600, CHIP_FAMILY_OLAND }, - { 0x6601, CHIP_FAMILY_OLAND }, - { 0x6602, CHIP_FAMILY_OLAND }, - { 0x6603, CHIP_FAMILY_OLAND }, - { 0x6604, CHIP_FAMILY_OLAND }, - { 0x6605, CHIP_FAMILY_OLAND }, - { 0x6606, CHIP_FAMILY_OLAND }, - { 0x6607, CHIP_FAMILY_OLAND }, - { 0x6608, CHIP_FAMILY_OLAND }, - { 0x6610, CHIP_FAMILY_OLAND }, - { 0x6611, CHIP_FAMILY_OLAND }, - { 0x6613, CHIP_FAMILY_OLAND }, - { 0x6617, CHIP_FAMILY_OLAND }, - { 0x6620, CHIP_FAMILY_OLAND }, - { 0x6621, CHIP_FAMILY_OLAND }, - { 0x6623, CHIP_FAMILY_OLAND }, - { 0x6631, CHIP_FAMILY_OLAND }, - { 0x6660, CHIP_FAMILY_HAINAN }, - { 0x6663, CHIP_FAMILY_HAINAN }, - { 0x6664, CHIP_FAMILY_HAINAN }, - { 0x6665, CHIP_FAMILY_HAINAN }, - { 0x6667, CHIP_FAMILY_HAINAN }, - { 0x666F, CHIP_FAMILY_HAINAN }, - { 0x6780, CHIP_FAMILY_TAHITI }, - { 0x6784, CHIP_FAMILY_TAHITI }, - { 0x6788, CHIP_FAMILY_TAHITI }, - { 0x678A, CHIP_FAMILY_TAHITI }, - { 0x6790, CHIP_FAMILY_TAHITI }, - { 0x6791, CHIP_FAMILY_TAHITI }, - { 0x6792, CHIP_FAMILY_TAHITI }, - { 0x6798, CHIP_FAMILY_TAHITI }, - { 0x6799, CHIP_FAMILY_TAHITI }, - { 0x679A, CHIP_FAMILY_TAHITI }, - { 0x679B, CHIP_FAMILY_TAHITI }, - { 0x679E, CHIP_FAMILY_TAHITI }, - { 0x679F, CHIP_FAMILY_TAHITI }, - { 0x6800, CHIP_FAMILY_PITCAIRN }, - { 0x6801, CHIP_FAMILY_PITCAIRN }, - { 0x6802, CHIP_FAMILY_PITCAIRN }, - { 0x6806, CHIP_FAMILY_PITCAIRN }, - { 0x6808, CHIP_FAMILY_PITCAIRN }, - { 0x6809, CHIP_FAMILY_PITCAIRN }, - { 0x6810, CHIP_FAMILY_PITCAIRN }, - { 0x6811, CHIP_FAMILY_PITCAIRN }, - { 0x6816, CHIP_FAMILY_PITCAIRN }, - { 0x6817, CHIP_FAMILY_PITCAIRN }, - { 0x6818, CHIP_FAMILY_PITCAIRN }, - { 0x6819, CHIP_FAMILY_PITCAIRN }, - { 0x6820, CHIP_FAMILY_VERDE }, - { 0x6821, CHIP_FAMILY_VERDE }, - { 0x6822, CHIP_FAMILY_VERDE }, - { 0x6823, CHIP_FAMILY_VERDE }, - { 0x6824, CHIP_FAMILY_VERDE }, - { 0x6825, CHIP_FAMILY_VERDE }, - { 0x6826, CHIP_FAMILY_VERDE }, - { 0x6827, CHIP_FAMILY_VERDE }, - { 0x6828, CHIP_FAMILY_VERDE }, - { 0x6829, CHIP_FAMILY_VERDE }, - { 0x682A, CHIP_FAMILY_VERDE }, - { 0x682B, CHIP_FAMILY_VERDE }, - { 0x682C, CHIP_FAMILY_VERDE }, - { 0x682D, CHIP_FAMILY_VERDE }, - { 0x682F, CHIP_FAMILY_VERDE }, - { 0x6830, CHIP_FAMILY_VERDE }, - { 0x6831, CHIP_FAMILY_VERDE }, - { 0x6835, CHIP_FAMILY_VERDE }, - { 0x6837, CHIP_FAMILY_VERDE }, - { 0x6838, CHIP_FAMILY_VERDE }, - { 0x6839, CHIP_FAMILY_VERDE }, - { 0x683B, CHIP_FAMILY_VERDE }, - { 0x683D, CHIP_FAMILY_VERDE }, - { 0x683F, CHIP_FAMILY_VERDE }, - { 0x684C, CHIP_FAMILY_PITCAIRN }, - { 0x6640, CHIP_FAMILY_BONAIRE }, - { 0x6641, CHIP_FAMILY_BONAIRE }, - { 0x6646, CHIP_FAMILY_BONAIRE }, - { 0x6647, CHIP_FAMILY_BONAIRE }, - { 0x6649, CHIP_FAMILY_BONAIRE }, - { 0x6650, CHIP_FAMILY_BONAIRE }, - { 0x6651, CHIP_FAMILY_BONAIRE }, - { 0x6658, CHIP_FAMILY_BONAIRE }, - { 0x665C, CHIP_FAMILY_BONAIRE }, - { 0x665D, CHIP_FAMILY_BONAIRE }, - { 0x665F, CHIP_FAMILY_BONAIRE }, - { 0x9830, CHIP_FAMILY_KABINI }, - { 0x9831, CHIP_FAMILY_KABINI }, - { 0x9832, CHIP_FAMILY_KABINI }, - { 0x9833, CHIP_FAMILY_KABINI }, - { 0x9834, CHIP_FAMILY_KABINI }, - { 0x9835, CHIP_FAMILY_KABINI }, - { 0x9836, CHIP_FAMILY_KABINI }, - { 0x9837, CHIP_FAMILY_KABINI },
[PATCH xf86-video-amdgpu 6/7] Stop using AMDGPU(Unique)Chipsets
From: Michel DänzerUse libdrm_amdgpu's amdgpu_get_marketing_name for the chipset name, or "Unknown AMD Radeon GPU" as a fallback. Signed-off-by: Michel Dänzer --- src/amdgpu_kms.c | 12 src/amdgpu_probe.c | 11 ++- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c index 890add5..1f5e6f0 100644 --- a/src/amdgpu_kms.c +++ b/src/amdgpu_kms.c @@ -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, diff --git a/src/amdgpu_probe.c b/src/amdgpu_probe.c index acc0433..301e586 100644 --- a/src/amdgpu_probe.c +++ b/src/amdgpu_probe.c @@ -58,9 +58,6 @@ #include #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) -- 2.10.2 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH xf86-video-amdgpu 4/7] Remove amdpciids.h
From: Michel DänzerNot useful anymore. Signed-off-by: Michel Dänzer --- 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 diff --git a/src/Makefile.am b/src/Makefile.am index a851b3b..8cc1362 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 \ diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h index 62aa1c1..36cf26a 100644 --- a/src/amdgpu_drv.h +++ b/src/amdgpu_drv.h @@ -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; diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c index 68570e4..890add5 100644 --- a/src/amdgpu_kms.c +++ b/src/amdgpu_kms.c @@ -41,8 +41,6 @@ #include "shadow.h" #include -#include "amdpciids.h" - /* DPMS */ #ifdef HAVE_XEXTPROTO_71 #include @@ -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) { diff --git a/src/amdpciids.h b/src/amdpciids.h deleted file mode 100644 index 33ec6da..000 --- a/src/amdpciids.h +++ /dev/null @@ -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 */ -- 2.10.2 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH xf86-video-amdgpu 5/7] Stop using AMDGPUPciChipsets
From: Michel DänzerNot actually used by Xorg. Signed-off-by: Michel Dänzer --- src/amdgpu_probe.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/amdgpu_probe.c b/src/amdgpu_probe.c index fb6f8a3..acc0433 100644 --- a/src/amdgpu_probe.c +++ b/src/amdgpu_probe.c @@ -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) -- 2.10.2 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH] drm/amdgpu: Add a ring type KIQ definition
Add a new ring type definition for KIQ. KIQ is used for interaction between driver and CP. Signed-off-by: Xiangliang YuSigned-off-by: Trigger Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h index 1ee1b65..92bc89b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h @@ -44,7 +44,8 @@ enum amdgpu_ring_type { AMDGPU_RING_TYPE_COMPUTE, AMDGPU_RING_TYPE_SDMA, AMDGPU_RING_TYPE_UVD, - AMDGPU_RING_TYPE_VCE + AMDGPU_RING_TYPE_VCE, + AMDGPU_RING_TYPE_KIQ }; struct amdgpu_device; -- 2.7.4 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH xf86-video-amdgpu 0/7] Remove generated header files
From: Michel DänzerThis 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 -- 2.10.2 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH] drm/amdgpu: fix the issue that nodes[0] is not removed from the allocator
Change-Id: Id960af4bf93036a8a39306c374e2cafdc1bef055 Signed-off-by: JimQu--- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c index 180eed7c..6933f4a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c @@ -100,7 +100,7 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man, enum drm_mm_search_flags sflags = DRM_MM_SEARCH_DEFAULT; enum drm_mm_allocator_flags aflags = DRM_MM_CREATE_DEFAULT; unsigned long lpfn, num_nodes, pages_per_node, pages_left; - unsigned i; + unsigned i, j; int r; lpfn = place->lpfn; @@ -155,8 +155,8 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man, return 0; error: - while (i--) - drm_mm_remove_node([i]); + for (j = 0; j < i; j++) + drm_mm_remove_node([j]); spin_unlock(>lock); kfree(nodes); -- 1.9.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH xf86-video-amdgpu] Require xserver 1.10 or newer
On Tue, Nov 1, 2016 at 3:10 AM, Michel Dänzerwrote: > From: Michel Dänzer > > 1.10.0 was released in February 2011. > > We've been accidentally requiring 1.10 or newer since c7d27c94cb65 ("Keep > track of damage event related flushes per-client"). > > (Ported from radeon commit 5df36de39952c3a26cb2fbc125f298139a9dd5bc) > > Signed-off-by: Michel Dänzer Reviewed-by: Alex Deucher > --- > configure.ac | 2 +- > src/amdgpu_drv.h | 2 -- > src/amdgpu_kms.c | 6 -- > src/amdgpu_probe.c| 5 - > src/drmmode_display.c | 7 --- > src/drmmode_display.h | 2 -- > 6 files changed, 1 insertion(+), 23 deletions(-) > > diff --git a/configure.ac b/configure.ac > index b436db5..abdeb40 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -74,7 +74,7 @@ PKG_CHECK_MODULES(LIBDRM_AMDGPU, [libdrm_amdgpu]) > PKG_CHECK_MODULES(GBM, [gbm]) > > # Obtain compiler/linker options for the driver dependencies > -PKG_CHECK_MODULES(XORG, [xorg-server >= 1.9 xproto fontsproto xf86driproto > $REQUIRED_MODULES]) > +PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10 xproto fontsproto xf86driproto > $REQUIRED_MODULES]) > PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1], >HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, > [xextproto 7.1 available]), >HAVE_XEXTPROTO_71="no") > diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h > index fc6a79d..0f6bbf4 100644 > --- a/src/amdgpu_drv.h > +++ b/src/amdgpu_drv.h > @@ -227,9 +227,7 @@ typedef struct { > DisplayModePtr currentMode; > > CreateScreenResourcesProcPtr CreateScreenResources; > -#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 10 > CreateWindowProcPtr CreateWindow; > -#endif > > Bool IsSecondary; > > diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c > index 6fa63e9..acf3a7d 100644 > --- a/src/amdgpu_kms.c > +++ b/src/amdgpu_kms.c > @@ -1245,8 +1245,6 @@ static void AMDGPUSetupCapabilities(ScrnInfoPtr pScrn) > #endif > } > > -#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 10 > - > /* When the root window is created, initialize the screen contents from > * console if -background none was specified on the command line > */ > @@ -1271,8 +1269,6 @@ static Bool AMDGPUCreateWindow_oneshot(WindowPtr pWin) > return ret; > } > > -#endif > - > Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags) > { > AMDGPUInfoPtr info; > @@ -1820,12 +1816,10 @@ Bool AMDGPUScreenInit_KMS(SCREEN_INIT_ARGS_DECL) > } > pScrn->pScreen = pScreen; > > -#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 10 > if (serverGeneration == 1 && bgNoneRoot && info->use_glamor) { > info->CreateWindow = pScreen->CreateWindow; > pScreen->CreateWindow = AMDGPUCreateWindow_oneshot; > } > -#endif > > /* Provide SaveScreen & wrap BlockHandler and CloseScreen */ > /* Wrap CloseScreen */ > diff --git a/src/amdgpu_probe.c b/src/amdgpu_probe.c > index 213d245..52e962d 100644 > --- a/src/amdgpu_probe.c > +++ b/src/amdgpu_probe.c > @@ -84,13 +84,8 @@ static char *amdgpu_bus_id(ScrnInfoPtr pScrn, struct > pci_device *dev) > { > char *busid; > > -#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,9,99,901,0) > XNFasprintf(, "pci:%04x:%02x:%02x.%d", > dev->domain, dev->bus, dev->dev, dev->func); > -#else > - busid = XNFprintf("pci:%04x:%02x:%02x.%d", > - dev->domain, dev->bus, dev->dev, dev->func); > -#endif > > if (!busid) > xf86DrvMsgVerb(pScrn->scrnIndex, X_ERROR, 0, > diff --git a/src/drmmode_display.c b/src/drmmode_display.c > index b03a8a7..f514866 100644 > --- a/src/drmmode_display.c > +++ b/src/drmmode_display.c > @@ -327,8 +327,6 @@ drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode) > crtc->x, crtc->y); > } > > -#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 10 > - > static PixmapPtr > create_pixmap_for_fbcon(drmmode_ptr drmmode, > ScrnInfoPtr pScrn, int fbcon_id) > @@ -442,8 +440,6 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr > drmmode) > return; > } > > -#endif /* GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 10 */ > - > static void > drmmode_crtc_scanout_destroy(drmmode_ptr drmmode, > struct drmmode_scanout *scanout) > @@ -1981,9 +1977,6 @@ static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, > int width, int height) >width, height, -1, -1, pitch, >info->fb_shadow); > } > -#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,9,99,1,0) > - scrn->pixmapPrivate.ptr = ppix->devPrivate.ptr; > -#endif > > if (!amdgpu_glamor_create_screen_resources(scrn->pScreen)) > goto fail; > diff --git a/src/drmmode_display.h
答复: [PATCH] drm/amdgpu: fix the issue that nodes[0] is not removed from the allocator
Please ignore this patch. I make a mistake. Thanks JimQu 发件人: jimqu发送时间: 2016年11月1日 17:21 收件人: amd-gfx@lists.freedesktop.org 抄送: Qu, Jim 主题: [PATCH] drm/amdgpu: fix the issue that nodes[0] is not removed from the allocator Change-Id: Id960af4bf93036a8a39306c374e2cafdc1bef055 Signed-off-by: JimQu --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c index 180eed7c..6933f4a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c @@ -100,7 +100,7 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man, enum drm_mm_search_flags sflags = DRM_MM_SEARCH_DEFAULT; enum drm_mm_allocator_flags aflags = DRM_MM_CREATE_DEFAULT; unsigned long lpfn, num_nodes, pages_per_node, pages_left; - unsigned i; + unsigned i, j; int r; lpfn = place->lpfn; @@ -155,8 +155,8 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man, return 0; error: - while (i--) - drm_mm_remove_node([i]); + for (j = 0; j < i; j++) + drm_mm_remove_node([j]); spin_unlock(>lock); kfree(nodes); -- 1.9.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH] drm/amdgpu:bypass avfs event manager for sriov
> -Original Message- > From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf > Of Trigger Huang > Sent: Tuesday, November 01, 2016 3:23 AM > To: amd-gfx@lists.freedesktop.org > Cc: Min, Frank; Yu, Xiangliang; Liu, Monk; Huang, Trigger > Subject: [PATCH] drm/amdgpu:bypass avfs event manager for sriov > > This patch is used for virtualization support. In virtualization case, > the initialization sequences are not totally the same as > non-Virtualization's. The avfs event manager should be bypassed if in > SRIOV virtualization case. > > Signed-off-by: Frank Min> Signed-off-by: Xiangliang Yu > Signed-off-by: Trigger Huang Doesn't tonga need something similar? Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c > b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c > index b86e48f..26eff56 100755 > --- a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c > +++ b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c > @@ -396,7 +396,8 @@ static int fiji_start_smu(struct pp_smumgr *smumgr) > struct fiji_smumgr *priv = (struct fiji_smumgr *)(smumgr->backend); > > /* Only start SMC if SMC RAM is not running */ > - if (!smu7_is_smc_ram_running(smumgr)) { > + if (!(smu7_is_smc_ram_running(smumgr) > + || cgs_is_virtualization_enabled(smumgr->device))) { > fiji_avfs_event_mgr(smumgr, false); > > /* Check if SMU is running in protected mode */ > @@ -443,6 +444,9 @@ static bool fiji_is_hw_avfs_present(struct > pp_smumgr *smumgr) > uint32_t efuse = 0; > uint32_t mask = (1 << ((AVFS_EN_MSB - AVFS_EN_LSB) + 1)) - 1; > > + if (cgs_is_virtualization_enabled(smumgr->device)) > + return 0; > + > if (!atomctrl_read_efuse(smumgr->device, AVFS_EN_LSB, > AVFS_EN_MSB, > mask, )) { > if (efuse) > -- > 2.7.4 > > ___ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH xf86-video-amdgpu 0/7] Remove generated header files
> -Original Message- > From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf > Of Michel Dänzer > Sent: Tuesday, November 01, 2016 5:31 AM > To: amd-gfx@lists.freedesktop.org > Subject: [PATCH xf86-video-amdgpu 0/7] Remove generated header files > > From: Michel Dänzer> > 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. Series is: Reviewed-by: Alex Deucher > > 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 > > -- > 2.10.2 > > ___ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH] drm/amdgpu:no gpu scheduler for KIQ
> -Original Message- > From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf > Of Trigger Huang > Sent: Tuesday, November 01, 2016 3:22 AM > To: amd-gfx@lists.freedesktop.org > Cc: Yu, Xiangliang; Liu, Monk; Huang, Trigger > Subject: [PATCH] drm/amdgpu:no gpu scheduler for KIQ > > KIQ is used for interaction between driver and > CP, and not exposed to outside client, as such it > doesn't need to be handled by GPU scheduler. > > Signed-off-by: Monk Liu> Signed-off-by: Xiangliang Yu > Signed-off-by: Trigger Huang > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 4 > drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 6 -- > 2 files changed, 8 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c > index 77b34ec..c2a2d19 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c > @@ -382,6 +382,10 @@ int amdgpu_fence_driver_init_ring(struct > amdgpu_ring *ring, > if (!ring->fence_drv.fences) > return -ENOMEM; > > + /* Doesn't need gpu scheduler */ > + if (!num_hw_submission) > + return 0; > + Rather than returning early here, I'd suggest wrapping the scheduler setup conditionally. E.g., if (num_hw_submission) { /* setup scheduler */ } That way if we add anything else to that function, we don't accidently break KIQ. With that fixed: Reviewed-by: Alex Deucher Alex > timeout = msecs_to_jiffies(amdgpu_lockup_timeout); > if (timeout == 0) { > /* > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c > index 4c99282..a254c38 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c > @@ -168,6 +168,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, > struct amdgpu_ring *ring, >unsigned irq_type) > { > int r; > + int entry_num = amdgpu_sched_hw_submission; > > if (ring->adev == NULL) { > if (adev->num_rings >= AMDGPU_MAX_RINGS) > @@ -176,8 +177,9 @@ int amdgpu_ring_init(struct amdgpu_device *adev, > struct amdgpu_ring *ring, > ring->adev = adev; > ring->idx = adev->num_rings++; > adev->rings[ring->idx] = ring; > - r = amdgpu_fence_driver_init_ring(ring, > - amdgpu_sched_hw_submission); > + if (ring->funcs->type == AMDGPU_RING_TYPE_KIQ) > + entry_num = 0; > + r = amdgpu_fence_driver_init_ring(ring, entry_num); > if (r) > return r; > } > -- > 2.7.4 > > ___ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH] drm/amdgpu: Add a ring type KIQ definition
> -Original Message- > From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf > Of Trigger Huang > Sent: Tuesday, November 01, 2016 3:20 AM > To: amd-gfx@lists.freedesktop.org > Cc: Yu, Xiangliang; Liu, Monk; Huang, Trigger > Subject: [PATCH] drm/amdgpu: Add a ring type KIQ definition > > Add a new ring type definition for KIQ. KIQ is used for interaction > between driver and CP. > > Signed-off-by: Xiangliang Yu> Signed-off-by: Trigger Huang Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h > b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h > index 1ee1b65..92bc89b 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h > @@ -44,7 +44,8 @@ enum amdgpu_ring_type { > AMDGPU_RING_TYPE_COMPUTE, > AMDGPU_RING_TYPE_SDMA, > AMDGPU_RING_TYPE_UVD, > - AMDGPU_RING_TYPE_VCE > + AMDGPU_RING_TYPE_VCE, > + AMDGPU_RING_TYPE_KIQ > }; > > struct amdgpu_device; > -- > 2.7.4 > > ___ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu:no gpu scheduler for KIQ
Am 01.11.2016 um 16:27 schrieb Deucher, Alexander: -Original Message- From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf Of Trigger Huang Sent: Tuesday, November 01, 2016 3:22 AM To: amd-gfx@lists.freedesktop.org Cc: Yu, Xiangliang; Liu, Monk; Huang, Trigger Subject: [PATCH] drm/amdgpu:no gpu scheduler for KIQ KIQ is used for interaction between driver and CP, and not exposed to outside client, as such it doesn't need to be handled by GPU scheduler. Signed-off-by: Monk LiuSigned-off-by: Xiangliang Yu Signed-off-by: Trigger Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 4 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 6 -- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c index 77b34ec..c2a2d19 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c @@ -382,6 +382,10 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring, if (!ring->fence_drv.fences) return -ENOMEM; + /* Doesn't need gpu scheduler */ + if (!num_hw_submission) + return 0; + Rather than returning early here, I'd suggest wrapping the scheduler setup conditionally. E.g., if (num_hw_submission) { /* setup scheduler */ } That way if we add anything else to that function, we don't accidently break KIQ. With that fixed: Reviewed-by: Alex Deucher Alex timeout = msecs_to_jiffies(amdgpu_lockup_timeout); if (timeout == 0) { /* diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c index 4c99282..a254c38 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c @@ -168,6 +168,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, unsigned irq_type) { int r; + int entry_num = amdgpu_sched_hw_submission; Additionally to Alex comment above please move the new local variable into the "if" where it is used. With that fixed the patch is Reviewed-by: Christian König as well. Regards, Christian. if (ring->adev == NULL) { if (adev->num_rings >= AMDGPU_MAX_RINGS) @@ -176,8 +177,9 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, ring->adev = adev; ring->idx = adev->num_rings++; adev->rings[ring->idx] = ring; - r = amdgpu_fence_driver_init_ring(ring, - amdgpu_sched_hw_submission); + if (ring->funcs->type == AMDGPU_RING_TYPE_KIQ) + entry_num = 0; + r = amdgpu_fence_driver_init_ring(ring, entry_num); if (r) return r; } -- 2.7.4 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH] drm/amdgpu:bypass avfs event manager for sriov
Tonga have no avfs event manager, Trigger, please take care and double check you didn't lost tonga's patch, we are more concern if Tonga could support SRIOV than FIJI BR Monk -Original Message- From: Deucher, Alexander Sent: Tuesday, November 01, 2016 11:18 PM To: Huang, Trigger; amd-gfx@lists.freedesktop.org Cc: Min, Frank ; Yu, Xiangliang ; Liu, Monk ; Huang, Trigger Subject: RE: [PATCH] drm/amdgpu:bypass avfs event manager for sriov > -Original Message- > From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf > Of Trigger Huang > Sent: Tuesday, November 01, 2016 3:23 AM > To: amd-gfx@lists.freedesktop.org > Cc: Min, Frank; Yu, Xiangliang; Liu, Monk; Huang, Trigger > Subject: [PATCH] drm/amdgpu:bypass avfs event manager for sriov > > This patch is used for virtualization support. In virtualization case, > the initialization sequences are not totally the same as > non-Virtualization's. The avfs event manager should be bypassed if in > SRIOV virtualization case. > > Signed-off-by: Frank Min > Signed-off-by: Xiangliang Yu > Signed-off-by: Trigger Huang Doesn't tonga need something similar? Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c > b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c > index b86e48f..26eff56 100755 > --- a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c > +++ b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c > @@ -396,7 +396,8 @@ static int fiji_start_smu(struct pp_smumgr *smumgr) > struct fiji_smumgr *priv = (struct fiji_smumgr *)(smumgr->backend); > > /* Only start SMC if SMC RAM is not running */ > - if (!smu7_is_smc_ram_running(smumgr)) { > + if (!(smu7_is_smc_ram_running(smumgr) > + || cgs_is_virtualization_enabled(smumgr->device))) { > fiji_avfs_event_mgr(smumgr, false); > > /* Check if SMU is running in protected mode */ @@ -443,6 > +444,9 @@ > static bool fiji_is_hw_avfs_present(struct pp_smumgr *smumgr) > uint32_t efuse = 0; > uint32_t mask = (1 << ((AVFS_EN_MSB - AVFS_EN_LSB) + 1)) - 1; > > + if (cgs_is_virtualization_enabled(smumgr->device)) > + return 0; > + > if (!atomctrl_read_efuse(smumgr->device, AVFS_EN_LSB, AVFS_EN_MSB, > mask, )) { > if (efuse) > -- > 2.7.4 > > ___ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Fwd: [PATCH libdrm] xf86drm: Parse the separate files to retrieve the vendor/device info
The first attached patch will result in drmParsePciDeviceInfo always reporting revision 0 on kernels without the second attached patch. Will that be an issue for the amdgpu-pro stack? Please follow up directly to the patch e-mails with any comments on the patches. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer --- Begin Message --- From: Emil VelikovCurrently the revision isn't available via sysfs/libudev thus if one wants to know the value they need to read through the config file. This in itself wakes/powers up the device, causing unwanted delay since it can be quite costly. Expose the revision as a separate file, just like we do for the device, vendor, their subsystem version and class. Cc: Jammy Zhou Cc: Michel Dänzer Cc: Bjorn Helgaas Cc: linux-...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Emil Velikov --- Gents, I'm not subscribed to the mailing list so please keep me in the CC chain. Thanks Emil --- drivers/pci/pci-sysfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index bcd10c7..0666287 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -50,6 +50,7 @@ pci_config_attr(vendor, "0x%04x\n"); pci_config_attr(device, "0x%04x\n"); pci_config_attr(subsystem_vendor, "0x%04x\n"); pci_config_attr(subsystem_device, "0x%04x\n"); +pci_config_attr(revision, "0x%02x\n"); pci_config_attr(class, "0x%06x\n"); pci_config_attr(irq, "%u\n"); @@ -568,6 +569,7 @@ static struct attribute *pci_dev_attrs[] = { _attr_device.attr, _attr_subsystem_vendor.attr, _attr_subsystem_device.attr, + _attr_revision.attr, _attr_class.attr, _attr_irq.attr, _attr_local_cpus.attr, -- 2.9.3 ___ dri-devel mailing list dri-de...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel --- End Message --- --- Begin Message --- From: Emil Velikov Parsing config sysfs file wakes up the device. The latter of which may be slow and isn't required to begin with. Reading through config is/was required since the revision is not available by other means, although with a kernel patch in the way we can 'cheat' temporarily. That should be fine, since no open-source project has ever used the value. Cc: Michel Dänzer Cc: Mauro Santos Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98502 Signed-off-by: Emil Velikov --- Mauro can you apply this against libdrm and rebuild it. You do _not_ need to rebuild mesa afterwords. Thanks --- xf86drm.c | 50 +++--- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/xf86drm.c b/xf86drm.c index 52add5e..5a5100c 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -2950,25 +2950,45 @@ static int drmParsePciDeviceInfo(const char *d_name, drmPciDeviceInfoPtr device) { #ifdef __linux__ +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) +static const char *attrs[] = { + "revision", /* XXX: make sure it's always first, see note below */ + "vendor", + "device", + "subsystem_vendor", + "subsystem_device", +}; char path[PATH_MAX + 1]; -unsigned char config[64]; -int fd, ret; +unsigned int data[ARRAY_SIZE(attrs)]; +FILE *fp; +int ret; -snprintf(path, PATH_MAX, "/sys/class/drm/%s/device/config", d_name); -fd = open(path, O_RDONLY); -if (fd < 0) -return -errno; +for (unsigned i = 0; i < ARRAY_SIZE(attrs); i++) { +snprintf(path, PATH_MAX, "/sys/class/drm/%s/device/%s", + d_name, attrs[i]); +fp = fopen(path, "r"); +if (!fp) { +/* Note: First we check the revision, since older kernels + * may not have it. Default to zero in such cases. */ +if (i == 0) { +data[i] = 0; +continue; +} +return -errno; +} -ret = read(fd, config, sizeof(config)); -close(fd); -if (ret < 0) -return -errno; +ret = fscanf(fp, "%x", [i]); +fclose(fp); +if (ret != 1) +return -errno; + +} -device->vendor_id = config[0] | (config[1] << 8); -device->device_id = config[2] | (config[3] << 8); -device->revision_id = config[8]; -device->subvendor_id = config[44] | (config[45] << 8); -device->subdevice_id = config[46] | (config[47] << 8); +device->revision_id = data[0] & 0xff; +device->vendor_id = data[1] & 0x; +device->device_id = data[2] & 0x; +device->subvendor_id = data[3] &
[PATCH xf86-video-amdgpu] Check Xorg version at runtime instead of build time in two places
From: Michel DänzerThis means that all possible paths can be handled as intended, no matter which Xorg version the driver happened to be compiled against. (Ported from radeon commit 350a2645a1b127227ff294c0b62d2d0fd48a) Signed-off-by: Michel Dänzer --- man/amdgpu.man| 2 +- src/amdgpu_kms.c | 6 +- src/drmmode_display.c | 8 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/man/amdgpu.man b/man/amdgpu.man index 93244a4..948cd70 100644 --- a/man/amdgpu.man +++ b/man/amdgpu.man @@ -65,7 +65,7 @@ will assign xrandr outputs LVDS and VGA-0 to this instance of the driver. Define the maximum level of DRI to enable. Valid values are 2 for DRI2 or 3 for DRI3. The default is .B 3 for DRI3 -if the driver was compiled for Xorg >= 1.18.3, otherwise +if the Xorg version is >= 1.18.3, otherwise .B 2 for DRI2. .TP .BI "Option \*qEnablePageFlip\*q \*q" boolean \*q diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c index acf3a7d..b21cd37 100644 --- a/src/amdgpu_kms.c +++ b/src/amdgpu_kms.c @@ -1713,11 +1713,7 @@ Bool AMDGPUScreenInit_KMS(SCREEN_INIT_ARGS_DECL) } #endif -#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,18,3,0,0) - value = TRUE; -#else - value = FALSE; -#endif + value = xorgGetVersion() >= XORG_VERSION_NUMERIC(1,18,3,0,0); from = X_DEFAULT; if (info->use_glamor) { diff --git a/src/drmmode_display.c b/src/drmmode_display.c index f514866..2d36881 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -607,10 +607,10 @@ drmmode_can_use_hw_cursor(xf86CrtcPtr crtc) return FALSE; #endif -#if defined(AMDGPU_PIXMAP_SHARING) && \ - XORG_VERSION_CURRENT <= XORG_VERSION_NUMERIC(1,18,99,901,0) - /* HW cursor not supported with RandR 1.4 multihead */ - if (!xorg_list_is_empty(>scrn->pScreen->pixmap_dirty_list)) +#if defined(AMDGPU_PIXMAP_SHARING) + /* HW cursor not supported with RandR 1.4 multihead up to 1.18.99.901 */ + if (xorgGetVersion() <= XORG_VERSION_NUMERIC(1,18,99,901,0) && + !xorg_list_is_empty(>scrn->pScreen->pixmap_dirty_list)) return FALSE; #endif -- 2.10.2 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [1/4] amdgpu: add the function to get the marketing name (v2)
On 01/11/16 06:34 PM, Michel Dänzer wrote: > On 13/09/16 12:14 AM, Alex Deucher wrote: >> From: Junwei Zhang>> >> This function is used to look up the marking name >> for a specific board. >> >> v2: agd: Squash in subsequent updates to the table. > > As is, this breaks make check: > > >> +struct amdgpu_asic_id_table_t { > > Make this static, so the amdgpu_asic_id_table_t symbol doesn't get > exported from libdrm_amdgpu. > > BTW, is there any particular reason for putting this table in a separate > header file? > > >> @@ -303,3 +304,17 @@ int amdgpu_device_deinitialize(amdgpu_device_handle dev) >> amdgpu_device_reference(, NULL); >> return 0; >> } >> + >> +const char *amdgpu_get_marketing_name(amdgpu_device_handle dev) > > amdgpu_get_marketing_name needs to be added to amdgpu-symbols-check. > > >> +if ((t->did == dev->info.asic_id) && >> +(t->rid == dev->info.pci_rev_id)) > > Wrong indentation of the second line. > > > With these issues fixed, > > Reviewed-by: Michel Dänzer > > Would be nice to land this in master soon, as we're going to use it in > xf86-video-amdgpu: https://patchwork.freedesktop.org/patch/119501/ Junwei, if it's okay with you, I can amend the patch and push it to master. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx