[PATCH] drm/amdgpu/vcn: reset fw_shared under SRIOV

2024-12-11 Thread Bokun Zhang
- The previous patch only considered the case for baremetal and not applicable for SRIOV code path. We also need to init fw_share for SRIOV VF Signed-off-by: Bokun Zhang Change-Id: If26a377a2fe8f2aa09bfa21fc54bf26e80fd564c --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 2 ++ 1 file changed

[PATCH v2 2/2] drm/amd/amdgpu: SRIOV full reset issue with VCN

2023-11-29 Thread Bokun Zhang
he data in fw_shared during SRIOV hw_init Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c index 54b03df63a51..b71590b67e20 100644 --- a/drivers/g

[PATCH v2 1/2] drm/amd/amdgpu: Move vcn4 fw_shared init to a single function

2023-11-29 Thread Bokun Zhang
- Move VCN4's fw_shared initialization to a separated function. This way, the function can be reused at different locations. Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 45 --- 1 file changed, 26 insertions(+), 19 deletions(-) diff --

[PATCH] drm/amd/amdgpu: Clean up VCN fw_shared and set flag bits during hw_init

2023-11-28 Thread Bokun Zhang
instead of assuming the data can survive the WGR. Signed-off-by: Bokun Zhang Change-Id: I783ff826f12e12eaf48d046ff9f1cef65558c7b9 --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 45 +-- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/amd

[PATCH v4 4/4] drm/amd/amdgpu/vcn: Add RB decouple feature under SRIOV - P4

2023-10-16 Thread Bokun Zhang
- In VCN 4 SRIOV code path, add code to enable RB decouple feature Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 71 +-- 1 file changed, 55 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c b/drivers/gpu/drm/amd

[PATCH v4 3/4] drm/amd/amdgpu/vcn: Add RB decouple feature under SRIOV - P3

2023-10-16 Thread Bokun Zhang
- Update VCN header for RB decouple feature - Add metadata struct, metadata will be placed after each RB Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 50 + 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd

[PATCH v4 2/4] drm/amd/amdgpu/vcn: Add RB decouple feature under SRIOV - P2

2023-10-16 Thread Bokun Zhang
- Add function to check if RB decouple is enabled under SRIOV Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h index fabb83e9d9ae

[PATCH v4 1/4] drm/amd/amdgpu/vcn: Add RB decouple feature under SRIOV - P1

2023-10-16 Thread Bokun Zhang
- Update SRIOV header with RB decouple flag Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h b/drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h index

[PATCH v3] drm/amd/amdgpu/vcn: Add RB decouple feature under SRIOV

2023-10-13 Thread Bokun Zhang
- Add code to enable RB decouple feature. This feature is controlled by SRIOV host. Once enabled, it allows VCN0's job to be remapped to VCN1 at hardware level and improves VCN availability Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 3 + drivers/gp

[PATCH v2] drm/amd/amdgpu/vcn: Add RB decouple feature under SRIOV

2023-10-13 Thread Bokun Zhang
- Add code to enable RB decouple feature. This feature is controlled by SRIOV host. Once enabled, it allows VCN0's job to be remapped to VCN1 at hardware level and improves VCN availability Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 3 + drivers/gp

[PATCH] drm/amd/amdgpu/vcn: Add RB decouple feature under SRIOV

2023-10-13 Thread Bokun Zhang
- Add code to enable RB decouple feature. This feature is controlled by SRIOV host. Once enabled, it allows VCN0's job to be remapped to VCN1 at hardware level and improves VCN availability Signed-off-by: Bokun Zhang Change-Id: I3af7e126308e8fe4d2dc207c74e7671520037e65 Signed-off-by:

[PATCH v3] drm/amdgpu/pm: Add notification for no DC support

2023-08-16 Thread Bokun Zhang
- There is a DPM issue where if DC is not present, FCLK will stay at low level. We need to send a SMU message to configure the DPM - Reuse smu_v13_0_notify_display_change() for this purpose Reviewed-by: Evan Quan Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h

[PATCH v2] drm/amdgpu/pm: Add notification function for no DC support

2023-08-15 Thread Bokun Zhang
- There is a DPM issue where if DC is not present, FCLK will stay at low level. We need to send a SMU message to configure the DPM Reviewed-by: Evan Quan Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 6 ++ drivers/gpu/drm/amd/pm/swsmu/inc

[PATCH] drm/amdgpu/pm: Add notification function for no DC support

2023-08-15 Thread Bokun Zhang
- There is a DPM issue where if DC is not present, FCLK will stay at low level. We need to send a SMU message to configure the DPM Signed-off-by: Bokun Zhang Reviewed-by: Evan Quan --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 6 ++ drivers/gpu/drm/amd/pm/swsmu/inc

[PATCH] drm/amdgpu: add vram reservation logic based on vram_usagebyfirmware_v2_2

2022-11-08 Thread Bokun Zhang
- Move TMR region from top of FB to 2MB for FFBM, so we need to reserve TMR region firstly to make sure TMR can be allocated at 2MB Signed-off-by: Tong Liu01 Signed-off-by: Bokun Zhang --- .../gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 106 ++ drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amdgpu: Fix SDMA engine resume issue under SRIOV

2022-10-06 Thread Bokun Zhang
way, the DRM entity of SDMA engine is emptied and it will follow the flow of resume code path. Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c b

[PATCH] drm/amdgpu: Add amdgpu suspend-resume code path under SRIOV

2022-09-26 Thread Bokun Zhang
hypervisor and also resume PSP IP block under SRIOV. Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 4 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 27 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH 3/3 v3] drm/amd/amdgpu: Update PF2VF header

2022-04-20 Thread Bokun Zhang
- In the latest version of the header, there is a variable name change. This should not cause any backward compatibility since the variable is at the same offset in the struct. Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- drivers/gpu/drm/amd/amdgpu

[PATCH 2/3 v3] drm/amd/amdgpu: Properly indent PF2VF header

2022-04-20 Thread Bokun Zhang
- Clean up the identation in the header file Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h | 70 ++--- 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h b/drivers/gpu/drm/amd/amdgpu

[PATCH 1/3 v3] drm/amd/amdgpu: Update MIT license in SRIOV msg header

2022-04-20 Thread Bokun Zhang
- Update MIT license header Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h | 25 ++--- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h b/drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h index

[PATCH 2/2] drm/amd/amdgpu: Update PF2VF header

2022-04-12 Thread Bokun Zhang
- In the latest version of the header, there is a variable name change. This should not cause any backward compatibility since the variable is at the same offset in the struct. Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- drivers/gpu/drm/amd/amdgpu

[PATCH 1/2] drm/amd/amdgpu: Update PF2VF header

2022-04-12 Thread Bokun Zhang
- Add proper indentation in the header file Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h | 95 ++--- 1 file changed, 46 insertions(+), 49 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h b/drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amd/amdgpu: Update PF2VF header

2022-04-12 Thread Bokun Zhang
- Add proper indentation in the header file - In the latest version of the header, there is a variable name change. This should not cause any backward compatibility since the variable is at the same offset in the struct. Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amdgpu: Add interface to load SRIOV cap FW

2022-01-10 Thread Bokun Zhang
. - Update sysfs interface to read cap FW version. - Refactor PSP FW loading routine under SRIOV to use a unified SWITCH statement instead of using IF statement - Remove redundant amdgpu_sriov_vf() check in FW loading routine Ack-by: Monk Liu Signed-off-by: Bokun Zhang --- drivers/gpu/drm

[PATCH] drm/amdgpu: Add interface to load SRIOV cap FW

2022-01-05 Thread Bokun Zhang
. - Update sysfs interface to read cap FW version. - Refactor PSP FW loading routine under SRIOV to use a unified SWITCH statement instead of using IF statement - Remove redundant amdgpu_sriov_vf() check in FW loading routine Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amdgpu: Filter security violation registers

2021-12-15 Thread Bokun Zhang
Recently, there is security policy update under SRIOV. We need to filter the registers that hit the violation and move the code to the host driver side so that the guest driver can execute correctly. Signed-off-by: Bokun Zhang Change-Id: Ida893bb17de17a80e865c7662f04c5562f5d2727 --- drivers/gpu

[PATCH] drm/amdgpu/sriov/vcn: add new vcn ip revision check case for Navi21 SRIOV

2021-11-30 Thread Bokun Zhang
each VCN instance. In the common code path (amdgpu_discovery.c and amdgpu_vcn.c), we will simply add the IP block for above mentioned revision ID. Note that, we actually support decode under SRIOV, but we decide to disable it for now. Signed-off-by: Bokun Zhang Change-Id

[PATCH] drm/amd/amdgpu: use advanced TDR mode by default

2021-11-26 Thread Bokun Zhang
From: Bokun Zhang In the patch about advanced TDR mode, we force to always set amdgpu_gpu_recovery=2 under SRIOV. This is not ideal, since we may want to revert back to use the legacy TDR routine. Therefore, we only set amdgpu_gpu_recovery=2 when it is configured as AUTO, which is the default

[PATCH] drm/amdgpu: add driver cap firmware for SRIOV guest driver

2021-08-23 Thread Bokun Zhang
: I42bc8a2f92f09fccf795345e849e795992ce25cf Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 14 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 99 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 9 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 3 +- drivers/gpu/drm/amd

[PATCH] drm/amd/amdgpu: Rewrite the code for single VCN enablemebt

2021-07-13 Thread Bokun Zhang
After reviewing the code, seem like there is a merge issue and the logic of the code does not make any sense anymore The code has been rewritten for single VCN enablement Change-Id: I2c3d0bf6d7d446e2a014c83ee535b3c4bf20abf9 Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c

[PATCH] drm/amd/amdgpu: Rewrite the code for single VCN enablemebt

2021-07-13 Thread Bokun Zhang
After reviewing the code, seem like there is a merge issue and the logic of the code does not make any sense anymore The code has been rewritten for single VCN enablement Signed-off-by: Bokun Zhang Change-Id: I44f3346717c418c0d66afe3da93de1275978acc5 --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c

[PATCH] drm/amdgpu: Complete multimedia bandwidth interface

2021-05-12 Thread Bokun Zhang
: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c| 56 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h| 13 +++ drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h | 54 -- drivers/gpu/drm/amd/amdgpu/nv.c | 110 +++- 4 files changed, 226 insertions

[PATCH 1/2] drm/amd/amdgpu: add instance_number check in amdgpu_discovery_get_ip_version

2021-01-05 Thread Bokun Zhang
, the original amdgpu_discovery_get_ip_version cannot correct reflects the result and returns false information Change-Id: I6d2e5a10cd2ee61874012598b9662b544f63e455 Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

[PATCH 2/2] drm/amd/amdgpu: Use IP discovery data to determine VCN enablement instead of MMSCH

2021-01-05 Thread Bokun Zhang
In the past, we use MMSCH to determine whether a VCN is enabled or not. This is not reliable since after a FLR, MMSCH may report junk data. It is better to use IP discovery data. Change-Id: I8b6c32c34017b20dcaebffdaa78bb07178e9d03c Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amd/amdgpu: Update VCN initizalization behvaior

2020-11-10 Thread Bokun Zhang
eader after send it to MMSCH. After that, if a VCN instance is not ready (host disabled it), we needs to disable the ring buffer as well. Change-Id: I2c5dc4344c5919044370dfe606bf5980a202c662 Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 46 +-- 1

[PATCH] drm/amd/amdgpu: Fix incorrect logic to increment VCN doorbell index

2020-11-06 Thread Bokun Zhang
- The original logic uses a counter based index assignment, which is incorrect if we only assign VCN1 to this VF but no VCN0 The doorbell index is absolute, so we can calculate it by using index variable i and j Change-Id: Ica36b2bc80efa896f3753f2f2e2539ca2ca6649f Signed-off-by: Bokun

[PATCH] drm/amd/amdgpu: Add rev_id workaround logic for SRIOV setup

2020-10-27 Thread Bokun Zhang
- When we are under SRIOV setup, the rev_id cannot be read properly. Therefore, we will return default value for it Change-Id: I188d8e1b77f97c2eb29ef01aaf9ff9ea396a51c2 Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c | 14 +- 1 file changed, 13 insertions

[PATCH 2/3] SWDEV-220451 - Query guest's information by VF2PF message - Guest side - part 2

2020-09-16 Thread Bokun Zhang
- Add VF2PF message support - Remove incorrect Macro to avoid compile error - Remove duplicated struct and use amdgv_sriovmsg.h Change-Id: I8175d304871f4b5aab75fd071a6bdf8008137dbe Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +- drivers/gpu/drm/amd/amdgpu

[PATCH 3/3] SWDEV-247673 - stop data_exchange work thread before reset

2020-09-16 Thread Bokun Zhang
: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 483ec0136332..e71cf3b34e15 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

[PATCH 1/3] SWDEV-220451 - Query guest's information by VF2PF message - Guest side - part 1

2020-09-16 Thread Bokun Zhang
- Add guest side change to support VF2PF message - Fix coding style Change-Id: I82e5518cb10ec0b19fecaba7e05b02f4b7f2b409 Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h| 29 +- drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h | 276 2 files changed

[PATCH] Query guest's information by VF2PF message

2020-09-02 Thread Bokun Zhang
From: Tiecheng Zhou drm/amd Add VF2PF message support and follow up fix - Update VF2PF header - Implement VF2PF work thread Change-Id: I15b3899719ea06b19a9ff683666f9bc4b8b6229c Signed-off-by: Tiecheng Zhou Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

[PATCH] SWDEV-220451 - Query guest's information by VF2PF message - Guest side - part 1

2020-08-05 Thread Bokun Zhang
- Add guest side change to support VF2PF message - Fix coding style Change-Id: I82e5518cb10ec0b19fecaba7e05b02f4b7f2b409 Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h| 29 +- drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h | 276 2 files changed

[PATCH] SWDEV-220451 - Query guest's information by VF2PF message - part 2

2020-05-01 Thread Bokun Zhang
- Guest side change - Refactor and implement VF2PF information - Share checksum function between guest and host - Refactor code in amdgpu_virt.c since some of them are useless Change-Id: I881989d8fb6b6af88209badf4c4070c281f65b6a Signed-off-by: Bokun Zhang --- drivers/gpu/drm/amd/amdgpu