[PATCH xf86-video-amdgpu 1/7] Move struct amdgpu_gpu_info out of amdgpu_get_tile_config

Michel Dänzer michel at daenzer.net
Tue Nov 1 09:31:19 UTC 2016


From: Michel Dänzer <michel.daenzer at amd.com>

Preparation for the following change, no functional change intended.

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/amdgpu_kms.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 6fa63e9..077a8f8 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -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) {
-- 
2.10.2



More information about the amd-gfx mailing list