[PATCH v4 00/17] Introduce PMF Smart PC Solution Builder Feature

2023-10-18 Thread Shyam Sundar S K
Smart PC Solutions Builder allows for OEM to define a large number of custom system states to dynamically switch to. The system states are referred to as policies, and multiple policies can be loaded onto the system at any given time, however only one policy can be active at a given time. Policy i

[PATCH v4 01/17] platform/x86/amd/pmf: Add PMF TEE interface

2023-10-18 Thread Shyam Sundar S K
AMD PMF driver loads the PMF TA (Trusted Application) into the AMD ASP's (AMD Security Processor) TEE (Trusted Execution Environment). PMF Trusted Application is a secured firmware placed under /lib/firmware/amdtee gets loaded only when the TEE environment is initialized. Add the initial code path

[PATCH v4 02/17] platform/x86/amd/pmf: Add support for PMF-TA interaction

2023-10-18 Thread Shyam Sundar S K
PMF TA (Trusted Application) loads via the TEE environment into the AMD ASP. PMF-TA supports two commands: 1) Init: Initialize the TA with the PMF Smart PC policy binary and start the policy engine. A policy is a combination of inputs and outputs, where; - the inputs are the changing dynamics of

[PATCH v4 03/17] platform/x86/amd/pmf: Change return type of amd_pmf_set_dram_addr()

2023-10-18 Thread Shyam Sundar S K
In the current code, the metrics table information was required only for auto-mode or CnQF at a given time. Hence keeping the return type of amd_pmf_set_dram_addr() as static made sense. But with the addition of Smart PC builder feature, the metrics table information has to be shared by the Smart

[PATCH v4 05/17] platform/x86/amd/pmf: change amd_pmf_init_features() call sequence

2023-10-18 Thread Shyam Sundar S K
To sideload pmf policy binaries, the Smart PC Solution Builder provides a debugfs file called "update_policy"; that gets created under a new debugfs directory called "pb" and this new directory has to be associated with existing parent directory for PMF driver called "amd_pmf". In the current code

[PATCH v4 04/17] platform/x86/amd/pmf: Add support for PMF Policy Binary

2023-10-18 Thread Shyam Sundar S K
PMF Policy binary is a encrypted and signed binary that will be part of the BIOS. PMF driver via the ACPI interface checks the existence of Smart PC bit. If the advertised bit is found, PMF driver walks the acpi namespace to find out the policy binary size and the address which has to be passed to

[PATCH v4 06/17] platform/x86/amd/pmf: Add support to get inputs from other subsystems

2023-10-18 Thread Shyam Sundar S K
PMF driver sends changing inputs from each subystem to TA for evaluating the conditions in the policy binary. Add initial support of plumbing in the PMF driver for Smart PC to get information from other subsystems in the kernel. Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmf/M

[PATCH v4 07/17] platform/x86/amd/pmf: Add support update p3t limit

2023-10-18 Thread Shyam Sundar S K
P3T (Peak Package Power Limit) is a metric within the SMU controller that can influence the power limits. Add support from the driver to update P3T limits accordingly. Reviewed-by: Mario Limonciello Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmf/pmf.h| 3 +++ drivers/platf

[PATCH v4 08/17] platform/x86/amd/pmf: Add support to update system state

2023-10-18 Thread Shyam Sundar S K
PMF driver based on the output actions from the TA can request to update the system states like entering s0i3, lock screen etc. by generating an uevent. Based on the udev rules set in the userspace the event id matching the uevent shall get updated accordingly using the systemctl. Sample udev rule

[PATCH v4 09/17] platform/x86/amd/pmf: Make source_as_str() as non-static

2023-10-18 Thread Shyam Sundar S K
Add amd_pmf prefix to source_as_str() function, so that the function name does not look generic. As this is a helper function make it as non-static so that it can be reused across multiple PMF features. Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmf/pmf.h | 1 + drivers/platfor

[PATCH v4 10/17] platform/x86/amd/pmf: Add facility to dump TA inputs

2023-10-18 Thread Shyam Sundar S K
PMF driver sends constant inputs to TA which its gets via the other subsystems in the kernel. To debug certain TA issues knowing what inputs being sent to TA becomes critical. Add debug facility to the driver which can isolate Smart PC and TA related issues. Also, make source_as_str() as non-stati

[PATCH v4 11/17] platform/x86/amd/pmf: Add capability to sideload of policy binary

2023-10-18 Thread Shyam Sundar S K
A policy binary is OS agnostic, and the same policies are expected to work across the OSes. At times it becomes difficult to debug when the policies inside the policy binaries starts to misbehave. Add a way to sideload such policies independently to debug them via a debugfs entry. Reviewed-by: Ma

[PATCH v4 12/17] platform/x86/amd/pmf: dump policy binary data

2023-10-18 Thread Shyam Sundar S K
Sometimes policy binary retrieved from the BIOS maybe incorrect that can end up in failing to enable the Smart PC solution feature. Use print_hex_dump_debug() to dump the policy binary in hex, so that we debug the issues related to the binary even before sending that to TA. Reviewed-by: Mario Lim

[PATCH v4 13/17] platform/x86/amd/pmf: Add PMF-AMDGPU get interface

2023-10-18 Thread Shyam Sundar S K
In order to provide GPU inputs to TA for the Smart PC solution to work, we need to have interface between the PMF driver and the AMDGPU driver. Add the initial code path for get interface from AMDGPU. Co-developed-by: Mario Limonciello Signed-off-by: Mario Limonciello Signed-off-by: Shyam Sunda

[PATCH v4 14/17] platform/x86/amd/pmf: Add PMF-AMDGPU set interface

2023-10-18 Thread Shyam Sundar S K
For the Smart PC Solution to fully work, it has to enact to the actions coming from TA. Add the initial code path for set interface to AMDGPU. Change amd_pmf_apply_policies() return type, so that it can return errors when the call to retrieve information from amdgpu fails. Co-developed-by: Mario

[PATCH v4 15/17] HID: amd_sfh: rename float_to_int() to amd_sfh_float_to_int()

2023-10-18 Thread Shyam Sundar S K
From: Basavaraj Natikar Current amd_sfh driver has float_to_int() to convert units from float to int. This is fine until this function gets called outside of the current scope of file. Add a prefix "amd_sfh" to float_to_int() so that function represents the driver name. This function will be cal

[PATCH v4 16/17] platform/x86/amd/pmf: Add PMF-AMDSFH interface for HPD

2023-10-18 Thread Shyam Sundar S K
From: Basavaraj Natikar AMDSFH has information about the User presence information via the Human Presence Detection (HPD) sensor which is part of the AMD sensor fusion hub. Add PMF and AMDSFH interface to get this information. Co-developed-by: Shyam Sundar S K Signed-off-by: Shyam Sundar S K S

[PATCH v4 17/17] platform/x86/amd/pmf: Add PMF-AMDSFH interface for ALS

2023-10-18 Thread Shyam Sundar S K
From: Basavaraj Natikar AMDSFH has information about the Ambient light via the Ambient Light Sensor (ALS) which is part of the AMD sensor fusion hub. Add PMF and AMDSFH interface to get this information. Reviewed-by: Mario Limonciello Co-developed-by: Shyam Sundar S K Signed-off-by: Shyam Sund

RE: [PATCH 4/6] drm/amdgpu: bypass RAS error reset in some conditions

2023-10-18 Thread Yang, Stanley
[AMD Official Use Only - General] > -Original Message- > From: Zhou1, Tao > Sent: Tuesday, October 17, 2023 8:46 PM > To: amd-gfx@lists.freedesktop.org; Zhang, Hawking > ; Yang, Stanley ; Li, > Candice ; Chai, Thomas ; > Lazar, Lijo ; Wang, Yang(Kevin) > > Cc: Zhou1, Tao > Subject: [PAT

[PATCH] drm/amdgpu: support saving bad pages after gpu ras reset

2023-10-18 Thread YiPeng Chai
Support saving bad pages after gpu ras reset for umc_v12_0. Signed-off-by: YiPeng Chai --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 40 + drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c | 35 ++ drivers/gpu/drm/

RE: [PATCH 6/6] drm/amdgpu: drop status reset for GCEA 9.4.3 and MMEA 1.8

2023-10-18 Thread Yang, Stanley
[AMD Official Use Only - General] PMfw doesn't reset any ce/ue status and count in debug mode, who takes responsible for it if in debug mode. Regards, Stanley > -Original Message- > From: Zhou1, Tao > Sent: Tuesday, October 17, 2023 8:46 PM > To: amd-gfx@lists.freedesktop.org; Zhang, Ha

[PATCH] drm/amdkfd: Fix shift out-of-bounds issue

2023-10-18 Thread Jesse Zhang
[ 567.613292] shift exponent 255 is too large for 64-bit type 'long unsigned int' [ 567.614498] CPU: 5 PID: 238 Comm: kworker/5:1 Tainted: G OE 6.2.0-34-generic #34~22.04.1-Ubuntu [ 567.614502] Hardware name: AMD Splinter/Splinter-RPL, BIOS WS43927N_871 09/25/2023 [ 567.614504

Re: [PATCH] drm/amdgpu: Remove redundant call to priority_is_valid()

2023-10-18 Thread Christian König
Am 18.10.23 um 03:03 schrieb Luben Tuikov: Remove a redundant call to amdgpu_ctx_priority_is_valid() from amdgpu_ctx_priority_permit(), which is called from amdgpu_ctx_init() which is called from amdgpu_ctx_alloc() which is called from amdgpu_ctx_ioctl(), where we've called amdgpu_ctx_priority_is

Re: [PATCH v4 13/17] platform/x86/amd/pmf: Add PMF-AMDGPU get interface

2023-10-18 Thread Shyam Sundar S K
On 10/18/2023 2:50 PM, Ilpo Järvinen wrote: > On Wed, 18 Oct 2023, Shyam Sundar S K wrote: > >> In order to provide GPU inputs to TA for the Smart PC solution to work, we >> need to have interface between the PMF driver and the AMDGPU driver. >> >> Add the initial code path for get interface fr

[PATCH 1/6] drm/amdgpu: define ras_reset_error_count function

2023-10-18 Thread Tao Zhou
Make the code architecture more simple. v2: reuse ras_reset_error_count in ras_reset_error_status. Signed-off-by: Tao Zhou --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 19 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 2 ++ 2 files changed, 17 insertions(+), 4 deletions(-) di

[PATCH 2/6] drm/amdgpu: replace reset_error_count with amdgpu_ras_reset_error_count

2023-10-18 Thread Tao Zhou
Simplify the code. Signed-off-by: Tao Zhou --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 9 ++--- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 7 ++- drivers/gpu/drm/amd/amdgp

[PATCH 3/6] drm/amdgpu: add set/get mca debug mode operations

2023-10-18 Thread Tao Zhou
Record the debug mode status in RAS. Signed-off-by: Tao Zhou --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 21 + drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 5 + 2 files changed, 26 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/

[PATCH 5/6] drm/amdgpu: bypass RAS error reset in some conditions

2023-10-18 Thread Tao Zhou
PMFW is responsible for RAS error reset in some conditions, driver can skip the operation. v2: add check for ras->in_recovery, it's set earlier than amdgpu_in_reset. v3: fix error in gpu reset check. Signed-off-by: Tao Zhou --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 10 +- 1 file ch

[PATCH 4/6] drm/amd/pm: record mca debug mode in RAS

2023-10-18 Thread Tao Zhou
Call amdgpu_ras_set_mca_debug_mode when we set mca debug mode in smu v13_0_6. Signed-off-by: Tao Zhou --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/

[PATCH 6/6] drm/amdgpu: drop status query/reset for GCEA 9.4.3 and MMEA 1.8

2023-10-18 Thread Tao Zhou
PMFW will be responsible for them. v2: remove query interfaces. Signed-off-by: Tao Zhou --- drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 60 -- drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c | 143 2 files changed, 203 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgp

RE: [PATCH 6/6] drm/amdgpu: drop status query/reset for GCEA 9.4.3 and MMEA 1.8

2023-10-18 Thread Zhang, Hawking
[AMD Official Use Only - General] Series is Reviewed-by: Hawking Zhang Regards, Hawking -Original Message- From: Zhou1, Tao Sent: Wednesday, October 18, 2023 19:40 To: amd-gfx@lists.freedesktop.org; Zhang, Hawking ; Yang, Stanley ; Li, Candice ; Chai, Thomas ; Lazar, Lijo ; Wang, Ya

[PATCH Review 1/1] drm/amdgpu: Enable mca debug mode mode for apu

2023-10-18 Thread Stanley . Yang
Enable smu_v13_0_6 mca debug mode when GFX RAS feature is enabled on APU. Signed-off-by: Stanley.Yang --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu

RE: [PATCH Review 1/1] drm/amdgpu: Enable mca debug mode mode for apu

2023-10-18 Thread Zhou1, Tao
[AMD Official Use Only - General] > -Original Message- > From: amd-gfx On Behalf Of > Stanley.Yang > Sent: Wednesday, October 18, 2023 8:22 PM > To: amd-gfx@lists.freedesktop.org > Cc: Yang, Stanley > Subject: [PATCH Review 1/1] drm/amdgpu: Enable mca debug mode mode for apu [Tao] the "m

RE: [PATCH Review 1/1] drm/amdgpu: Enable mca debug mode mode for apu

2023-10-18 Thread Zhang, Hawking
[AMD Official Use Only - General] Let's not rely on specific IP block. Just check adev->ras_enabled. Regards, Hawking -Original Message- From: amd-gfx On Behalf Of Stanley.Yang Sent: Wednesday, October 18, 2023 20:22 To: amd-gfx@lists.freedesktop.org Cc: Yang, Stanley Subject: [PATCH R

[PATCH 1/2] drm/amdgpu: Enable software RAS in vcn v4_0_3

2023-10-18 Thread Hawking Zhang
Set VCN/JPEG RAS masks to enable software RAS for VCN and JPEG. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/am

[PATCH 2/2] drm/amdgpu: Add UVD_VCPU_INT_EN2 to dpg sram

2023-10-18 Thread Hawking Zhang
Add RAS sepcifc programming to dpg sram. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou --- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c index f85d18cd74ec.

Re: [PATCH v4 13/17] platform/x86/amd/pmf: Add PMF-AMDGPU get interface

2023-10-18 Thread Ilpo Järvinen
On Wed, 18 Oct 2023, Shyam Sundar S K wrote: > On 10/18/2023 2:50 PM, Ilpo Järvinen wrote: > > On Wed, 18 Oct 2023, Shyam Sundar S K wrote: > > > >> In order to provide GPU inputs to TA for the Smart PC solution to work, we > >> need to have interface between the PMF driver and the AMDGPU driver.

[PATCH -next] drm/amd/display: Remove duplicated include in dce110_hwseq.c

2023-10-18 Thread Yang Li
./drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c: dce110_hwseq.h is included more than once. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6897 Signed-off-by: Yang Li --- drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c | 2 -- 1 file chang

Re: [PATCH v4 11/17] platform/x86/amd/pmf: Add capability to sideload of policy binary

2023-10-18 Thread Ilpo Järvinen
On Wed, 18 Oct 2023, Shyam Sundar S K wrote: > A policy binary is OS agnostic, and the same policies are expected to work > across the OSes. At times it becomes difficult to debug when the policies > inside the policy binaries starts to misbehave. Add a way to sideload such > policies independent

[PATCH -next] drm/amd/display: Simplify bool conversion

2023-10-18 Thread Yang Li
./drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c:4802:84-89: WARNING: conversion to bool not needed here Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6901 Signed-off-by: Yang Li --- drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c | 2 +- 1 fi

[PATCH -next] drm/amd/display: Remove unneeded semicolon

2023-10-18 Thread Yang Li
./drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c:464:3-4: Unneeded semicolon Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6900 Signed-off-by: Yang Li --- drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c | 2 +- 1 file changed, 1 insert

Re: [PATCH v4 12/17] platform/x86/amd/pmf: dump policy binary data

2023-10-18 Thread Ilpo Järvinen
On Wed, 18 Oct 2023, Shyam Sundar S K wrote: > Sometimes policy binary retrieved from the BIOS maybe incorrect that can > end up in failing to enable the Smart PC solution feature. > > Use print_hex_dump_debug() to dump the policy binary in hex, so that we > debug the issues related to the binary

Re: [PATCH v4 10/17] platform/x86/amd/pmf: Add facility to dump TA inputs

2023-10-18 Thread Ilpo Järvinen
On Wed, 18 Oct 2023, Shyam Sundar S K wrote: > PMF driver sends constant inputs to TA which its gets via the other > subsystems in the kernel. To debug certain TA issues knowing what inputs > being sent to TA becomes critical. Add debug facility to the driver which > can isolate Smart PC and TA re

Re: [PATCH v4 16/17] platform/x86/amd/pmf: Add PMF-AMDSFH interface for HPD

2023-10-18 Thread Ilpo Järvinen
On Wed, 18 Oct 2023, Shyam Sundar S K wrote: > From: Basavaraj Natikar > > AMDSFH has information about the User presence information via the Human > Presence Detection (HPD) sensor which is part of the AMD sensor fusion hub. > Add PMF and AMDSFH interface to get this information. > > Co-develo

Re: [PATCH v4 13/17] platform/x86/amd/pmf: Add PMF-AMDGPU get interface

2023-10-18 Thread Ilpo Järvinen
On Wed, 18 Oct 2023, Shyam Sundar S K wrote: > In order to provide GPU inputs to TA for the Smart PC solution to work, we > need to have interface between the PMF driver and the AMDGPU driver. > > Add the initial code path for get interface from AMDGPU. > > Co-developed-by: Mario Limonciello >

[PATCH] drm/amd/display: Use swap() instead of open coding it

2023-10-18 Thread Jiapeng Chong
Swap is a function interface that provides exchange function. To avoid code duplication, we can use swap function. ./drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c:445:127-128: WARNING opportunity for swap(). Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.

Re: [PATCH v4 15/17] HID: amd_sfh: rename float_to_int() to amd_sfh_float_to_int()

2023-10-18 Thread Ilpo Järvinen
On Wed, 18 Oct 2023, Shyam Sundar S K wrote: > From: Basavaraj Natikar > > Current amd_sfh driver has float_to_int() to convert units from > float to int. This is fine until this function gets called outside of > the current scope of file. > > Add a prefix "amd_sfh" to float_to_int() so that fu

[PATCH Review V2 1/1] drm/amdgpu: Enable mca debug mode mode when ras enabled

2023-10-18 Thread Stanley . Yang
Enable smu_v13_0_6 mca debug mode if ras is enabled. Changed from V1: enable mca debug mode if ras enabled. Signed-off-by: Stanley.Yang --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/sws

[PATCH 1/2] drm/amdgpu: don't use ATRM for external devices

2023-10-18 Thread Alex Deucher
The ATRM ACPI method is for fetching the dGPU vbios rom image on laptops and all-in-one systems. It should not be used for external add in cards. If the dGPU is thunderbolt connected, don't try ATRM. v2: pci_is_thunderbolt_attached only works for Intel. Use pdev->external_facing instead. v3

RE: [PATCH Review V2 1/1] drm/amdgpu: Enable mca debug mode mode when ras enabled

2023-10-18 Thread Zhang, Hawking
[AMD Official Use Only - General] Reviewed-by: Hawking Zhang Regards, Hawking -Original Message- From: amd-gfx On Behalf Of Stanley.Yang Sent: Wednesday, October 18, 2023 21:10 To: amd-gfx@lists.freedesktop.org Cc: Yang, Stanley Subject: [PATCH Review V2 1/1] drm/amdgpu: Enable mca deb

[PATCH 2/2] drm/amdgpu: don't use pci_is_thunderbolt_attached()

2023-10-18 Thread Alex Deucher
It's only valid on Intel systems with the Intel VSEC. Use dev_is_removable() instead. This should do the right thing regardless of the platform. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2925 Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 dr

RE: [PATCH] drm/amdkfd: Fix shift out-of-bounds issue

2023-10-18 Thread Zhang, Yifan
[AMD Official Use Only - General] Hi Jesse, This patch is only a WA for the error log. How is this issue reproduced ? 255 looks like an invalid value for a prange->granularity, it is better to root cause who set it in the first place. BRs, Yifan -Original Message- From: Jesse Zhang S

Re: [PATCH v4 13/17] platform/x86/amd/pmf: Add PMF-AMDGPU get interface

2023-10-18 Thread Christian König
Am 18.10.23 um 11:28 schrieb Shyam Sundar S K: On 10/18/2023 2:50 PM, Ilpo Järvinen wrote: On Wed, 18 Oct 2023, Shyam Sundar S K wrote: In order to provide GPU inputs to TA for the Smart PC solution to work, we need to have interface between the PMF driver and the AMDGPU driver. Add the i

Re: [PATCH -next] drm/amd/display: clean up some inconsistent indentings

2023-10-18 Thread Alex Deucher
Applied. Thanks! On Wed, Sep 27, 2023 at 9:14 PM Yang Li wrote: > > drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn35/dcn35_fpu.c:261 > dcn35_update_bw_bounding_box_fpu() warn: inconsistent indenting > > Signed-off-by: Yang Li > --- > .../drm/amd/display/dc/dml/dcn35/dcn35_fpu.c | 144 +

Re: [PATCH -next] drm/amd/display: Remove duplicated include in dce110_hwseq.c

2023-10-18 Thread Alex Deucher
Applied. Thanks! On Tue, Oct 17, 2023 at 9:02 PM Yang Li wrote: > > ./drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c: dce110_hwseq.h > is included more than once. > > Reported-by: Abaci Robot > Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6897 > Signed-off-by: Yang Li > -

Re: [PATCH -next] drm/amd/display: Remove unneeded semicolon

2023-10-18 Thread Alex Deucher
Applied. Thanks! On Tue, Oct 17, 2023 at 9:16 PM Yang Li wrote: > > ./drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c:464:3-4: > Unneeded semicolon > > Reported-by: Abaci Robot > Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6900 > Signed-off-by: Yang Li > --- > drivers/

Re: [PATCH -next] drm/amd/display: Simplify bool conversion

2023-10-18 Thread Alex Deucher
Applied. Thanks! On Tue, Oct 17, 2023 at 9:22 PM Yang Li wrote: > > ./drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c:4802:84-89: > WARNING: conversion to bool not needed here > > Reported-by: Abaci Robot > Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6901 > Signed-off-by: Ya

Re: [PATCH] drm/amdkfd: Fix shift out-of-bounds issue

2023-10-18 Thread Philip Yang
The 255 granularity is from recent Thunk change to increase CWSR area granularity. Thanks for catching this with kernel debug option CC_HAS_UBSAN_ARRAY_BOUNDS enabled. Because 1

Re: [PATCH v2] drm/amdgpu: fix missing stuff in NBIO v7.11

2023-10-18 Thread Alex Deucher
On Wed, Oct 18, 2023 at 6:17 AM Li Ma wrote: > > add get_clockgating_state, update_medium_grain_light_sleep and > update_medium_grain_clock_gating in nbio_v7_11_funcs > v1: > add missing funcs in nbio_v7_11.c > v2: > modify the if condition and add spport for nbio v7.11 clockgating. > > Signed-off

Re: [PATCH v4 13/17] platform/x86/amd/pmf: Add PMF-AMDGPU get interface

2023-10-18 Thread Mario Limonciello
On 10/18/2023 08:40, Christian König wrote: Am 18.10.23 um 11:28 schrieb Shyam Sundar S K: On 10/18/2023 2:50 PM, Ilpo Järvinen wrote: On Wed, 18 Oct 2023, Shyam Sundar S K wrote: In order to provide GPU inputs to TA for the Smart PC solution to work, we need to have interface between the

Re: [PATCH v4 13/17] platform/x86/amd/pmf: Add PMF-AMDGPU get interface

2023-10-18 Thread Christian König
Am 18.10.23 um 17:47 schrieb Mario Limonciello: On 10/18/2023 08:40, Christian König wrote: Am 18.10.23 um 11:28 schrieb Shyam Sundar S K: On 10/18/2023 2:50 PM, Ilpo Järvinen wrote: On Wed, 18 Oct 2023, Shyam Sundar S K wrote: In order to provide GPU inputs to TA for the Smart PC solution

Re: [PATCH] drm/amdkfd: Fix shift out-of-bounds issue

2023-10-18 Thread Chen, Xiaogang
On 10/18/2023 9:53 AM, Philip Yang wrote: Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding. The 255 granularity is from recent Thunk change to increase CWSR area granularity. I think we also nee

Re: [PATCH v4 13/17] platform/x86/amd/pmf: Add PMF-AMDGPU get interface

2023-10-18 Thread Shyam Sundar S K
On 10/18/2023 9:37 PM, Christian König wrote: > Am 18.10.23 um 17:47 schrieb Mario Limonciello: >> On 10/18/2023 08:40, Christian König wrote: >>> >>> >>> Am 18.10.23 um 11:28 schrieb Shyam Sundar S K: On 10/18/2023 2:50 PM, Ilpo Järvinen wrote: > On Wed, 18 Oct 2023, Shyam Sundar

[PATCH v7c 00/24] fix DRM_USE_DYNAMIC_DEBUG=y regression

2023-10-18 Thread Jim Cromie
hi Jason, DRM-folk (v7c now with all checkpatch fixes) This patchest fixes the chicken-egg initialization problem in the 1st version of ddebug-class-maps, that DRM-CI uncovered. The root-problem was DECLARE_DYNDBG_CLASSMAP, which broke the K&R rule: "define once, refer many". In patch 14 it i

[PATCH v7c 01/24] test-dyndbg: fixup CLASSMAP usage error

2023-10-18 Thread Jim Cromie
more careful reading of test output reveals: lib/test_dynamic_debug.c:103 [test_dynamic_debug]do_cats =pmf "doing categories\n" lib/test_dynamic_debug.c:105 [test_dynamic_debug]do_cats =p "LOW msg\n" class:MID lib/test_dynamic_debug.c:106 [test_dynamic_debug]do_cats =p "MID msg\n" class:HI lib/t

[PATCH v7c 02/24] dyndbg: reword "class unknown, " to "class:_UNKNOWN_"

2023-10-18 Thread Jim Cromie
This appears in the control-file to report an unknown class-name, which indicates that the class_id is not authorized, and dyndbg will ignore changes to it. Generally, this means that a DYNDBG_CLASSMAP_DEFINE or DYNDBG_CLASSMAP_USE is missing. But the word "unknown" appears in quite a few prdbg f

[PATCH v7c 03/24] dyndbg: make ddebug_class_param union members same size

2023-10-18 Thread Jim Cromie
struct ddebug_class_param keeps a ref to the state-storage of the param, make both flavors use the same unsigned long under-type. ISTM this is simpler and safer. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 2 +- lib/dynamic_debug.c | 2 +- 2 files changed, 2 insertion

[PATCH v7c 04/24] dyndbg: replace classmap list with a vector

2023-10-18 Thread Jim Cromie
Classmaps are stored/linked in a section/array, but are each added to the module's ddebug_table.maps list-head. This is unnecessary; even when ddebug_attach_classmap() is handling the builtin section (with classmaps for multiple builtin modules), its contents are ordered, so a module's possibly mu

[PATCH v7c 05/24] dyndbg: ddebug_apply_class_bitmap - add module arg, select on it

2023-10-18 Thread Jim Cromie
Add query_module param to ddebug_apply_class_bitmap(). This allows its caller to update just one module, or all (as currently). We'll use this later to propagate drm.debug to each USEr as they're modprobed. No functional change. Signed-off-by: Jim Cromie --- after `modprobe i915`, heres the m

[PATCH v7c 06/24] dyndbg: split param_set_dyndbg_classes to module/wrapper fns

2023-10-18 Thread Jim Cromie
rename param_set_dyndbg_classes: add _module_ name & arg, old name is wrapper to new. New arg allows caller to specify that only one module is affected by a prdbgs update. Outer fn preserves kernel_param interface, passing NULL to inner fn. This selectivity will be used later to narrow the scope

[PATCH v7c 07/24] dyndbg: drop NUM_TYPE_ARRAY

2023-10-18 Thread Jim Cromie
ARRAY_SIZE works here, since array decl is complete. no functional change Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index b53217e4b711..8116d0a0

[PATCH v7c 08/24] dyndbg: reduce verbose/debug clutter

2023-10-18 Thread Jim Cromie
currently, for verbose=3, these are logged (blank lines for clarity): dyndbg: query 0: "class DRM_UT_CORE +p" mod:* dyndbg: split into words: "class" "DRM_UT_CORE" "+p" dyndbg: op='+' dyndbg: flags=0x1 dyndbg: *flagsp=0x1 *maskp=0x dyndbg: parsed: func="" file="" module="" format="

[PATCH v7c 10/24] dyndbg: tighten ddebug_class_name() 1st arg type

2023-10-18 Thread Jim Cromie
Change function's 1st arg-type, and deref in the caller. The fn doesn't need any other fields in the struct. no functional change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_d

[PATCH v7c 09/24] dyndbg: silence debugs with no-change updates

2023-10-18 Thread Jim Cromie
check for actual changes before announcing them, declutter logs. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index b0e11f6bfaa2..b07aab422604 100644 --- a/lib/dynamic_

[PATCH v7c 12/24] dyndbg: reduce verbose=3 messages in ddebug_add_module

2023-10-18 Thread Jim Cromie
The fn currently says "add-module", then "skipping" if the module has no prdbgs. Just check 1st and return quietly. no functional change Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynami

[PATCH v7c 16/24] dyndbg-API: promote DYNDBG_CLASSMAP_PARAM to API

2023-10-18 Thread Jim Cromie
move the DYNDBG_CLASSMAP_PARAM macro from test-dynamic-debug.c into the header, and refine it, by distinguishing the 2 use cases: 1.DYNDBG_CLASSMAP_PARAM_REF for DRM, to pass in extern __drm_debug by name. dyndbg keeps bits in it, so drm can still use it as before 2.DYNDBG_CLASSMAP_PARAM

[PATCH v7c 14/24] dyndbg-API: fix CONFIG_DRM_USE_DYNAMIC_DEBUG regression

2023-10-18 Thread Jim Cromie
DECLARE_DYNDBG_CLASSMAP() has a design error; it fails a basic K&R rule: "define once, refer many times". When DRM_USE_DYNAMIC_DEBUG=y, DECLARE_DYNDBG_CLASSMAP() is used across DRM core & drivers; they all repeat the same classmap-defn args, which must match for the modules to respond together whe

[PATCH v7c 18/24] dyndbg: reserve flag bit _DPRINTK_FLAGS_PREFIX_CACHED

2023-10-18 Thread Jim Cromie
Reserve bit 7 to remember that a pr-debug callsite is/was: - enabled, with +p - wants a dynamic-prefix, with one+ of module:function:sourcfile - was previously called - was thus saved in the cache. NOT YET. Its unclear whether any cache fetch would be faster than 2-3 field fetches, but theres anot

[PATCH v7c 19/24] dyndbg: add _DPRINTK_FLAGS_INCL_LOOKUP

2023-10-18 Thread Jim Cromie
dyndbg's dynamic prefixing (by +tmfsl flags) is needlessly expensive. When an enabled (with +p) pr_debug is called, _DPRINTK_FLAGS_INCL_ANY prefix decorations are sprintf'd into stack-mem for every call. This string (or part of it) could be cached once its 1st generated, and retrieved thereafter,

[PATCH v7c 21/24] dyndbg: change WARN_ON to WARN_ON_ONCE

2023-10-18 Thread Jim Cromie
This shouldn't ever happen, and 1st 2 conditions never have. The 3rd condition did happen, due to corrupt linkage due to a missing align(8) in DYNDBG_CLASSMAP_USE, on the static struct allocation into the __dyndbg_class_users section. Not sure whether changing to _ONCE is appropriate - this is a

[PATCH v7c 22/24] drm: use correct ccflags-y spelling

2023-10-18 Thread Jim Cromie
Incorrectly spelled CFLAGS- failed to add -DDYNAMIC_DEBUG_MODULE, which broke builds with: CONFIG_DRM_USE_DYNAMIC_DEBUG=y CONFIG_DYNAMIC_DEBUG_CORE=y CONFIG_DYNAMIC_DEBUG=n Also add subdir-ccflags so that all drivers pick up the addition. Fixes: 84ec67288c10 ("drm_print: wrap drm_*_dbg in dyndbg

[PATCH v7c 13/24] dyndbg-API: remove DD_CLASS_TYPE_(DISJOINT|LEVEL)_NAMES and code

2023-10-18 Thread Jim Cromie
Remove the NAMED class types; these 2 classmap types accept class names at the PARAM interface, for example: echo +DRM_UT_CORE,-DRM_UT_KMS > /sys/module/drm/parameters/debug_names The code works, but its only used by test-dynamic-debug, and wasn't asked for by anyone else, so simplify things fo

[PATCH v7c 11/24] dyndbg: tighten fn-sig of ddebug_apply_class_bitmap

2023-10-18 Thread Jim Cromie
old_bits arg is currently a pointer to the input bits, but this could allow inadvertent changes to the input by the fn. Disallow this. And constify new_bits while here. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-

[PATCH v7c 20/24] dyndbg: refactor *dynamic_emit_prefix

2023-10-18 Thread Jim Cromie
Refactor the split of duties between outer & inner fns. The outer fn was previously just an inline unlikely forward to inner, which did all the work. Now, outer handles +t and +l flags itself, and calls inner only when _DPRINTK_FLAGS_INCL_LOOKUP is needed. No functional change. But it does make

[PATCH v7c 17/24] dyndbg-doc: add classmap info to howto

2023-10-18 Thread Jim Cromie
Add some basic info on classmap usage and api cc: linux-...@vger.kernel.org Signed-off-by: Jim Cromie --- v5- adjustments per Randy Dunlap, me v7b- checkpatch fixes --- .../admin-guide/dynamic-debug-howto.rst | 60 ++- 1 file changed, 59 insertions(+), 1 deletion(-) diff -

[PATCH v7c 15/24] dyndbg: refactor ddebug_classparam_clamp_input

2023-10-18 Thread Jim Cromie
Extract input validation code, from param_set_dyndbg_module_classes() (the sys-node >handler) to new: ddebug_classparam_clamp_input(kp), call it from former. It takes kernel-param arg, so it can complain about "foo: bad input". Reuse ddparam_clamp_input(kp) in ddebug_sync_classbits(), to validate

[PATCH v7c 24/24] drm: restore CONFIG_DRM_USE_DYNAMIC_DEBUG un-BROKEN

2023-10-18 Thread Jim Cromie
Lots of burn-in testing needed before signing, upstreaming. NOTE: I set default Y to maximize testing by default. Is there a better way to do this ? Signed-off-by: Jim Cromie --- drivers/gpu/drm/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/Kconfi

[PATCH v7c 23/24] drm-drivers: DRM_CLASSMAP_USE in 2nd batch of drivers, helpers

2023-10-18 Thread Jim Cromie
Add a DRM_CLASSMAP_USE declaration to 2nd batch of helpers and *_drv.c files. For drivers, add the decl just above the module's PARAMs, since it identifies the "inherited" drm.debug param. Note: with CONFIG_DRM_USE_DYNAMIC_DEBUG=y, a module not also declaring DRM_CLASSMAP_USE will have its class'

[PATCH 00/26] DC Patches October 18, 2023

2023-10-18 Thread Roman.Li
From: Roman Li This DC patchset brings improvements in multiple areas. In summary, we highlight: * Fixes null-deref regression after "drm/amd/display: Update OPP counter from new interface" * Fixes display flashing when VSR and HDR enabled on dcn32 * Fixes dcn3x intermittent hangs due to FPO *

[PATCH 01/26] drm/amd/display: remove duplicated edp relink to fastboot

2023-10-18 Thread Roman.Li
From: Chiawen Huang [Why&How] enable_accelerated_mode function is fully to check whether fastboot support or not. It is no longer to disable_vbios_mode_if_required. enable_stream_timing is allowed when seamless/fast boot are disabled. Reviewed-by: Charlene Liu Acked-by: Roman Li Signed-off-by:

[PATCH 02/26] drm/amd/display: reprogram det size while seamless boot

2023-10-18 Thread Roman.Li
From: Hugo Hu [Why] During system boot in second screen only mode on a seamless boot system, there is a chance that the pipe's det size might not be reset. [How] Reset the det size while resetting the pipe during seamless boot. Reviewed-by: Dmytro Laktyushkin Acked-by: Roman Li Signed-off-by:

[PATCH 03/26] drm/amd/display: Remove power sequencing check

2023-10-18 Thread Roman.Li
From: Agustin Gutierrez [Why] Some ASICs keep backlight powered on after dpms off command has been issued. [How] The check for no edp power sequencing was never going to pass. The value is never changed from what it is set by design. Reviewed-by: Swapnil Patel A

[PATCH 07/26] drm/amd/display: Update SDP VSC colorimetry from DP test automation request

2023-10-18 Thread Roman.Li
From: George Shen [Why] Certain test equipment vendors check the SDP VSC for colorimetry against the value from the test request during certain DP link layer tests for YCbCr test cases. [How] Update SDP VSC with colorimetry from test automation request. Reviewed-by: Wenjing Liu Acked-by: Roman

[PATCH 09/26] drm/amd/display: add pipe resource management callbacks to DML2

2023-10-18 Thread Roman.Li
From: Wenjing Liu [why] Need DML2 to support new pipe resource management APIs. Reviewed-by: Chaitanya Dhere Acked-by: Roman Li Signed-off-by: Wenjing Liu --- .../gpu/drm/amd/display/dc/dcn32/dcn32_resource.c | 5 + .../drm/amd/display/dc/dcn321/dcn321_resource.c | 5 + .../gpu/d

[PATCH 04/26] drm/amd/display: Fix MST Multi-Stream Not Lighting Up on dcn35

2023-10-18 Thread Roman.Li
From: Fangzhi Zuo dcn35 misses .enable_symclk_se hook that makes MST DSC not functional when having multiple FE clk to be enabled. Reviewed-by: Rodrigo Siqueira Acked-by: Roman Li Signed-off-by: Fangzhi Zuo --- drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 6 ++ 1 file change

[PATCH 06/26] drm/amd/display: Add a check for idle power optimization

2023-10-18 Thread Roman.Li
From: Sung Joon Kim [why] Need a helper function to check idle power is allowed so that dc doesn't access any registers that are power-gated. [how] Implement helper function to check idle power optimization. Enable a hook to check if detection is allowed. V2: Add function hooks for set and get

[PATCH 05/26] drm/amd/display: Revert "Improve x86 and dmub ips handshake"

2023-10-18 Thread Roman.Li
From: Nicholas Kazlauskas This reverts commit 8316378d272ed96f60177cc9a8beaadb8640f745. Causes intermittent hangs during reboot stress testing. Reviewed-by: Duncan Ma Acked-by: Roman Li Signed-off-by: Nicholas Kazlauskas --- .../display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 37 .

[PATCH 08/26] drm/amd/display: Reduce default backlight min from 5 nits to 1 nits

2023-10-18 Thread Roman.Li
From: Swapnil Patel [Why & How] Currently set_default_brightness_aux function uses 5 nits as lower limit to check for valid default_backlight setting. However some newer panels can support even lower default settings Reviewed-by: Agustin Gutierrez Acked-by: Roman Li Signed-off-by: Swapnil Pate

[PATCH 12/26] drm/amd/display: Fix HDMI framepack 3D test issue

2023-10-18 Thread Roman.Li
From: Sung Joon Kim [why] Bandwidth validation failure on framepack tests. Need to double pixel clock when 3D format is framepack. Also for HDMI displays, we need to keep the ITC flag to 1 by default. [how] Double the pixel clock when using framepack 3D format. Set hdmi ITC bit to 1. Reviewed-b

[PATCH 10/26] drm/amd/display: implement map dc pipe with callback in DML2

2023-10-18 Thread Roman.Li
From: Wenjing Liu [why] Unify pipe resource management logic in dc resource layer. Reviewed-by: Chaitanya Dhere Acked-by: Roman Li Signed-off-by: Wenjing Liu --- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 1 + .../display/dc/dml2/dml2_dc_resource_mgmt.c | 144 ++ ...

  1   2   >