Tao Zhou
462c272b90
drm/amdgpu: add psp support for dimgrey_cavefish(v2)
...
General psp support for dimgrey_cavefish.
v2: remove the checks for asd load and reroute ih.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:01:12 -04:00
Tao Zhou
0a305e34c7
drm/amdgpu: increase size of psp fw_name string(v2)
...
Increase fw_name string size so longer chip name can be stored.
v2: define macro for the length of psp fw name.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:01:09 -04:00
Tao Zhou
db1f8a8fb2
drm/amdgpu/swsmu: add smu support for dimgrey_cavefish(v2)
...
Reuse sienna_cichlid pp table for dimgrey_cavefish.
v2: update related comment.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:01:07 -04:00
Tao Zhou
10e0d9ebb0
drm/amdgpu/swsmu: increase size for smu fw_name string
...
A longer chip name needs more space.
v2: define macro for the length of smu fw name
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:01:02 -04:00
Tao Zhou
f267242e15
drm/amdgpu: add gmc cg support for dimgrey_cavefish
...
The athub version for dimgrey_cavefish is v2.1.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:57 -04:00
James Zhu
467db422cb
drm/amdgpu/vcn: enable VCN DPG mode for dimgrey_cavefish
...
Enable VCN DPG mode for dimgrey_cavefish.
Signed-off-by: James Zhu <James.Zhu@amd.com >
Reviewed-by: Leo Liu <leo.liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:54 -04:00
James Zhu
0c2c02b66c
drm/amdgpu/vcn: add firmware support for dimgrey_cavefish
...
Add firmware support for dimgrey_cavefish.
Signed-off-by: James Zhu <James.Zhu@amd.com >
Reviewed-by: Leo Liu <leo.liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:52 -04:00
Tao Zhou
6c72c7a03a
drm/amdgpu: force pa_sc_tile_steering_override to 0 for dimgrey_cavefish
...
pa_sc_tile_steering_override is only programmable for gfx10.0/10.1/10.2, the same as sienna_cichlid.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:47 -04:00
Tao Zhou
76a2d9ea69
drm/amdgpu: add virtual display support for dimgrey_cavefish
...
Add virtual ip block for dimgrey_cavefish.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:45 -04:00
Tao Zhou
2eb6145653
drm/amdgpu: configure dimgrey_cavefish gfx according to gfx 10.3's definition
...
The gfx version of dimgrey_cavefish is 10.3, identical to sienna_cichlid, follow the way
of sienna_cichlid.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:42 -04:00
Tao Zhou
0106922600
drm/amdgpu: add sdma ip block for dimgrey_cavefish
...
Enable sdma block for dimgrey_cavefish, same as sienna_cichlid.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:37 -04:00
Tao Zhou
feb6329c58
drm/amdgpu: add gfx ip block for dimgrey_cavefish
...
Enable gfx block for dimgrey_cavefish, same as navy_flounder.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:35 -04:00
Tao Zhou
771cc67ed0
drm/amdgpu: add ih ip block for dimgrey_cavefish
...
Enable ih block for dimgrey_cavefish, same as navy_flounder.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:31 -04:00
Tao Zhou
3e02ad4476
drm/amdgpu: add gmc ip block for dimgrey_cavefish
...
Enable gmc block for dimgrey_cavefish, same as sienna_cichlid.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:29 -04:00
Tao Zhou
2aa92b12df
drm/amdgpu: add common ip block for dimgrey_cavefish
...
Same as navy_flounder.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:25 -04:00
Tao Zhou
01cbb6b288
drm/amdgpu: add mmhub support for dimgrey_cavefish
...
Same as navy_flounder.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:22 -04:00
Tao Zhou
038d757b95
drm/amdgpu: initialize IP offset for dimgrey_cavefish
...
Add ip offset definition for dimgrey_cavefish and initialize it.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:20 -04:00
Tao Zhou
550c58e0fa
drm/amdgpu: add common support for dimgrey_cavefish
...
Add external id and set clock gating for dimgrey_cavefish.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:18 -04:00
Tao Zhou
f2a6c81d02
drm/amdgpu: add gfx clock gating support for dimgrey_cavefish
...
Set gfx clock gating for dimgrey_cavefish.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:15 -04:00
Tao Zhou
a14354690f
drm/amdgpu: add gmc support for dimgrey_cavefish
...
Same as navy_flounder.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:13 -04:00
Tao Zhou
ee64e01ef2
drm/amdgpu: add support for dimgrey_cavefish firmware
...
Add support for dimgrey_cavefish cp/rlc firmware.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:11 -04:00
Tao Zhou
144722fa3a
drm/amdgpu: set asic family and ip blocks for dimgrey_cavefish
...
Same as navi series.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:09 -04:00
Tao Zhou
a14e093619
drm/amdgpu: set fw load type for dimgrey_cavefish
...
Use direct load for dimgrey_cavefish.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:07 -04:00
Tao Zhou
a0200254ec
drm/amdgpu: add dimgrey_cavefish gpu info firmware
...
Load gpu info firmware for dimgrey_cavefish.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:05 -04:00
Tao Zhou
a2468e043a
drm/amdgpu: add dimgrey_cavefish asic type
...
Add chip type for dimgrey_cavefish.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 14:00:01 -04:00
Rodrigo Siqueira
cd294f9a64
drm/amd/display: Fix module load hangs when connected to an eDP
...
It was recently introduced a change that enables driver to disable
streams if pixel clock changes. Consequently, the code path executed in
the disable vbios function expanded to an encoder verification part.
The encoder loop is nested inside the pipe count loop, and both loops
share the 'i' variable in control of their flow. This situation may lead
to an infinite loop because the encoder loop constantly updates the `i`
variable, making the first loop always positive. As a result, we can see
a soft hang during the module load (modprobe amdgpu) and a series of
dmesg log that looks like this:
kernel:[ 124.538727] watchdog: BUG: soft lockup - CPU#2 stuck for 22s!
[modprobe:1000]
RSP: 0018:ffffabbf419bf0e8 EFLAGS: 00000282
RAX: ffffffffc0809de0 RBX: ffff93b35ccc0000 RCX: ffff93b366c21800
RDX: 0000000000000000 RSI: 0000000000000141 RDI: ffff93b35ccc0000
RBP: ffffabbf419bf108 R08: ffffabbf419bf164 R09: 0000000000000001
R10: 0000000000000003 R11: 0000000000000003 R12: 0000000008677d40
R13: 0000000000000141 R14: ffff93b35cfc0000 R15: ffff93b35abc0000
FS: 00007f1400717540(0000) GS:ffff93b37f680000(0000)
knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005649b66b0968 CR3: 00000003e0fec000 CR4: 0000000000350ee0
Call Trace:
amdgpu_device_rreg+0x17/0x20 [amdgpu]
amdgpu_cgs_read_register+0x14/0x20 [amdgpu]
dm_read_reg_func+0x3a/0xb0 [amdgpu]
get_pixel_clk_frequency_100hz+0x30/0x50 [amdgpu]
dc_commit_state+0x8f1/0xae0 [amdgpu]
? drm_calc_timestamping_constants+0x101/0x160 [drm]
amdgpu_dm_atomic_commit_tail+0x39d/0x21a0 [amdgpu]
? dcn21_validate_bandwidth+0xe5/0x290 [amdgpu]
? kfree+0xc3/0x390
? dcn21_validate_bandwidth+0xe5/0x290 [amdgpu]
...
RSP: 002b:00007fff26009bd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
RAX: ffffffffffffffda RBX: 000055a8025bea50 RCX: 00007f140085c89d
RDX: 0000000000000000 RSI: 000055a8025b8290 RDI: 000000000000000c
RBP: 0000000000040000 R08: 0000000000000000 R09: 0000000000000000
R10: 000000000000000c R11: 0000000000000246 R12: 000055a8025b8290
R13: 0000000000000000 R14: 000055a8025bead0 R15: 000055a8025bea50
This issue was fixed by introducing a second variable for the internal
loop.
Fixes: 8353d30e74 ("drm/amd/display: disable stream if pixel clock changed with link active")
Reviewed-by: Roman Li <Roman.Li@amd.com >
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com >
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 13:57:43 -04:00
Bhawanpreet Lakha
5faf37e7d3
drm/amd/display: Add missing function pointers for dcn3
...
These function pointers are missing from dcn30_init
.calc_vupdate_position : Used to help avoid cursor stuttering
.set_pipe : Needed for setting ABM
So add them
Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com >
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-12 13:57:26 -04:00
Ye Bin
73e3433627
drm/amdgpu: Fix inconsistent of format with argument type in amdgpu_xgmi.c
...
Fix follow warning:
[drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c:249]: (warning) %d in format
string (no. 1) requires 'int' but the argument type is 'unsigned int'.
Reported-by: Hulk Robot <hulkci@huawei.com >
Signed-off-by: Ye Bin <yebin10@huawei.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:51:15 -04:00
Ye Bin
849007191e
drm/amdgpu: Fix invalid number of character '{' in amdgpu_acpi_init
...
Fix follow warning:
Checking drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c...
[drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:770]: (error) Invalid number
of character '{' when these macros are defined: ''.
Checking drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c: CONFIG_ACPI...
[drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:770]: (error) Invalid number
of character '{' when these macros are defined: 'CONFIG_ACPI'.
......
Checking drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c: CONFIG_X86...
[drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:770]: (error) Invalid number
of character '{' when these macros are defined: 'CONFIG_X86'.
Checking drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c: _X86_...
[drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:770]: (error) Invalid number
of character '{' when these macros are defined: '_X86_'.
Checking drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c: __linux__...
[drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:770]: (error) Invalid number
of character '{' when these macros are defined: '__linux__'.
Fixes: 97d798b276 ("drm/amdgpu: simplify ATIF backlight handling")
Reported-by: Hulk Robot <hulkci@huawei.com >
Signed-off-by: Ye Bin <yebin10@huawei.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:51:08 -04:00
Alex Deucher
75145aab7a
drm/amdgpu/swsmu: clean up a bunch of stale interfaces
...
These were leftover from the initial implementation, but
never used. Drop them.
Reviewed-by: Evan Quan <evan.quan@amd.com >
Noticed-by: Ryan Taylor <ryan.taylor@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:51:04 -04:00
Evan Quan
44d6e160f6
drm/amd/pm: setup APU dpm clock table in SMU HW initialization
...
As the dpm clock table is needed during DC HW initialization.
And that (DC HW initialization) comes before smu_late_init()
where current APU dpm clock table setup is performed. So, NULL
pointer dereference will be triggered. By moving APU dpm clock
table setup to smu_hw_init(), this can be avoided.
Fixes: 02cf91c113 ("drm/amd/powerplay: postpone operations not required for hw setup to late_init")
Signed-off-by: Evan Quan <evan.quan@amd.com >
Reported-by: Dirk Gouders <dirk@gouders.net >
Acked-by: Nirmoy Das <nirmoy.das@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:48:56 -04:00
Changfeng
7ca917ecb3
drm/amdgpu: modify cp_flags to pg_flags in gfx_v10_cntl_power_gating
...
It needs to use adev->pg_flags other than adev->cg_glags in
gfx_v10_cntl_power_gating
Signed-off-by: Changfeng <Changfeng.Zhu@amd.com >
Reviewed-by: Huang Rui <ray.huang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:48:48 -04:00
Emily.Deng
9ba8aa1085
drm/amdgpu: Remove warning for virtual_display
...
Remove the virtual_display warning in drm_crtc_vblank_off when
dev->num_crtcs is null.
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com >
Signed-off-by: Emily.Deng <Emily.Deng@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:47:48 -04:00
kernel test robot
402bde58e7
drm/amdgpu: kfd_initialized can be static
...
Fixes: c7651b7358 ("drm/amdgpu: Fix handling of KFD initialization failures")
Signed-off-by: kernel test robot <lkp@intel.com >
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com >
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:44:39 -04:00
Gustavo A. R. Silva
201a4eb9dc
amd/amdgpu_ctx: Use struct_size() helper and kmalloc() (v2)
...
Make use of the new struct_size() helper instead of the offsetof() idiom.
Also, use kmalloc() instead of kcalloc().
v2: squash in kzalloc fix
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:44:39 -04:00
Gustavo A. R. Silva
562f150fb9
drm/amdgpu: Use struct_size() helper in kmalloc()
...
Make use of the new struct_size() helper instead of the offsetof() idiom.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:43:30 -04:00
Gustavo A. R. Silva
bae82e8418
drm/amd/pm: Replace one-element array with flexible-array in struct phm_ppt_v1_pcie_table
...
There is a regular need in the kernel to provide a way to declare having
a dynamically sized set of trailing elements in a structure. Kernel code
should always use “flexible array members”[1] for these cases. The older
style of one-element or zero-length arrays should no longer be used[2].
Refactor the code according to the use of a flexible-array member in
struct phm_ppt_v1_pcie_table, instead of a one-element array, and use
the struct_size() helper to calculate the size for the allocation.
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays
Build-tested-by: kernel test robot <lkp@intel.com >
Link: https://lore.kernel.org/lkml/5f7db0bc.7Xivn4K83f7XW0ug%25lkp@intel.com/
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:43:30 -04:00
Gustavo A. R. Silva
b44fd9ccfa
drm/amd/pm: Replace one-element array with flexible-array in struct phm_ppt_v1_voltage_lookup_table
...
There is a regular need in the kernel to provide a way to declare having
a dynamically sized set of trailing elements in a structure. Kernel code
should always use “flexible array members”[1] for these cases. The older
style of one-element or zero-length arrays should no longer be used[2].
Refactor the code according to the use of a flexible-array member in
struct phm_ppt_v1_voltage_lookup_table, instead of a one-element array,
and use the struct_size() helper to calculate the size for the allocation.
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays
Build-tested-by: kernel test robot <lkp@intel.com >
Link: https://lore.kernel.org/lkml/5f7d61df.jWrFfnjxGbjSkPOp%25lkp@intel.com/
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:43:30 -04:00
Gustavo A. R. Silva
03f0a7b857
drm/amd/pm: Replace one-element array with flexible-array in struct phm_ppt_v1_mm_clock_voltage_dependency_table
...
There is a regular need in the kernel to provide a way to declare having
a dynamically sized set of trailing elements in a structure. Kernel code
should always use “flexible array members”[1] for these cases. The older
style of one-element or zero-length arrays should no longer be used[2].
Refactor the code according to the use of a flexible-array member in
struct phm_ppt_v1_mm_clock_voltage_dependency_table, instead of a
one-element array, and use the struct_size() helper to calculate the
size for the allocation.
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays
Build-tested-by: kernel test robot <lkp@intel.com >
Link: https://lore.kernel.org/lkml/5f7d61e2.qiTVTyG2pVoG8bb0%25lkp@intel.com/
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:43:30 -04:00
Gustavo A. R. Silva
5be63325c5
drm/amd/pm: Replace one-element array with flexible-array in struct phm_ppt_v1_clock_voltage_dependency_table
...
There is a regular need in the kernel to provide a way to declare having
a dynamically sized set of trailing elements in a structure. Kernel code
should always use “flexible array members”[1] for these cases. The older
style of one-element or zero-length arrays should no longer be used[2].
Refactor the code according to the use of a flexible-array member in
struct phm_ppt_v1_clock_voltage_dependency_table, instead of a one-element
array, and use the struct_size() helper to calculate the size for the
allocation.
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays
Build-tested-by: kernel test robot <lkp@intel.com >
Link: https://lore.kernel.org/lkml/5f7c433c.TTk9rnA+F58kyDUy%25lkp@intel.com/
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:43:30 -04:00
Gustavo A. R. Silva
89c785bb1a
drm/amd/pm: Replace one-element array with flexible-array in struct phm_samu_clock_voltage_dependency_table
...
There is a regular need in the kernel to provide a way to declare having
a dynamically sized set of trailing elements in a structure. Kernel code
should always use “flexible array members”[1] for these cases. The older
style of one-element or zero-length arrays should no longer be used[2].
Refactor the code according to the use of a flexible-array member in
struct phm_samu_clock_voltage_dependency_table, instead of a one-element array,
and use the struct_size() helper to calculate the size for the allocation.
Also, save some heap space as the original code is multiplying
table->numEntries by sizeof(struct phm_samu_clock_voltage_dependency_table)
when it should have been multiplied it by
sizeof(struct phm_samu_clock_voltage_dependency_record) instead.
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays
Build-tested-by: kernel test robot <lkp@intel.com >
Link: https://lore.kernel.org/lkml/5f7c5d3a.ryM4GmZr3e0JeZy+%25lkp@intel.com/
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:43:30 -04:00
Gustavo A. R. Silva
aa8d10a10f
drm/amd/pm: Replace one-element array with flexible-array in struct phm_cac_leakage_table
...
There is a regular need in the kernel to provide a way to declare having
a dynamically sized set of trailing elements in a structure. Kernel code
should always use “flexible array members”[1] for these cases. The older
style of one-element or zero-length arrays should no longer be used[2].
Refactor the code according to the use of a flexible-array member in
struct phm_cac_leakage_table, instead of a one-element array,
and use the struct_size() helper to calculate the size for the allocation.
Also, save some heap space as the original code is multiplying
table->ucNumEntries by sizeof(struct phm_cac_leakage_table) when it
should have been multiplied it by sizeof(struct phm_cac_leakage_record)
instead.
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays
Build-tested-by: kernel test robot <lkp@intel.com >
Link: https://lore.kernel.org/lkml/5f7c5d38.iT%2FQTjN+659XUDo5%25lkp@intel.com/
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:43:30 -04:00
Gustavo A. R. Silva
637f7576ec
drm/amd/pm: Replace one-element array with flexible-array in struct phm_vce_clock_voltage_dependency_table
...
There is a regular need in the kernel to provide a way to declare having
a dynamically sized set of trailing elements in a structure. Kernel code
should always use “flexible array members”[1] for these cases. The older
style of one-element or zero-length arrays should no longer be used[2].
Refactor the code according to the use of a flexible-array member in
struct phm_vce_clock_voltage_dependency_table, instead of a one-element array,
and use the struct_size() helper to calculate the size for the allocation.
Also, save some heap space as the original code is multiplying
table->numEntries by sizeof(struct phm_vce_clock_voltage_dependency_table)
when it should have multiplied it by sizeof(struct phm_vce_clock_voltage_dependency_record)
instead.
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays
Build-tested-by: kernel test robot <lkp@intel.com >
Link: https://lore.kernel.org/lkml/5f7c5d35.pJToGs3H9khZK6ws%25lkp@intel.com/
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:43:29 -04:00
Gustavo A. R. Silva
9526e431c5
drm/amd/pm: Replace one-element array with flexible-array in struct phm_phase_shedding_limits_table
...
There is a regular need in the kernel to provide a way to declare having
a dynamically sized set of trailing elements in a structure. Kernel code
should always use “flexible array members”[1] for these cases. The older
style of one-element or zero-length arrays should no longer be used[2].
Refactor the code according to the use of a flexible-array member in
struct phm_phase_shedding_limits_table, instead of a one-element array,
and use the struct_size() helper to calculate the size for the allocation.
Also, save some heap space as the original code is multiplying
ptable->ucNumEntries by sizeof(struct phm_phase_shedding_limits_table)
when it should have multiplied it by sizeof(struct phm_phase_shedding_limits_record)
instead.
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays
Build-tested-by: kernel test robot <lkp@intel.com >
Link: https://lore.kernel.org/lkml/5f7c5d36.6PStUZp2HRxAz7IM%25lkp@intel.com/
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:43:29 -04:00
Gustavo A. R. Silva
0e319cfeb3
drm/amd/pm: Replace one-element array with flexible-array in struct phm_acp_clock_voltage_dependency_table
...
There is a regular need in the kernel to provide a way to declare having
a dynamically sized set of trailing elements in a structure. Kernel code
should always use “flexible array members”[1] for these cases. The older
style of one-element or zero-length arrays should no longer be used[2].
Refactor the code according to the use of a flexible-array member in
struct phm_acp_clock_voltage_dependency_table, instead of a one-element
array, and use the struct_size() helper to calculate the size for the
allocation.
Also, save some heap space as the original code is multiplying
table->numEntries by sizeof(struct phm_acp_clock_voltage_dependency_table)
when it should have multiplied it by sizeof(phm_acp_clock_voltage_dependency_record)
instead.
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays
Build-tested-by: kernel test robot <lkp@intel.com >
Link: https://lore.kernel.org/lkml/5f7c5d3c.TyfOhg%2FA6JycL6ZN%25lkp@intel.com/
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:43:29 -04:00
Gustavo A. R. Silva
737123d67e
drm/amd/pm: Replace one-element array with flexible-array in struct phm_uvd_clock_voltage_dependency_table
...
There is a regular need in the kernel to provide a way to declare having
a dynamically sized set of trailing elements in a structure. Kernel code
should always use “flexible array members”[1] for these cases. The older
style of one-element or zero-length arrays should no longer be used[2].
Refactor the code according to the use of a flexible-array member in
struct phm_uvd_clock_voltage_dependency_table, instead of a one-element
array, and use the struct_size() helper to calculate the size for the
allocation.
Also, save some heap space as the original code is multiplying
table->numEntries by sizeof(struct phm_uvd_clock_voltage_dependency_table)
when it should have multiplied it by sizeof(phm_uvd_clock_voltage_dependency_record)
instead.
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays
Build-tested-by: kernel test robot <lkp@intel.com >
Link: https://lore.kernel.org/lkml/5f7c433e.pXkC6KsN6HN%2FLdhj%25lkp@intel.com/
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:43:29 -04:00
Gustavo A. R. Silva
e0af7d1110
drm/amd/pm: Replace one-element array with flexible-array in struct phm_clock_array
...
There is a regular need in the kernel to provide a way to declare having
a dynamically sized set of trailing elements in a structure. Kernel code
should always use “flexible array members”[1] for these cases. The older
style of one-element or zero-length arrays should no longer be used[2].
Refactor the code according to the use of a flexible-array member in
struct phm_clock_array, instead of a one-element array, and use the
struct_size() helper to calculate the size for the allocation.
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays
Build-tested-by: kernel test robot <lkp@intel.com >
Link: https://lore.kernel.org/lkml/5f7c433f.ZyMD+YUIVAwiHGVe%25lkp@intel.com/
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:43:29 -04:00
Gustavo A. R. Silva
2b61065756
drm/amd/pm: Replace one-element array with flexible-array member in struct vi_dpm_table
...
There is a regular need in the kernel to provide a way to declare having
a dynamically sized set of trailing elements in a structure. Kernel code
should always use “flexible array members”[1] for these cases. The older
style of one-element or zero-length arrays should no longer be used[2].
Use a flexible-array member in struct vi_dpm_table instead of a
one-element array.
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays
Build-tested-by: kernel test robot <lkp@intel.com >
Link: https://lore.kernel.org/lkml/5f7c433c.TTk9rnA+F58kyDUy%25lkp@intel.com/
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:43:29 -04:00
Gustavo A. R. Silva
23bdba959b
drm/amd/pm: Replace one-element array with flexible-array member
...
There is a regular need in the kernel to provide a way to declare having
a dynamically sized set of trailing elements in a structure. Kernel code
should always use “flexible array members”[1] for these cases. The older
style of one-element or zero-length arrays should no longer be used[2].
Refactor the code according to the use of a flexible-array member in
struct phm_clock_voltage_dependency_table, instead of a one-element
array, and use the struct_size() helper to calculate the size for the
allocation.
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays
Build-tested-by: kernel test robot <lkp@intel.com >
Link: https://lore.kernel.org/lkml/5f7c295c.8iqp1Ifc6oiVDq%2F%2F%25lkp@intel.com/
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-09 14:43:29 -04:00
Thong Thai
5d731b5ac3
drm/amdgpu: enable vcn support for green_sardine (v2)
...
Enable Green_Sardine VCN support and VCN firmware loading
v2: use apu flags
Signed-off-by: Thong Thai <thong.thai@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2020-10-07 14:45:27 -04:00