Re: mainline build failure (new) for x86_64 allmodconfig with clang

2022-09-17 Thread Nathan Chancellor
Hi Sudip,

On Sat, Sep 17, 2022 at 11:55:05AM +0100, Sudip Mukherjee (Codethink) wrote:
> Hi All,
> 
> The latest mainline kernel branch fails to build for x86_64 allmodconfig
> with clang. The errors are:
> 
> drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn314/display_mode_vba_314.c:4020:6:
>  error: stack frame size (2184) exceeds limit (2048) in 
> 'dml314_ModeSupportAndSystemConfigurationFull' [-Werror,-Wframe-larger-than]
> void dml314_ModeSupportAndSystemConfigurationFull(struct display_mode_lib 
> *mode_lib)
>  ^
> 1 error generated.
> 
> 
> Note: This is a new error seen on top on a335366bad13 ("Merge tag 
> 'gpio-fixes-for-v6.0-rc6' of 
> git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux").
> Previous reported clang build error is now fixed, thanks to Nathan.
> 
> And, it appears Nathan has already sent a fix for this:
> https://github.com/intel-lab-lkp/linux/commit/4ecc45d7585ae2e05d622879ad97e13a7d8c595b
> https://github.com/intel-lab-lkp/linux/commit/819976a950b497d7f10cd9a198a94c26a9005b30

I did not realize this was a mainline issue too :( it seems that
commit af2f2a256e04 ("drm/amd/display: Enable dlg and vba compilation
for dcn314") is needed to see this and it was only in -next for three
releases (20220914 to 20220916), which I missed checking as closely as I
normally do due to Plumbers wrapping up and traveling.

The series is on the mailing lists at
https://lore.kernel.org/20220916210658.3412450-1-nat...@kernel.org/,
which is basically just 's/31/314/g' on the dml31 fixes because the code
is identical. Hopefully those two patches can be picked up in the same
manner as the other ones so that x86_64 allmodconfig does not ship
broken in 6.0 and thank you to the AMD folks for moving on those
already!

Cheers,
Nathan


Re: [PATCH 1/2] drm/amd/display: Reduce number of arguments of dml314's CalculateWatermarksAndDRAMSpeedChangeSupport()

2022-09-17 Thread Maíra Canal
Hi Nathan,

On 9/16/22 18:06, Nathan Chancellor wrote:
> Most of the arguments are identical between the two call sites and they
> can be accessed through the 'struct vba_vars_st' pointer. This reduces
> the total amount of stack space that
> dml314_ModeSupportAndSystemConfigurationFull() uses by 240 bytes with
> LLVM 16 (2216 -> 1976), helping clear up the following clang warning:
> 
>   
> drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn314/display_mode_vba_314.c:4020:6:
>  error: stack frame size (2216) exceeds limit (2048) in 
> 'dml314_ModeSupportAndSystemConfigurationFull' [-Werror,-Wframe-larger-than]
>   void dml314_ModeSupportAndSystemConfigurationFull(struct display_mode_lib 
> *mode_lib)
>^
>   1 error generated.
> 
> Link: https://github.com/ClangBuiltLinux/linux/issues/1710
> Reported-by: "kernelci.org bot" 
> Signed-off-by: Nathan Chancellor 

I have built-tested the whole series with clang 14.0.5 (Fedora
14.0.5-1.fc36), using:

$ make -kj"$(nproc)" ARCH=x86_64 LLVM=1 mrproper allmodconfig
drivers/gpu/drm/amd/amdgpu/

Another great patch to the DML! As Tom, I also would like to see this
expand to all display_mode_vba files, but so far this is great to
unbreak the build.

To the whole series:

Tested-by: Maíra Canal 

Best Regards,
- Maíra Canal

> ---
> 
> This is just commit ab2ac59c32db ("drm/amd/display: Reduce number of
> arguments of dml31's CalculateWatermarksAndDRAMSpeedChangeSupport()")
> applied to dml314.
> 
>  .../dc/dml/dcn314/display_mode_vba_314.c  | 248 --
>  1 file changed, 52 insertions(+), 196 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c 
> b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
> index 2829f179f982..32ceb72f7a14 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
> @@ -325,64 +325,28 @@ static void 
> CalculateVupdateAndDynamicMetadataParameters(
>  static void CalculateWatermarksAndDRAMSpeedChangeSupport(
>   struct display_mode_lib *mode_lib,
>   unsigned int PrefetchMode,
> - unsigned int NumberOfActivePlanes,
> - unsigned int MaxLineBufferLines,
> - unsigned int LineBufferSize,
> - unsigned int WritebackInterfaceBufferSize,
>   double DCFCLK,
>   double ReturnBW,
> - bool SynchronizedVBlank,
> - unsigned int dpte_group_bytes[],
> - unsigned int MetaChunkSize,
>   double UrgentLatency,
>   double ExtraLatency,
> - double WritebackLatency,
> - double WritebackChunkSize,
>   double SOCCLK,
> - double DRAMClockChangeLatency,
> - double SRExitTime,
> - double SREnterPlusExitTime,
> - double SRExitZ8Time,
> - double SREnterPlusExitZ8Time,
>   double DCFCLKDeepSleep,
>   unsigned int DETBufferSizeY[],
>   unsigned int DETBufferSizeC[],
>   unsigned int SwathHeightY[],
>   unsigned int SwathHeightC[],
> - unsigned int LBBitPerPixel[],
>   double SwathWidthY[],
>   double SwathWidthC[],
> - double HRatio[],
> - double HRatioChroma[],
> - unsigned int vtaps[],
> - unsigned int VTAPsChroma[],
> - double VRatio[],
> - double VRatioChroma[],
> - unsigned int HTotal[],
> - double PixelClock[],
> - unsigned int BlendingAndTiming[],
>   unsigned int DPPPerPlane[],
>   double BytePerPixelDETY[],
>   double BytePerPixelDETC[],
> - double DSTXAfterScaler[],
> - double DSTYAfterScaler[],
> - bool WritebackEnable[],
> - enum source_format_class WritebackPixelFormat[],
> - double WritebackDestinationWidth[],
> - double WritebackDestinationHeight[],
> - double WritebackSourceHeight[],
>   bool UnboundedRequestEnabled,
>   unsigned int CompressedBufferSizeInkByte,
>   enum clock_change_support *DRAMClockChangeSupport,
> - double *UrgentWatermark,
> - double *WritebackUrgentWatermark,
> - double *DRAMClockChangeWatermark,
> - double *WritebackDRAMClockChangeWatermark,
>   double *StutterExitWatermark,
>   double *StutterEnterPlusExitWatermark,
>   double *Z8StutterExitWatermark,
> - double *Z8StutterEnterPlusExitWatermark,
> - double *MinActiveDRAMClockChangeLatencySupported);
> + double *Z8StutterEnterPlusExitWatermark);
>  
>  static void CalculateDCFCLKDeepSleep(
>   struct display_mode_lib *mode_lib,
> @@ -3041,64 +3005,28 @@ static void 
> 

RE: [PATCH] drm/amdgpu: add MES and MES-KIQ version in debugfs

2022-09-17 Thread Huang, Tim
[AMD Official Use Only - General]

Reviewed-by: Tim Huang 

Best Regards,
Tim Huang



-Original Message-
From: Zhang, Yifan 
Sent: Friday, September 16, 2022 12:39 PM
To: amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander ; Huang, Tim 
; Du, Xiaojian ; Zhang, Yifan 

Subject: [PATCH] drm/amdgpu: add MES and MES-KIQ version in debugfs

This patch addes MES and MES-KIQ version in debugfs.

Signed-off-by: Yifan Zhang 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 24 
 include/uapi/drm/amdgpu_drm.h   |  4 
 2 files changed, 28 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 1369c25448dc..bb0ed358909f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -328,6 +328,14 @@ static int amdgpu_firmware_info(struct 
drm_amdgpu_info_firmware *fw_info,
fw_info->ver = adev->psp.cap_fw_version;
fw_info->feature = adev->psp.cap_feature_version;
break;
+   case AMDGPU_INFO_FW_MES_KIQ:
+   fw_info->ver = adev->mes.ucode_fw_version[0];
+   fw_info->feature = 0;
+   break;
+   case AMDGPU_INFO_FW_MES:
+   fw_info->ver = adev->mes.ucode_fw_version[1];
+   fw_info->feature = 0;
+   break;
default:
return -EINVAL;
}
@@ -1581,6 +1589,22 @@ static int amdgpu_debugfs_firmware_info_show(struct 
seq_file *m, void *unused)
fw_info.feature, fw_info.ver);
}

+   /* MES_KIQ */
+   query_fw.fw_type = AMDGPU_INFO_FW_MES_KIQ;
+   ret = amdgpu_firmware_info(_info, _fw, adev);
+   if (ret)
+   return ret;
+   seq_printf(m, "MES_KIQ feature version: %u, firmware version: 0x%08x\n",
+  fw_info.feature, fw_info.ver);
+
+   /* MES */
+   query_fw.fw_type = AMDGPU_INFO_FW_MES;
+   ret = amdgpu_firmware_info(_info, _fw, adev);
+   if (ret)
+   return ret;
+   seq_printf(m, "MES feature version: %u, firmware version: 0x%08x\n",
+  fw_info.feature, fw_info.ver);
+
seq_printf(m, "VBIOS version: %s\n", ctx->vbios_version);

return 0;
diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h 
index c2c9c674a223..12fdf62730b8 100644
--- a/include/uapi/drm/amdgpu_drm.h
+++ b/include/uapi/drm/amdgpu_drm.h
@@ -755,6 +755,10 @@ struct drm_amdgpu_cs_chunk_data {
#define AMDGPU_INFO_FW_TOC  0x15
/* Subquery id: Query CAP firmware version */
#define AMDGPU_INFO_FW_CAP  0x16
+   /* Subquery id: Query MES_KIQ firmware version */
+   #define AMDGPU_INFO_FW_MES_KIQ  0x17
+   /* Subquery id: Query MES firmware version */
+   #define AMDGPU_INFO_FW_MES  0x18

 /* number of bytes moved for TTM migration */
 #define AMDGPU_INFO_NUM_BYTES_MOVED0x0f
--
2.37.3