linux-2.6-block.git
12 months agodrm/amdgpu: enable VPE for VPE 6.1.0
Lang Yu [Wed, 13 Jul 2022 03:34:20 +0000 (11:34 +0800)]
drm/amdgpu: enable VPE for VPE 6.1.0

Enable Video Processing Engine on SoCs
that contain VPE 6.1.0.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add user space CS support for VPE
Lang Yu [Mon, 19 Dec 2022 06:45:57 +0000 (14:45 +0800)]
drm/amdgpu: add user space CS support for VPE

Enable command submission to VPE from user space.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add PSP loading support for VPE
Lang Yu [Tue, 9 May 2023 00:26:37 +0000 (08:26 +0800)]
drm/amdgpu: add PSP loading support for VPE

Add PSP loading support for Video Processing Engine.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add VPE 6.1.0 support
Lang Yu [Mon, 23 May 2022 02:13:21 +0000 (10:13 +0800)]
drm/amdgpu: add VPE 6.1.0 support

Add skeleton driver code. (Ray)
Add initial support for Video Processing Engine. (Lang)

Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add nbio 7.11 callback for VPE
Lang Yu [Tue, 18 Jul 2023 20:29:38 +0000 (16:29 -0400)]
drm/amdgpu: add nbio 7.11 callback for VPE

Add nbio callback to configure doorbell settings.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add nbio callback for VPE
Lang Yu [Tue, 18 Jul 2023 20:29:06 +0000 (16:29 -0400)]
drm/amdgpu: add nbio callback for VPE

Add nbio callback to configure doorbell settings.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add PSP FW TYPE for VPE
Lang Yu [Sat, 6 May 2023 02:09:32 +0000 (10:09 +0800)]
drm/amdgpu: add PSP FW TYPE for VPE

Add PSP FW TYPE for Video Processing Engine.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add UCODE ID for VPE
Lang Yu [Tue, 9 May 2023 00:16:46 +0000 (08:16 +0800)]
drm/amdgpu: add UCODE ID for VPE

Add UCODE ID for Video Processing Engine.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add support for VPE firmware name decoding
Lang Yu [Thu, 12 May 2022 03:22:31 +0000 (11:22 +0800)]
drm/amdgpu: add support for VPE firmware name decoding

Add decoding VPE firmware name support.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add doorbell index for VPE
Lang Yu [Wed, 13 Jul 2022 03:10:45 +0000 (11:10 +0800)]
drm/amdgpu: add doorbell index for VPE

Add doorbell index for Video Processing Engine.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add irq src id definitions for VPE
Lang Yu [Mon, 23 May 2022 02:06:58 +0000 (10:06 +0800)]
drm/amdgpu: add irq src id definitions for VPE

The irq src id is used to route interrupts to
the corresponding handlers.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add IH CLIENT ID for VPE
Lang Yu [Mon, 23 May 2022 02:13:21 +0000 (10:13 +0800)]
drm/amdgpu: add IH CLIENT ID for VPE

Add Interrupt Handler Client ID for
Video Processing Engine.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add HWID for VPE
Lang Yu [Fri, 17 Jun 2022 02:35:47 +0000 (10:35 +0800)]
drm/amdgpu: add HWID for VPE

Add HWID for Video Processing Engine.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add VPE firmware interface
Lang Yu [Mon, 16 Jan 2023 05:11:59 +0000 (13:11 +0800)]
drm/amdgpu: add VPE firmware interface

Add initial firmware interface. (Ray)
Add more opcodes and rename to vpe_v6_1. (Lang)

v2: Update copyright date (Alex)

Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add VPE firmware header definition
Lang Yu [Tue, 31 May 2022 06:22:16 +0000 (14:22 +0800)]
drm/amdgpu: add VPE firmware header definition

Add firmware header definition for Video Processing Engine.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add VPE HW IP BLOCK definition
Huang Rui [Sun, 24 Apr 2022 12:44:35 +0000 (20:44 +0800)]
drm/amdgpu: add VPE HW IP BLOCK definition

Add HW IP BLOCK for Video Processing Engine.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add VPE IP BLOCK definition
Huang Rui [Sat, 23 Apr 2022 14:37:43 +0000 (22:37 +0800)]
drm/amdgpu: add VPE IP BLOCK definition

Add IP BLOCK for Video Processing Engine.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add VPE RING TYPE definition
Huang Rui [Sat, 23 Apr 2022 14:15:43 +0000 (22:15 +0800)]
drm/amdgpu: add VPE RING TYPE definition

Add RING TYPE for Video Processing Engine.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add VPE HW IP definition
Huang Rui [Sat, 23 Apr 2022 14:13:06 +0000 (22:13 +0800)]
drm/amdgpu: add VPE HW IP definition

Add HW IP for Video Processing Engine
to support user space CS.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add VPE 6.1.0 header files
Lang Yu [Fri, 14 Jul 2023 19:50:24 +0000 (15:50 -0400)]
drm/amdgpu: add VPE 6.1.0 header files

Add initial headers. (Ray)
Update to align with hardware changes. (Lang)
Updates (Alex)

Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: Fix printk_ratelimit() with DRM_ERROR_RATELIMITED in 'amdgpu_cs_ioctl'
Srinivasan Shanmugam [Thu, 27 Jul 2023 02:32:46 +0000 (08:02 +0530)]
drm/amdgpu: Fix printk_ratelimit() with DRM_ERROR_RATELIMITED in 'amdgpu_cs_ioctl'

Replaced printk_ratelimit() with its DRM equivalent to avoid flooding of
dmesg logs & hence fixes the following:

WARNING: Prefer printk_ratelimited or pr_<level>_ratelimited to printk_ratelimit
+               if (printk_ratelimit())

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Guchun Chen <guchun.chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agoRevert "Revert "drm/amd/display: Implement zpos property""
Hamza Mahfooz [Tue, 29 Aug 2023 11:27:15 +0000 (07:27 -0400)]
Revert "Revert "drm/amd/display: Implement zpos property""

This reverts commit e2066eb4efe0e7d2d329d6e6765ed637a523ac45.

The problematic IGT test case (i.e. kms_atomic@plane-immutable-zpos) has
been fixed as of commit cb77add45011 ("tests/kms_atomic: remove zpos <
N-planes assert") to the IGT repo. So, reintroduce the reverted code.

Link: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/commit/cb77add45011b129e21f3cb2a4089a73dde56179
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: Use READ_ONCE() when reading the values in 'sdma_v4_4_2_ring_get_rptr'
Srinivasan Shanmugam [Fri, 4 Aug 2023 05:46:41 +0000 (11:16 +0530)]
drm/amdgpu: Use READ_ONCE() when reading the values in 'sdma_v4_4_2_ring_get_rptr'

Use READ_ONCE() instead of declaring the pointer volatile. To prevent
the compiler from refetching or reordering the read, so that the read
value is always consistent.

Link: https://lwn.net/Articles/624126/
Cc: Felix Kuehling <Felix.Kuehling@amd.com>
Cc: Guchun Chen <guchun.chen@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com>
Cc: Le Ma <le.ma@amd.com>
Cc: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Le Ma <le.ma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: remove unused parameter in amdgpu_vmid_grab_idle
Yifan Zhang [Thu, 17 Aug 2023 06:53:37 +0000 (14:53 +0800)]
drm/amdgpu: remove unused parameter in amdgpu_vmid_grab_idle

amdgpu_vm is not used in amdgpu_vmid_grab_idle.

Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdkfd: Replace pr_err with dev_err
Asad Kamal [Fri, 25 Aug 2023 07:52:19 +0000 (15:52 +0800)]
drm/amdkfd: Replace pr_err with dev_err

Replace pr_err with dev_err to show the bus-id of
failing device with kfd queue errors

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agoamdgpu/pm: Optimize emit_clock_levels for arcturus - part 2
Darren Powell [Thu, 20 Apr 2023 23:48:08 +0000 (19:48 -0400)]
amdgpu/pm: Optimize emit_clock_levels for arcturus - part 2

 Use variables to remove ternary expression in print statement and
 improve readability. This will help to optimize the code duplication
 in the switch statement
 Also Changed:
  replaced single_dpm_table->count as iterator in for loops with safer
    clocks_num_levels value
  replaced dpm_table.value usage with local var clocks_mhz

Signed-off-by: Darren Powell <darren.powell@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agoamdgpu/pm: Optimize emit_clock_levels for arcturus - part 1
Darren Powell [Wed, 29 Mar 2023 20:22:36 +0000 (16:22 -0400)]
amdgpu/pm: Optimize emit_clock_levels for arcturus - part 1

 Use variables to remove the multiple nested ternary expressions and
 improve readability. This will help to optimize the code duplication
 in the switch statement
 Also Changed:
  Modify function arcturus_get_clk_table to void function as it
    always returns 0
  Use const string "attempt_string" to cut down on repetition

Signed-off-by: Darren Powell <darren.powell@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdkfd: Add missing gfx11 MQD manager callbacks
Jay Cornwall [Fri, 25 Aug 2023 16:18:41 +0000 (12:18 -0400)]
drm/amdkfd: Add missing gfx11 MQD manager callbacks

mqd_stride function was introduced in commit 2f77b9a242a2
("drm/amdkfd: Update MQD management on multi XCC setup")
but not assigned for gfx11. Fixes a NULL dereference in debugfs.

Signed-off-by: Jay Cornwall <jay.cornwall@amd.com>
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: Free ras cmd input buffer properly
Hawking Zhang [Tue, 29 Aug 2023 15:20:27 +0000 (23:20 +0800)]
drm/amdgpu: Free ras cmd input buffer properly

Do not access the pointer for ras input cmd buffer
if it is even not allocated.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Stanley Yang <Stanley.Yang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Adjust kdoc for 'optc35_set_odm_combine'
Srinivasan Shanmugam [Tue, 29 Aug 2023 04:48:49 +0000 (10:18 +0530)]
drm/amd/display: Adjust kdoc for 'optc35_set_odm_combine'

Fixes the following W=1 kernel build warning:

drivers/gpu/drm/amd/amdgpu/../display/dc/dcn35/dcn35_optc.c:46: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Enable CRTC

Cc: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd: Simplify the bo size check funciton
Ma Jun [Fri, 25 Aug 2023 03:11:51 +0000 (11:11 +0800)]
drm/amd: Simplify the bo size check funciton

Simplify the code logic of size check function amdgpu_bo_validate_size

Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: Hide xcp partition sysfs under SRIOV
Rajneesh Bhardwaj [Thu, 24 Aug 2023 15:16:40 +0000 (11:16 -0400)]
drm/amdgpu: Hide xcp partition sysfs under SRIOV

XCP partitions should not be visible for the VF for GFXIP 9.4.3.

Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdkfd: ratelimited SQ interrupt messages
Harish Kasiviswanathan [Thu, 10 Aug 2023 16:10:57 +0000 (12:10 -0400)]
drm/amdkfd: ratelimited SQ interrupt messages

No functional change. Use ratelimited version of pr_ to avoid
overflowing of dmesg buffer

Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Reviewed-by: Philip Yang <philip.yang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: use read-modify-write mode for gfx v9_4_3 SQ setting
Tao Zhou [Fri, 25 Aug 2023 07:13:57 +0000 (15:13 +0800)]
drm/amdgpu: use read-modify-write mode for gfx v9_4_3 SQ setting

Instead of using direct update, avoid touching unrelated fields.

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>
12 months agodrm/amdgpu: access RLC_SPM_MC_CNTL through MMIO in SRIOV runtime
ZhenGuo Yin [Mon, 28 Aug 2023 06:18:52 +0000 (14:18 +0800)]
drm/amdgpu: access RLC_SPM_MC_CNTL through MMIO in SRIOV runtime

Register RLC_SPM_MC_CNTL is not blocked by L1 policy, VF can
directly access it through MMIO during SRIOV runtime.

v2: use SOC15 interface to access registers

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: ZhenGuo Yin <zhenguo.yin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/amdgpu/sdma_v6_0: Demote a bunch of half-completed function headers
Lee Jones [Thu, 24 Aug 2023 07:36:53 +0000 (08:36 +0100)]
drm/amd/amdgpu/sdma_v6_0: Demote a bunch of half-completed function headers

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c:248: warning: Function parameter or member 'job' not described in 'sdma_v6_0_ring_emit_ib'
 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c:248: warning: Function parameter or member 'flags' not described in 'sdma_v6_0_ring_emit_ib'
 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c:945: warning: Function parameter or member 'timeout' not described in 'sdma_v6_0_ring_test_ib'
 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c:1124: warning: Function parameter or member 'ring' not described in 'sdma_v6_0_ring_pad_ib'
 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c:1175: warning: Function parameter or member 'vmid' not described in 'sdma_v6_0_ring_emit_vm_flush'
 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c:1175: warning: Function parameter or member 'pd_addr' not described in 'sdma_v6_0_ring_emit_vm_flush'

Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdkfd: use mask to get v9 interrupt sq data bits correctly
Alex Sierra [Mon, 28 Aug 2023 14:47:21 +0000 (09:47 -0500)]
drm/amdkfd: use mask to get v9 interrupt sq data bits correctly

Interrupt sq data bits were not taken properly from contextid0 and contextid1.
Use macro KFD_CONTEXT_ID_GET_SQ_INT_DATA instead.

Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 DM Support
Qingqing Zhuo [Thu, 3 Aug 2023 06:34:54 +0000 (02:34 -0400)]
drm/amd/display: Add DCN35 DM Support

[Why & How]
Add DM handling for DCN35.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 CORE
Qingqing Zhuo [Thu, 3 Aug 2023 06:30:59 +0000 (02:30 -0400)]
drm/amd/display: Add DCN35 CORE

[Why & How]
Add DCN35 support in dc_resource.c.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: Allocate coredump memory in a nonblocking way
André Almeida [Thu, 17 Aug 2023 18:20:46 +0000 (15:20 -0300)]
drm/amdgpu: Allocate coredump memory in a nonblocking way

During a GPU reset, a normal memory reclaim could block to reclaim
memory. Giving that coredump is a best effort mechanism, it shouldn't
disturb the reset path. Change its memory allocation flag to a
nonblocking one.

Signed-off-by: André Almeida <andrealmeid@igalia.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 blocks to Makefile
Qingqing Zhuo [Thu, 3 Aug 2023 22:39:23 +0000 (18:39 -0400)]
drm/amd/display: Add DCN35 blocks to Makefile

[Why & How]
Enable DCN35 in makefile.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 DML
Qingqing Zhuo [Thu, 3 Aug 2023 06:28:55 +0000 (02:28 -0400)]
drm/amd/display: Add DCN35 DML

[Why & How]
Add DML handling for DCN35.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 Resource
Qingqing Zhuo [Thu, 3 Aug 2023 06:10:55 +0000 (02:10 -0400)]
drm/amd/display: Add DCN35 Resource

[Why & How]
Add resource handling for DCN35.

v2: drop unused guard
v3: drop dml2 dependencies for now (Alex)

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 init
Qingqing Zhuo [Thu, 3 Aug 2023 06:10:06 +0000 (02:10 -0400)]
drm/amd/display: Add DCN35 init

[Why & How]
Add init files for DCN35.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 DMUB
Qingqing Zhuo [Thu, 3 Aug 2023 04:32:52 +0000 (00:32 -0400)]
drm/amd/display: Add DCN35 DMUB

[Why & How]
Add DMUB handling for DCN35.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 IRQ
Qingqing Zhuo [Thu, 3 Aug 2023 03:41:53 +0000 (23:41 -0400)]
drm/amd/display: Add DCN35 IRQ

[Why & How]
- Add IRQ handling for DCN35
- Update IRQ files for other DCNs in accordance
  to change in irq_service.h

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 CLK_MGR
Qingqing Zhuo [Thu, 3 Aug 2023 03:37:49 +0000 (23:37 -0400)]
drm/amd/display: Add DCN35 CLK_MGR

[Why & How]
Add CLK_MGR handling for DCN35.

v2: Drop stale SMU interfaces (Alex)

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 HWSEQ
Qingqing Zhuo [Thu, 3 Aug 2023 05:44:52 +0000 (01:44 -0400)]
drm/amd/display: Add DCN35 HWSEQ

[Why & How]
Add HWSEQ handling for DCN35.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 DSC
Qingqing Zhuo [Thu, 3 Aug 2023 05:43:51 +0000 (01:43 -0400)]
drm/amd/display: Add DCN35 DSC

[Why & How]
Add DSC handling for DCN35.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 MMHUBBUB
Qingqing Zhuo [Thu, 3 Aug 2023 05:43:19 +0000 (01:43 -0400)]
drm/amd/display: Add DCN35 MMHUBBUB

[Why & How]
Add MMHUBBUB handling for DCN35.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 HUBBUB
Qingqing Zhuo [Thu, 3 Aug 2023 05:42:51 +0000 (01:42 -0400)]
drm/amd/display: Add DCN35 HUBBUB

[Why & How]
Add HUBBUB handling for DCN35.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 HUBP
Qingqing Zhuo [Thu, 3 Aug 2023 05:42:21 +0000 (01:42 -0400)]
drm/amd/display: Add DCN35 HUBP

[Why & How]
Add HUBP handling for DCN35.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 DWB
Qingqing Zhuo [Thu, 3 Aug 2023 05:41:55 +0000 (01:41 -0400)]
drm/amd/display: Add DCN35 DWB

[Why & How]
Add DWB handling for DCN35.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 DPP
Qingqing Zhuo [Thu, 3 Aug 2023 05:41:12 +0000 (01:41 -0400)]
drm/amd/display: Add DCN35 DPP

[Why & How]
Add DPP handling for DCN35.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 OPP
Qingqing Zhuo [Thu, 3 Aug 2023 05:40:34 +0000 (01:40 -0400)]
drm/amd/display: Add DCN35 OPP

[Why & How]
Add OPP handling for DCN35.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 OPTC
Qingqing Zhuo [Thu, 3 Aug 2023 05:39:49 +0000 (01:39 -0400)]
drm/amd/display: Add DCN35 OPTC

[Why & How]
Add OPTC handling for DCN35.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 PG_CNTL
Qingqing Zhuo [Thu, 3 Aug 2023 05:37:31 +0000 (01:37 -0400)]
drm/amd/display: Add DCN35 PG_CNTL

[Why & How]
Add PG_CNTL handling for DCN35.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 DIO
Qingqing Zhuo [Thu, 3 Aug 2023 05:33:06 +0000 (01:33 -0400)]
drm/amd/display: Add DCN35 DIO

[Why & How]
Add DIO handling for DCN35.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 DCCG
Qingqing Zhuo [Thu, 3 Aug 2023 05:26:30 +0000 (01:26 -0400)]
drm/amd/display: Add DCN35 DCCG

[Why & How]
Add DCCG handling for DCN35.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 GPIO
Qingqing Zhuo [Thu, 3 Aug 2023 05:24:58 +0000 (01:24 -0400)]
drm/amd/display: Add DCN35 GPIO

[Why & How]
Add DCN35 support in GPIO.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 BIOS command table support
Qingqing Zhuo [Thu, 3 Aug 2023 05:21:12 +0000 (01:21 -0400)]
drm/amd/display: Add DCN35 BIOS command table support

[Why & How]
Add case for DCN35 in command_table_helper2.c.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Update dc.h for DCN35 support
Qingqing Zhuo [Thu, 3 Aug 2023 06:03:42 +0000 (02:03 -0400)]
drm/amd/display: Update dc.h for DCN35 support

[Why & How]
Update dc.h for DCN35 usage.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Update DCN32 for DCN35 support
Qingqing Zhuo [Thu, 3 Aug 2023 05:12:01 +0000 (01:12 -0400)]
drm/amd/display: Update DCN32 for DCN35 support

[Why & How]
Update DCN32 files for DCN35 usage.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Update DCN314 for DCN35 support
Qingqing Zhuo [Thu, 3 Aug 2023 05:09:39 +0000 (01:09 -0400)]
drm/amd/display: Update DCN314 for DCN35 support

[Why & How]
Update DCN314 files for DCN35 usage.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Update DCN31 for DCN35 support
Qingqing Zhuo [Thu, 3 Aug 2023 05:06:58 +0000 (01:06 -0400)]
drm/amd/display: Update DCN31 for DCN35 support

[Why & How]
Update DCN31 files for DCN35 usage.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Update DCN30 for DCN35 support
Qingqing Zhuo [Thu, 3 Aug 2023 05:03:53 +0000 (01:03 -0400)]
drm/amd/display: Update DCN30 for DCN35 support

[Why & How]
Update DCN30 files for DCN35 usage.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Update DCN20 for DCN35 support
Qingqing Zhuo [Thu, 3 Aug 2023 04:55:47 +0000 (00:55 -0400)]
drm/amd/display: Update DCN20 for DCN35 support

[Why & How]
Update DCN20 files for DCN35 usage.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Update DCN10 for DCN35 support
Qingqing Zhuo [Thu, 3 Aug 2023 04:53:11 +0000 (00:53 -0400)]
drm/amd/display: Update DCN10 for DCN35 support

[Why & How]
Update DCN10 files for DCN35 usage.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Update DCE for DCN35 support
Qingqing Zhuo [Thu, 3 Aug 2023 04:49:48 +0000 (00:49 -0400)]
drm/amd/display: Update DCE for DCN35 support

[Why & How]
Update DCE files for DCN35 usage.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DCN35 family information
Qingqing Zhuo [Thu, 3 Aug 2023 04:20:06 +0000 (00:20 -0400)]
drm/amd/display: Add DCN35 family information

[Why & How]
Add DCN35 family information in DC.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add dcn35 register header files
Qingqing Zhuo [Wed, 2 Aug 2023 20:03:06 +0000 (16:03 -0400)]
drm/amd/display: Add dcn35 register header files

[Why & How]
Add register headers for DCN35.

Signed-off-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: Support query ecc cap for aqua_vanjaram
Hawking Zhang [Wed, 23 Aug 2023 09:43:46 +0000 (17:43 +0800)]
drm/amdgpu: Support query ecc cap for aqua_vanjaram

Driver queries umc_info v4_0 to identify ecc cap
for aqua_vanjaram

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Candice Li <candice.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: Add umc_info v4_0 structure
Hawking Zhang [Wed, 23 Aug 2023 09:41:44 +0000 (17:41 +0800)]
drm/amdgpu: Add umc_info v4_0 structure

To be used by aqua_vanjaram

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Candice Li <candice.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/radeon: Remove the references of radeon_gem_ pread & pwrite ioctls
Srinivasan Shanmugam [Thu, 27 Jul 2023 13:47:12 +0000 (19:17 +0530)]
drm/radeon: Remove the references of radeon_gem_ pread & pwrite ioctls

Removing the functions of pread & pwrite & IOCTL defines, as their
existence allows an authorized client to spam the system logs.

Fixes: db996e64b293 ("drm/radeon: Fix ENOSYS with better fitting error codes in radeon_gem.c")
Suggested-by: Christian König <christian.koenig@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Fix up kdoc format for 'dc_set_edp_power'
Srinivasan Shanmugam [Fri, 25 Aug 2023 10:35:27 +0000 (16:05 +0530)]
drm/amd/display: Fix up kdoc format for 'dc_set_edp_power'

Fixes the following W=1 kernel build warning:

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:5261: warning: Cannot understand  *******************************************

Cc: Ian Chen <ian.chen@amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: always switch off ODM before committing more streams
Wenjing Liu [Tue, 15 Aug 2023 14:47:52 +0000 (10:47 -0400)]
drm/amd/display: always switch off ODM before committing more streams

ODM power optimization is only supported with single stream. When ODM
power optimization is enabled, we might not have enough free pipes for
enabling other stream. So when we are committing more than 1 stream we
should first switch off ODM power optimization to make room for new
stream and then allocating pipe resource for the new stream.

Cc: stable@vger.kernel.org
Fixes: 59de751e3845 ("drm/amd/display: add ODM case when looking for first split pipe")
Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: 3.2.249
Martin Leung [Mon, 21 Aug 2023 14:22:50 +0000 (10:22 -0400)]
drm/amd/display: 3.2.249

This version brings along the following:
- DCN315 fixes
- DCN31 fixes
- DPIA fixes
- Dump the pipe topology when it updates
- Misc code cleanups
- New debugfs interface to query the current ODM combine configuration
- ODM fixes
- Potential deadlock while waiting for MPC idle fix
- Support for windowed MPO ODM

Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Martin Leung <martin.leung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: fix pipe topology logging error
Wenjing Liu [Fri, 18 Aug 2023 14:08:29 +0000 (10:08 -0400)]
drm/amd/display: fix pipe topology logging error

[why]
There is a logging error in the recently added pipe topology log.
If the plane with index 0 uses MPC combine, the log shows that
as two separate planes.

[how]
Initialize plane idx as -1 and increment plane idx before logging
any primary dpp pipes of a plane.

Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add debugfs interface for ODM combine info
Aurabindo Pillai [Wed, 16 Aug 2023 20:03:20 +0000 (16:03 -0400)]
drm/amd/display: Add debugfs interface for ODM combine info

[Why]
For use with IGT tests in userspace, the number of ODM segments in use
is required to be exposed to userspace to verify that ODM Combine is
working as expected when special timings are committed.

[How]
Add a connector specific debugfs entry that prints the number of ODM
segments in use.

Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: correct z8_watermark 16bit to 20bit mask
Charlene Liu [Thu, 17 Aug 2023 00:40:57 +0000 (20:40 -0400)]
drm/amd/display: correct z8_watermark 16bit to 20bit mask

remove double adjustment for DPREFCLK SS. dprefclk adjusted with SS is
used for dp audio only. if adjust DP_DTO, need to adjust VID_M/N

Reviewed-by: Muhammad Ahmed <ahmed.ahmed@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Fix incorrect comment
Aurabindo Pillai [Wed, 9 Aug 2023 19:43:07 +0000 (15:43 -0400)]
drm/amd/display: Fix incorrect comment

Fix incorrect comment about hardware capabilities debugfs interface.

Reviewed-by: Jerry Zuo <jerry.zuo@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Skip dmub memory flush when not needed
Dillon Varone [Fri, 4 Aug 2023 20:55:26 +0000 (16:55 -0400)]
drm/amd/display: Skip dmub memory flush when not needed

[WHY&HOW]
Readback is only necessary when loaded via CPU.

Reviewed-by: Chris Park <chris.park@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Remove wait while locked
Gabe Teeger [Mon, 14 Aug 2023 20:06:18 +0000 (16:06 -0400)]
drm/amd/display: Remove wait while locked

[Why]
We wait for mpc idle while in a locked state, leading to potential
deadlock.

[What]
Move the wait_for_idle call to outside of HW lock. This and a
call to wait_drr_doublebuffer_pending_clear are moved added to a new
static helper function called wait_for_outstanding_hw_updates, to make
the interface clearer.

Cc: stable@vger.kernel.org
Fixes: 8f0d304d21b3 ("drm/amd/display: Do not commit pipe when updating DRR")
Reviewed-by: Jun Lei <jun.lei@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Gabe Teeger <gabe.teeger@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: add pipe topology update log
Wenjing Liu [Mon, 14 Aug 2023 21:00:22 +0000 (17:00 -0400)]
drm/amd/display: add pipe topology update log

Given an issue with pipe topology transition. It is very hard to tell
the before and after pipe topology without a pipe topology logging. The
change adds such logging to help with visualizing the issue.

Reviewed-by: Jun Lei <jun.lei@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: switch to new ODM policy for windowed MPO ODM support
Wenjing Liu [Thu, 10 Aug 2023 23:47:39 +0000 (19:47 -0400)]
drm/amd/display: switch to new ODM policy for windowed MPO ODM support

We need to align windowed MPO ODM support on DCN3x with new ODM policy.

Reviewed-by: Jun Lei <jun.lei@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: use new pipe allocation interface in dcn32 fpu
Wenjing Liu [Thu, 10 Aug 2023 23:46:10 +0000 (19:46 -0400)]
drm/amd/display: use new pipe allocation interface in dcn32 fpu

This commit implements a new pipe resource allocation logic for DCN32
when windowed ODM MPO flag is set to enable testing. By default the
flag is not set. It will be toggled on after we complete testing.

Reviewed-by: Jun Lei <jun.lei@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: add more pipe resource interfaces
Wenjing Liu [Thu, 10 Aug 2023 17:59:29 +0000 (13:59 -0400)]
drm/amd/display: add more pipe resource interfaces

Redesign pipe resource interfaces in resource.h file. The new interface
design addresses the issue with lack of pipe topology encapsulation and
lack of pipe accessors.

Reviewed-by: Jun Lei <jun.lei@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: add new resource interfaces to update odm mpc slice count
Wenjing Liu [Sat, 5 Aug 2023 17:37:34 +0000 (13:37 -0400)]
drm/amd/display: add new resource interfaces to update odm mpc slice count

Define two new interfaces to update mpc and odm slice count.

Reviewed-by: Jun Lei <jun.lei@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: add new resource interface for acquiring sec opp heads and release...
Wenjing Liu [Sat, 5 Aug 2023 16:55:52 +0000 (12:55 -0400)]
drm/amd/display: add new resource interface for acquiring sec opp heads and release pipe

[why]
We need a new algorithm for acquiring secondary opp heads for ODM combine
in dcn32 and a release pipe interface to properly release pipe resources.

[how]
add two new interfaces in DCN specific resource file.

Reviewed-by: Jun Lei <jun.lei@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: rename function to add otg master for stream
Wenjing Liu [Wed, 2 Aug 2023 21:35:14 +0000 (17:35 -0400)]
drm/amd/display: rename function to add otg master for stream

We are renaming acquire first free pipe to add
otg master pipe for stream because the former name
doesn't indicate that it acquires the first free pipe
to use as an otg master pipe. This could cause coding
errors if someone uses it to acquire a different pipe type.

Reviewed-by: Jun Lei <jun.lei@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: add comments to add plane functions
Wenjing Liu [Wed, 2 Aug 2023 21:19:21 +0000 (17:19 -0400)]
drm/amd/display: add comments to add plane functions

Adding detail comments describing the problem we are solving with add
plane function.

Reviewed-by: Jun Lei <jun.lei@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add DPIA Link Encoder Assignment Fix
Mustapha Ghaddar [Thu, 10 Aug 2023 20:20:23 +0000 (16:20 -0400)]
drm/amd/display: Add DPIA Link Encoder Assignment Fix

For DPIA we should have preferred DIG assignment based on DPIA selected
as per the ASIC design.

Reviewed-by: George Shen <george.shen@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Mustapha Ghaddar <mghaddar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: update blank state on ODM changes
Wenjing Liu [Mon, 14 Aug 2023 21:11:16 +0000 (17:11 -0400)]
drm/amd/display: update blank state on ODM changes

When we are dynamically adding new ODM slices, we didn't update
blank state, if the pipe used by new ODM slice is previously blanked,
we will continue outputting blank pixel data on that slice causing
right half of the screen showing blank image.

The previous fix was a temporary hack to directly update current state
when committing new state. This could potentially cause hw and sw
state synchronization issues and it is not permitted by dc commit
design.

Cc: stable@vger.kernel.org
Fixes: 7fbf451e7639 ("drm/amd/display: Reinit DPG when exiting dynamic ODM")
Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add smu write msg id fail retry process
Fudong Wang [Fri, 11 Aug 2023 00:24:59 +0000 (08:24 +0800)]
drm/amd/display: Add smu write msg id fail retry process

A benchmark stress test (12-40 machines x 48hours) found that DCN315 has
cases where DC writes to an indirect register to set the smu clock msg
id, but when we go to read the same indirect register the returned msg
id doesn't match with what we just set it to. So, to fix this retry the
write until the register's value matches with the requested value.

Cc: stable@vger.kernel.org # 6.1+
Fixes: f94903996140 ("drm/amd/display: Add DCN315 CLK_MGR")
Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Fudong Wang <fudong.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/display: Add support for 1080p SubVP to reduce idle power
Ethan Bitnun [Mon, 14 Aug 2023 14:32:14 +0000 (10:32 -0400)]
drm/amd/display: Add support for 1080p SubVP to reduce idle power

- Override the det to adjust microschedule timings allow for
  1080p configs with SubVP
- To lower unnecessary risk, we prevent multi 1080p configs
  from using SubVP, as multi 1080p already has low idle power.
- Count the number of streams to verify that we are in a
  SubVP config before overriding

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Ethan Bitnun <ethan.bitnun@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: Add SMU v13.0.6 default reset methods
Lijo Lazar [Wed, 19 Jul 2023 08:01:47 +0000 (13:31 +0530)]
drm/amdgpu: Add SMU v13.0.6 default reset methods

For APUs with SMU v13.0.6, mode-2 reset is kept as default and for
others mode-1 is the default reset method.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Asad Kamal <asad.kamal@amd.com>
Tested-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agoPartially revert "drm/amd/display: update add plane to context logic with a new algor...
Wenjing Liu [Tue, 8 Aug 2023 22:49:20 +0000 (18:49 -0400)]
Partially revert "drm/amd/display: update add plane to context logic with a new algorithm"

This partially reverts commit 460ea8980511 ("drm/amd/display: update add
plane to context logic with a new algorithm").

The new secondary pipe allocation logic triggers an issue with a
specific hardware state transition and causes a frame of corruption when
toggling between windowed MPO and ODM desktop only mode. Ideally hwss is
supposed to handle this scenario. We are temporarily reverting the logic
and investigate the root cause why this transition would cause
corruptions.

Fixes: 460ea8980511 ("drm/amd/display: update add plane to context logic with a new algorithm")
Reviewed-by: Martin Leung <martin.leung@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amdgpu: add header files for MP 14.0.0
Li Ma [Fri, 14 Jul 2023 19:35:19 +0000 (15:35 -0400)]
drm/amdgpu: add header files for MP 14.0.0

This patch will add header files for MP 14.0.0.

v2: updates (Alex)

Signed-off-by: Li Ma <li.ma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/amdgpu/amdgpu_doorbell_mgr: Correct misdocumented param 'doorbell_index'
Lee Jones [Thu, 24 Aug 2023 07:36:56 +0000 (08:36 +0100)]
drm/amd/amdgpu/amdgpu_doorbell_mgr: Correct misdocumented param 'doorbell_index'

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c:123: warning: Function parameter or member 'doorbell_index' not described in 'amdgpu_doorbell_index_on_bar'
 drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c:123: warning: Excess function parameter 'db_index' description in 'amdgpu_doorbell_index_on_bar'

Reviewed-by: Shashank Sharma <shashank.sharma@amd.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 months agodrm/amd/amdgpu/imu_v11_0: Increase buffer size to ensure all possible values can...
Lee Jones [Thu, 24 Aug 2023 07:37:05 +0000 (08:37 +0100)]
drm/amd/amdgpu/imu_v11_0: Increase buffer size to ensure all possible values can be stored

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/amd/amdgpu/imu_v11_0.c: In function ‘imu_v11_0_init_microcode’:
 drivers/gpu/drm/amd/amdgpu/imu_v11_0.c:52:54: warning: ‘_imu.bin’ directive output may be truncated writing 8 bytes into a region of size between 4 and 33 [-Wformat-truncation=]
 drivers/gpu/drm/amd/amdgpu/imu_v11_0.c:52:9: note: ‘snprintf’ output between 16 and 45 bytes into a destination of size 40

Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>