[PATCH 3/3] drm/amdgpu/mes11: make fence waits synchronous

2024-04-17 Thread Horace Chen
part to prevent this wait from impacting reset sequence. Signed-off-by: Horace Chen --- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h | 1 + drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 18 ++ 3 files changed, 18 insertions(+), 4 deletions

[PATCH 2/3] Revert "drm/amdgpu: increase mes submission timeout"

2024-04-17 Thread Horace Chen
From: Alex Deucher This reverts commit a518c746510e03d8a78db432a659770182546b9e. Reduce the time we wait since we are waiting for the fence with the spinlock held. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 1/3] drm/amdgpu/mes11: print MES opcodes rather than numbers

2024-04-17 Thread Horace Chen
From: Alex Deucher Makes it easier to review the logs when there are MES errors. v2: use dbg for emitted, add helpers for fetching strings Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 78 -- 1 file changed, 74 insertions(+), 4 deletions(-)

[PATCH] drm/amdkfd: use correct method to get clock under SRIOV

2023-08-17 Thread Horace Chen
ead dpm clock from pmfw, so we can use dpm clock interface directly. For multi-VF mode, VF pm is disabled, so driver can just react as pm disabled. One-vf-mode is introduced from GFX9 so it shall not have any backward compatibility issue. Signed-off-by: Horace Chen --- drivers/gpu/drm/amd/amd

[PATCH] drm/amdgpu: set sw state to gfxoff after SR-IOV reset

2023-07-19 Thread Horace Chen
a function for SR-IOV to clean up some sw state before recover. Set adev->gfx.is_poweron to false to prevent gfxhub invalidation before gfx firmware autoload complete. Signed-off-by: Horace Chen --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c |

[PATCH] drm/amdgpu: Clear VCN cache when hw_init

2023-06-20 Thread Horace Chen
[Why] VCN will use some framebuffer space as its cache. It needs to be reset when reset happens, such as FLR. Otherwise some error may be kept after the reset. Signed-off-by: Horace Chen --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu

[PATCH] drm/amdgpu: disable SDMA WPTR_POLL_ENABLE for SR-IOV

2023-04-27 Thread Horace Chen
[Why] This WPTR_POLL_ENABLE is a hardware contigious polling which will cause FCLK and UCLK to keep on a high level. Mostly its case can be covered by F32_WPTR_POLL_ENABLE which polls by firmware. So to save power, SR-IOV also needs to disable this bit Signed-off-by: Horace Chen --- drivers/gpu

[PATCH 3/6] drm/amdgpu: add a compute pipe reset for RS64

2022-07-25 Thread Horace Chen
[Why] Under SR-IOV, we are not sure whether pipe status is good or not when doing initialization. The compute engine maybe fail to bringup if pipe status is bad. [How] Do an RS64 pipe reset for MEC before we do initialization. Also apply to bare-metal. Signed-off-by: Horace Chen --- drivers

[PATCH 3/6] drm/amdgpu: add a compute pipe reset for SR-IOV

2022-07-25 Thread Horace Chen
[Why] Under SR-IOV, we are not sure whether pipe status is good or not when doing initialization. The compute engine maybe fail to bringup if pipe status is bad. [How] For SR-IOV, disable the compute engine to do a pipe reset before we do initialization. Signed-off-by: Horace Chen --- drivers

[PATCH 6/6] drm/amdgpu: sriov remove vcn_4_0 and jpeg_4_0

2022-07-21 Thread Horace Chen
SRIOV needs to initialize mmsch instead of multimedia engines directly. So currently remove them for SR-IOV until the code and firmwares are ready. Signed-off-by: Horace Chen --- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff

[PATCH 5/6] drm/amdgpu: refine virtualization psp fw skip check

2022-07-21 Thread Horace Chen
SR-IOV may need to load different firmwares for different ASIC inside VF. So create a new function in amdgpu_virt to check whether FW load needs to be skipped. Signed-off-by: Horace Chen --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 17 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c

[PATCH 4/6] drm/amdgpu: enable WPTR_POLL_ENABLE for sriov on sdma_v6_0

2022-07-21 Thread Horace Chen
[Why] Under SR-IOV, if VF is switched out then its doorbell will be disabled, SDMA rely on WPTR_POLL to get doorbells which was sent during VF switched-out time. [How] For SR-IOV, set SDMA WPTR_POLL_ENABLE to 1. Signed-off-by: Horace Chen --- drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 5 - 1

[PATCH 3/6] drm/amdgpu: add a compute pipe reset for SR-IOV

2022-07-21 Thread Horace Chen
[Why] Under SR-IOV, we are not sure whether pipe status is good or not when doing initialization. The compute engine maybe fail to bringup if pipe status is bad. [How] For SR-IOV, disable the compute engine to do a pipe reset before we do initialization. Signed-off-by: Horace Chen --- drivers

[PATCH 2/6] drm/amdgpu: add sriov nbio callback structure

2022-07-21 Thread Horace Chen
range registers. Signed-off-by: Horace Chen --- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 5 ++- drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c| 44 +++ drivers/gpu/drm/amd/amdgpu/nbio_v4_3.h| 1 + 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH 1/6] drm/amdgpu: add CHIP_IP_DISCOVERY support for virtualization

2022-07-21 Thread Horace Chen
For further chips we will use CHIP_IP_DISCOVERY, so add this support for virtualization Signed-off-by: Horace Chen --- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amdgpu: refine SR-IOV firmware VRAM reservation to protect data

2017-11-01 Thread Horace Chen
breaking the data and will not cause eviction. Signed-off-by: Horace Chen <horace.c...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/g

[PATCH 3/3] drm/amdgpu: pick SR-IOV fw reservation information in atomfirmware

2017-11-01 Thread Horace Chen
SR-IOV need to get start offset and size from firmware for its vram reservation. This logic had been add to the atombios code path. As the current branch will run atomfirmware by default, add same logic to atomfirmware code path. Signed-off-by: Horace Chen <horace.c...@amd.com> --- drive

[PATCH 2/3] drm/amdgpu: change interface when firmware reserving vram

2017-11-01 Thread Horace Chen
use amdgpu_bo_create_vram_restricted_kernel to reserve bo at specified position and keep the original data intact. Signed-off-by: Horace Chen <horace.c...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 44 ++ 1 file changed, 8 insertions(+), 36 del

[PATCH 1/3] drm/amdgpu: Add interface to protect VRAM at exact position

2017-11-01 Thread Horace Chen
to protect data at exact position. So here add a new interface to create bo at the exact position directly and then pin it immediately to avoid eviction and avoid breaking the existing data on the VRAM. Signed-off-by: Horace Chen <horace.c...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.

[PATCH] drm/amdgpu: SR-IOV data exchange between PF

2017-10-10 Thread Horace Chen
is correct. So check the data on the specified offset of the shared VRAM, if the checksum is right, read values from it and write some VF information next to the data from PF. Signed-off-by: Horace Chen <horace.c...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 + drivers/gpu/d

[PATCH] drm/amdgpu: SR-IOV data exchange between PF

2017-10-09 Thread Horace Chen
is correct. So check the data on the specified offset of the shared VRAM, if the checksum is right, read values from it and write some VF information next to the data from PF. Signed-off-by: Horace Chen <horace.c...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 + drivers/gpu/d

[PATCH] drm/amdgpu: Reserve shared memory on VRAM for SR-IOV

2017-09-29 Thread Horace Chen
to reserve a piece of memory on the VRAM. Because the mem address is specified. Reserve it early in amdgpu_ttm_init to make sure that it can monoplize the space. Signed-off-by: Horace Chen <horace.c...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 14 + drivers/gpu/drm/amd/

[PATCH] drm/amdgpu: Reserve shared memory on VRAM for SR-IOV

2017-09-29 Thread Horace Chen
to reserve a piece of memory on the VRAM. Because the mem address is specified. Reserve it early in amdgpu_ttm_init to make sure that it can monoplize the space. Signed-off-by: Horace Chen <horace.c...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 14 + drivers/gpu/drm/amd/

[PATCH 1/2] drm/amdgpu: add functions to create bo at the specified position

2017-09-28 Thread Horace Chen
and start address. Otherwise the start address will be ingored. Signed-off-by: Horace Chen <horace.c...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 129 - drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 6 ++ 2 files changed, 133 insertions(+), 2 del

[PATCH 3/3] drm/amdgpu: Reserve shared memory on VRAM for SR-IOV

2017-09-27 Thread Horace Chen
of memory on the VRAM. Signed-off-by: Horace Chen <horace.c...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 17 drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 18 +++- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 62 drivers/gpu/d

[PATCH] drm/amdgpu: Add firmware VRAM reservation from vbios

2017-09-26 Thread Horace Chen
AMDGPU_GEM_CREATE_VRAM_SPECIFIED flag to tell function to set the ttm_placement to the exact place to avoid eviction whenpinnning. Signed-off-by: Horace Chen <horace.c...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 17 + drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 18 - d