Thomas Zimmermann
57390019b6
Merge drm/drm-next into drm-misc-next
...
Updating drm-misc-next to the state of Linux v6.6-rc2.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
2023-10-11 09:50:59 +02:00
Kees Cook
ac8e62ab25
drm/amdgpu/discovery: Annotate struct ip_hw_instance with __counted_by
...
Prepare for the coming implementation by GCC and Clang of the __counted_by
attribute. Flexible array members annotated with __counted_by can have
their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
(for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).
As found with Coccinelle[1], add __counted_by for struct ip_hw_instance.
[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: "Christian König" <christian.koenig@amd.com >
Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com >
Cc: David Airlie <airlied@gmail.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: Hawking Zhang <Hawking.Zhang@amd.com >
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Kees Cook <keescook@chromium.org >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Signed-off-by: Christian König <christian.koenig@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230922173216.3823169-2-keescook@chromium.org
2023-10-05 11:29:09 +02:00
Le Ma
46b55e25c9
drm/amdgpu: update gc_info v2_1 from discovery
...
Several new fields are exposed in gc_info v2_1
Signed-off-by: Le Ma <le.ma@amd.com >
Reviewed-by: Shiwu Zhang <shiwu.zhang@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-08-31 17:53:19 -04:00
Le Ma
d4f6425a56
drm/amdgpu: update mall info v2 from discovery
...
Mall info v2 is introduced in ip discovery
Signed-off-by: Le Ma <le.ma@amd.com >
Reviewed-by: Shiwu Zhang <shiwu.zhang@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-08-31 17:53:08 -04:00
Prike Liang
4c340d0034
drm/amdgpu/discovery: add ih 6.1.0 support
...
Add to IP discovery table.
Signed-off-by: Prike Liang <Prike.Liang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-08-07 16:35:42 -04:00
Prike Liang
eff7a442c1
drm/amdgpu/discovery: add smuio 14.0.0 support
...
Add to IP discovery table.
Signed-off-by: Prike Liang <Prike.Liang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-08-07 16:35:27 -04:00
Prike Liang
9b9a5e34d4
drm/amdgpu/discovery: add hdp 6.1.0 support
...
Add to IP discovery table.
Signed-off-by: Prike Liang <Prike.Liang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-08-07 16:35:23 -04:00
Prike Liang
99af9c950d
drm/amdgpu/discovery: enable sdma6 for SDMA 6.1.0
...
Add to IP discovery table.
Signed-off-by: Prike Liang <Prike.Liang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-08-07 16:34:04 -04:00
Li Ma
82f33504a4
drm/amdgpu/discovery: enable PSP 14.0.0 support
...
Add it to IP discovery.
Signed-off-by: Li Ma <li.ma@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-07-27 14:59:29 -04:00
Alex Deucher
2eb841bdbc
drm/amdgpu: mark GC 9.4.3 experimental for now
...
Mark as experimental for now until we get closer to production
to avoid possible undesireable behavior when mixing newer
boards with older kernels.
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-15 11:37:54 -04:00
Candice Li
bcd9a5f8b9
drm/amdgpu: Update total channel number for umc v8_10
...
Update total channel number for umc v8_10.
Signed-off-by: Candice Li <candice.li@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-15 11:06:59 -04:00
Shiwu Zhang
20997c04b7
drm/amdgpu: set the APU flag based on package type
...
Since currently APU and dGPU share the same pcie class
while gmc init needs the flag to set up correctly for upcomming
memory allocations
v2: call get_pkg_type in smuio 13_0_3 is enough (hawking)
Signed-off-by: Shiwu Zhang <shiwu.zhang@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 11:07:04 -04:00
Shiwu Zhang
c796d7e039
drm/amdgpu: add the smu_v13_0_6 and gfx_v9_4_3 ip block
...
Signed-off-by: Shiwu Zhang <shiwu.zhang@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 10:41:02 -04:00
Lijo Lazar
6a944ccbf5
drm/amdgpu: Fix harvest reporting of VCN
...
Use VCN instance mask to check if an instance is harvested or not.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: James Zhu <James.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:56:08 -04:00
Lijo Lazar
aaf1090a6c
drm/amdgpu: Add instance mask for VCN and JPEG
...
Keep an instance mask formed by physical instance numbers for VCN and JPEG
IPs. Populate the mask from discovery table information.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Acked-by: Leo Liu <leo.liu@amd.com >
Tested-by: James Zhu <James.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:55:59 -04:00
Lijo Lazar
f2b8447b1f
drm/amdgpu: Fix discovery sys node harvest info
...
Initalize syfs nodes after harvest information is fetched and fetch the
correct harvest info based on each IP instance.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Le Ma <le.ma@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:55:51 -04:00
Lijo Lazar
ac772a3c07
drm/amdgpu: Add fallback path for discovery info
...
If SOC doesn't expose dedicated vram, discovery region may be
available through system memory. Rename the existing interface to
generic read_binary_from_mem and add a fallback path to read from system
memory.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:55:45 -04:00
Lijo Lazar
368bb1bcfb
drm/amdgpu: Read discovery info from system memory
...
On certain ASICs, discovery info is available at reserved region in system
memory. The location is available through ACPI interface. Add API to read
discovery info from there.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:55:42 -04:00
Lijo Lazar
52c293ab06
drm/amdgpu: Populate VCN/JPEG harvest information
...
Certain instances of VCN/JPEG IPs may not be usable. Fetch the information
from harvest table.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:51:46 -04:00
James Zhu
ed1f42f03c
drm/amdgpu: enable vcn/jpeg on vcn_v4_0_3
...
Enable vcn/jpeg on vcn_v4_0_3.
Signed-off-by: James Zhu <James.Zhu@amd.com >
Acked-by Leo Liu <leo.liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:51:33 -04:00
Lijo Lazar
73fa255328
drm/amdgpu: Use discovery to get XCC/SDMA mask
...
Get information about active XCC and SDMAs from discovery table.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Le Ma <le.ma@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:51:17 -04:00
Lijo Lazar
44cbc4534b
drm/amdgpu: Make VRAM discovery read optional
...
When overridden with module param, directly read discovery info
from discovery binary instead of reading from VRAM.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:51:13 -04:00
Lijo Lazar
a820d3ca8e
drm/amdgpu: Remove unnecessary return value check
...
There is no need to check return value, as the function internally
used - amdgpu_discovery_read_binary_from_vram() - returns void.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Le Ma <le.ma@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:50:34 -04:00
Lijo Lazar
e56c9ef6cb
drm/amdgpu: Add soc config init for GC9.4.3 ASICs
...
Add function to initialize soc configuration information for GC 9.4.3
ASICs. Use it to map IPs and other SOC related information once IP
configuration information is available through discovery.
For GC9.4.3 compute partition related callbacks are initialized as part
of configuration init.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:49:39 -04:00
Hawking Zhang
6b7ec18b04
drm/amdgpu: init smuio funcs for smuio v13_0_3
...
Add callbacks for SMUIO 13.0.3
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Le Ma <le.ma@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:48:36 -04:00
Le Ma
7d158f52bf
drm/amdgpu: parse base address from new ip discovery with 64bit ip base address
...
Truncate the 64bit base address from ip discovery and only store lower 32bit
ip base in reg_offset[].
Bits > 32 follows ASIC specific format, thus just discard them and handle it
within specific ASIC.
By this way reg_offset[] and related helpers can stay unchanged.
v2: make comments more generic
Signed-off-by: Le Ma <le.ma@amd.com >
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:47:59 -04:00
Le Ma
aabb478421
drm/amdgpu: upgrade amdgpu_discovery struct ip to ip_v4
...
version 4 supports 64bit ip base address
Signed-off-by: Le Ma <le.ma@amd.com >
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:47:56 -04:00
Lijo Lazar
cab7d478da
drm/amdgpu: Add IP instance map for aqua vanjaram
...
Add XCC logical to physical instance map for aqua vanjaram
v2:
Keep look up table only for required IPs, for others return
default mapping (Felix).
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Le Ma <Le.Ma@amd.com >
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:47:23 -04:00
Alex Deucher
0e5f625157
drm/amdgpu: drop unused function
...
amdgpu_discovery_get_ip_version() has not been used since
commit c40bdfb2ff ("drm/amdgpu: fix incorrect VCN revision in SRIOV")
so drop it.
Reviewed-by: Luben Tuikov <luben.tuikov@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:31:31 -04:00
Alex Deucher
29551fd90e
drm/amdgpu: drop invalid IP revision
...
This was already fixed and dropped in:
commit baf3f8f374 ("drm/amdgpu: handle SRIOV VCN revision parsing")
commit c40bdfb2ff ("drm/amdgpu: fix incorrect VCN revision in SRIOV")
But seems to have been accidently been left around in a merge.
Reviewed-by: Luben Tuikov <luben.tuikov@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-06-09 09:31:04 -04:00
Srinivasan Shanmugam
7abac457ba
drm/amd/amdgpu: Fix style issues in amdgpu_discovery.c
...
Fix following checkpatch errors in amdgpu_discovery.c
ERROR: space required after that ',' (ctx:VxV)
ERROR: space required before the open parenthesis '('
ERROR: code indent should use tabs where possible
Cc: Christian König <christian.koenig@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-04-21 08:49:37 -04:00
Hawking Zhang
5e5d4b39ce
drm/amdgpu: add common ip block for GC 9.4.3
...
Add common IP handling for GC 9.4.3
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Le Ma <Le.Ma@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-04-14 13:47:49 -04:00
Hawking Zhang
69bacf1545
drm/amdgpu: add GMC ip block for GC 9.4.3
...
Add GMC IP handling for GC 9.4.3
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Le Ma <Le.Ma@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-03-31 11:18:43 -04:00
Hawking Zhang
f3409f76a6
drm/amdgpu: Set family for GC 9.4.3
...
Set family for GC 9.4.3
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Le Ma <Le.Ma@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-03-31 11:18:43 -04:00
Hawking Zhang
5d55e1d02a
drm/amdgpu: init nbio v7_9 callbacks
...
switch to the new nbio generation for NBIO 7.9.0.
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Le Ma <Le.Ma@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-03-31 11:18:43 -04:00
Jane Jian
bf35dbc135
drm/amdgpu/jpeg: enable jpeg v4_0 for sriov
...
- skip direct jpeg registers read&write since it is not allowed
- reset Doorbell range layout for sriov
Signed-off-by: Jane Jian <Jane.Jian@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-03-22 00:47:59 -04:00
Hawking Zhang
a32d7d6b19
drm/amdgpu: add PSP ip block for PSP 13.0.6
...
Add PSP IP handling for PSP 13.0.6
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Le Ma <Le.Ma@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-03-07 14:21:57 -05:00
Le Ma
051ae8d59c
drm/amdgpu: set sdma v4_4_2 ip block
...
Use sdma 4.4.2 IP block for chips with sdma 4.4.2 hardware.
Signed-off-by: Le Ma <le.ma@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-03-07 14:21:57 -05:00
Hawking Zhang
4688940a1e
drm/amdgpu: add HDP ip block for HDP 4.4.2
...
Add HDP IP handling for HDP 4.4.2
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Le Ma <Le.Ma@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-03-07 14:21:56 -05:00
Hawking Zhang
0df2032ab7
drm/amdgpu: add IH ip block for IH 4.4.2
...
Add IH IP handling for IH 4.4.2
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Le Ma <Le.Ma@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-03-07 14:21:56 -05:00
Candice Li
2b595659d5
drm/amdgpu: Support umc node harvest config on umc v8_10
...
Don't need to query error count and error address on harvest umc nodes.
v2: Fix code bug, use active_mask instead of harvsest_config
and remove unnecessary argument in LOOP macro.
v3: Leave adev->gmc.num_umc unchanged.
Signed-off-by: Candice Li <candice.li@amd.com >
Reviewed-by: Tao Zhou <tao.zhou1@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-03-06 15:14:39 -05:00
Thomas Weißschuh
b2daaa9360
drm/amdgpu: make kobj_type structures constant
...
Since commit ee6d3dd4ed ("driver core: make kobj_type constant.")
the driver core allows the usage of const struct kobj_type.
Take advantage of this to constify the structure definitions to prevent
modification at runtime.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-02-23 17:35:59 -05:00
Candice Li
e4f665de41
drm/amdgpu: Add poison mode query for df v4_3
...
Add poison mode query support on df v4_3.
Signed-off-by: Candice Li <candice.li@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-12-15 12:19:30 -05:00
Yifan Zhang
7308ceb446
drm/amdgpu/discovery: enable nbio support for NBIO v7.7.1
...
this patch is to enable nbio support for NBIO v7.7.1.
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com >
Reviewed-by: Aaron Liu <aaron.liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-11-29 11:03:37 -05:00
Yifan Zhang
51e7a21687
drm/amdgpu: add smu 13 support for smu 13.0.11
...
this patch to add smu 13 support for smu 13.0.11.
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com >
Reviewed-by: Aaron Liu <aaron.liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-11-29 11:03:37 -05:00
Yifan Zhang
dd2d9c7fd7
drm/amdgpu/discovery: set the APU flag for GC 11.0.4
...
Set the APU flag appropriately for GC 11.0.4.
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com >
Reviewed-by: Aaron Liu <aaron.liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-11-29 11:03:36 -05:00
Yifan Zhang
94ab706858
drm/amdgpu: set GC 11.0.4 family
...
this patch is to set GC 11.0.4 family.
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com >
Reviewed-by: Aaron Liu <aaron.liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-11-29 11:03:36 -05:00
Tim Huang
7c1389f1b1
drm/amdgpu/discovery: add PSP IP v13.0.11 support
...
Add PSP IP v13.0.11 ip discovery support.
Signed-off-by: Tim Huang <tim.huang@amd.com >
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com >
Reviewed-by: Aaron Liu <aaron.liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-11-29 11:03:36 -05:00
Yifan Zhang
6a6af77570
drm/amdgpu/discovery: enable mes support for GC v11.0.4
...
this patch is to enable mes for GC 11.0.4.
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com >
Reviewed-by: Aaron Liu <aaron.liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-11-29 11:03:36 -05:00
Yifan Zhang
b952d6b3d3
drm/amdgpu/discovery: enable gfx v11 for GC 11.0.4
...
Enable gfx v11 for GC 11.0.4.
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com >
Reviewed-by: Aaron Liu <aaron.liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-11-29 11:03:36 -05:00