aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/2230-drm-amdgpu-discovery-stop-taking-psp-header-into-acc.patch
blob: b6bde2cc2fa302d7b3dc24c21574c6755eff22cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
From 8e5b3ba853e883104c335df17dffd40b53c0cdc7 Mon Sep 17 00:00:00 2001
From: Xiaojie Yuan <xiaojie.yuan@amd.com>
Date: Wed, 27 Mar 2019 12:21:40 +0800
Subject: [PATCH 2230/2940] drm/amdgpu/discovery: stop taking psp header into
 account

psp will write a header to vram, but the value exposed in
RCC_CONFIG_MEMSIZE does not include the memory that this header is
written to. Therefore, the interpretation of the table does not need to
take the psp header into account.

Signed-off-by: Xiaojie Yuan <xiaojie.yuan@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
index ec14fd1350e2..5f967ae8d4ed 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
@@ -189,7 +189,7 @@ int amdgpu_discovery_init(struct amdgpu_device *adev)
 		goto out;
 	}
 
-	bhdr = (struct binary_header *)(adev->discovery + PSP_HEADER_SIZE);
+	bhdr = (struct binary_header *)adev->discovery;
 
 	if (le32_to_cpu(bhdr->binary_signature) != BINARY_SIGNATURE) {
 		DRM_ERROR("invalid ip discovery binary signature\n");
@@ -197,8 +197,7 @@ int amdgpu_discovery_init(struct amdgpu_device *adev)
 		goto out;
 	}
 
-	offset = PSP_HEADER_SIZE +
-		offsetof(struct binary_header, binary_checksum) +
+	offset = offsetof(struct binary_header, binary_checksum) +
 		sizeof(bhdr->binary_checksum);
 	size = bhdr->binary_size - offset;
 	checksum = bhdr->binary_checksum;
@@ -275,7 +274,7 @@ int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev)
 		return -EINVAL;
 	}
 
-	bhdr = (struct binary_header *)(adev->discovery + PSP_HEADER_SIZE);
+	bhdr = (struct binary_header *)adev->discovery;
 	ihdr = (struct ip_discovery_header *)(adev->discovery +
 			le16_to_cpu(bhdr->table_list[IP_DISCOVERY].offset));
 	num_dies = le16_to_cpu(ihdr->num_dies);
@@ -338,7 +337,7 @@ int amdgpu_discovery_get_ip_version(struct amdgpu_device *adev, int hw_id,
 		return -EINVAL;
 	}
 
-	bhdr = (struct binary_header *)(adev->discovery + PSP_HEADER_SIZE);
+	bhdr = (struct binary_header *)adev->discovery;
 	ihdr = (struct ip_discovery_header *)(adev->discovery +
 			le16_to_cpu(bhdr->table_list[IP_DISCOVERY].offset));
 	num_dies = le16_to_cpu(ihdr->num_dies);
@@ -376,7 +375,7 @@ int amdgpu_discovery_get_gfx_info(struct amdgpu_device *adev)
 		return -EINVAL;
 	}
 
-	bhdr = (struct binary_header *)(adev->discovery + PSP_HEADER_SIZE);
+	bhdr = (struct binary_header *)adev->discovery;
 	gc_info = (struct gc_info_v1_0 *)(adev->discovery +
 			le16_to_cpu(bhdr->table_list[GC].offset));
 
-- 
2.17.1