[PATCH] drm/amd/display: fix unused variable warning

2021-01-25 Thread Arnd Bergmann
From: Arnd Bergmann After all users of the 'dm' warnings got hidden in an #ifdef, the compiler started warning about it being unused: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5380:33: error: unused variable 'dm' [-Werror,-Wunused-variable] Add another such #ifdef. Fixes

Re: [PATCH] drm/amd/display: use div_s64() for 64-bit division

2021-01-25 Thread Arnd Bergmann
On Mon, Jan 25, 2021 at 1:51 PM Chen, Guchun wrote: > > [AMD Public Use] > > Hi Arnd Bergmann, > > Thanks for your patch. This link error during compile has been fixed by below > commit and been submitted to drm-next branch already. > > 5da047444e82 drm/amd/display

[PATCH] amdgpu: fix clang build warning

2021-01-25 Thread Arnd Bergmann
From: Arnd Bergmann clang warns about the -mhard-float command line arguments on architectures that do not support this: clang: error: argument unused during compilation: '-mhard-float' [-Werror,-Wunused-command-line-argument] Move this into the gcc-specific arguments. Fixes: e77165bf7b02

[PATCH] amdgpu: securedisplay: simplify i2c hexdump output

2021-03-24 Thread Arnd Bergmann
From: Arnd Bergmann A previous fix I did left a rather complicated loop in amdgpu_securedisplay_debugfs_write() for what could be expressed in a simple sprintf, as Rasmus pointed out. This drops the leading 0x for each byte, but is otherwise much nicer. Suggested-by: Rasmus Villemoes Signed

Re: [PATCH] amdgpu: fix gcc -Wrestrict warning

2021-03-24 Thread Arnd Bergmann
On Tue, Mar 23, 2021 at 4:57 PM Rasmus Villemoes wrote: > On 23/03/2021 14.04, Arnd Bergmann wrote: > > if (securedisplay_cmd->status == > > TA_SECUREDISPLAY_STATUS__SUCCESS) { > > + int pos = 0; > >

[PATCH] amdgpu: fix gcc -Wrestrict warning

2021-03-23 Thread Arnd Bergmann
From: Arnd Bergmann gcc warns about an sprintf() that uses the same buffer as source and destination, which is undefined behavior in C99: drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c: In function 'amdgpu_securedisplay_debugfs_write': drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c:141:6

Re: [PATCH 1/1] drm/amdkfd: fix build error with AMD_IOMMU_V2=m

2021-03-09 Thread Arnd Bergmann
On Tue, Mar 9, 2021 at 4:23 AM Felix Kuehling wrote: > > Using 'imply AMD_IOMMU_V2' does not guarantee that the driver can link > against the exported functions. If the GPU driver is built-in but the > IOMMU driver is a loadable module, the kfd_iommu.c file is indeed > built but does not work: >

[PATCH] amdgpu: avoid incorrect %hu format string

2021-03-22 Thread Arnd Bergmann
From: Arnd Bergmann clang points out that the %hu format string does not match the type of the variables here: drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:263:7: warning: format specifies type 'unsigned short' but the argument has type 'unsigned int' [-Wformat

Re: [PATCH 1/1] drm/amdkfd: fix build error with AMD_IOMMU_V2=m

2021-03-11 Thread Arnd Bergmann
On Tue, Mar 9, 2021 at 7:34 PM Christian König wrote: > Am 09.03.21 um 18:59 schrieb Alex Deucher: > > There has been quite some effort for this already for generic PASID > interface etc.. But it looks like that effort is stalled by now. > > Anyway at least I'm perfectly fine to have the IOMMUv2

[PATCH] drm/amd/display: fix 64-bit integer division

2021-02-25 Thread Arnd Bergmann
From: Arnd Bergmann The new display synchronization code caused a regression on all 32-bit architectures: ld.lld: error: undefined symbol: __aeabi_uldivmod >>> referenced by dce_clock_source.c >>> >>> gpu/drm/amd/display/dc/dce/dce_clock_source.o:(ge

[PATCH] drm/amd/display: Fix an uninitialized index variable

2021-02-25 Thread Arnd Bergmann
From: Arnd Bergmann clang points out that the new logic uses an always-uninitialized array index: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9810:38: warning: variable 'i' is uninitialized when used here [-Wuninitialized] timing = >detailed_timing

Re: [PATCH] drm/amd/display: Fix an uninitialized index variable

2021-02-25 Thread Arnd Bergmann
On Thu, Feb 25, 2021 at 10:34 PM 'Nick Desaulniers' via Clang Built Linux wrote: > return parse_edid_cea(aconnector, edid_ext, EDID_LENGTH, vsdb_info) ? i : > -ENODEV; > > would suffice, but the patch is still fine as is. Right, I did not want to change more than necessary here, and the

Re: [PATCH] drm/amd/display: fix 64-bit integer division

2021-02-25 Thread Arnd Bergmann
On Thu, Feb 25, 2021 at 3:33 PM Arnd Bergmann wrote: > > From: Arnd Bergmann > > The new display synchronization code caused a regression > on all 32-bit architectures: > > ld.lld: error: undefined symbol: __aeabi_uldivmod > >>> referenced by dce_clock_source.c &

[PATCH] drm/amdkfd: fix build error with missing AMD_IOMMU_V2

2021-03-08 Thread Arnd Bergmann
From: Arnd Bergmann Using 'imply AMD_IOMMU_V2' does not guarantee that the driver can link against the exported functions. If the GPU driver is built-in but the IOMMU driver is a loadable module, the kfd_iommu.c file is indeed built but does not work: x86_64-linux-ld: drivers/gpu/drm/amd/amdkfd

[PATCH] [variant b] drm/amdkfd: fix build error with missing AMD_IOMMU_V2

2021-03-08 Thread Arnd Bergmann
From: Arnd Bergmann Using 'imply AMD_IOMMU_V2' does not guarantee that the driver can link against the exported functions. If the GPU driver is built-in but the IOMMU driver is a loadable module, the kfd_iommu.c file is indeed built but does not work: x86_64-linux-ld: drivers/gpu/drm/amd/amdkfd

Re: [PATCH] drm/amdkfd: fix build error with missing AMD_IOMMU_V2

2021-03-08 Thread Arnd Bergmann
On Mon, Mar 8, 2021 at 8:11 PM Felix Kuehling wrote: > > Am 2021-03-08 um 2:05 p.m. schrieb Arnd Bergmann: > > On Mon, Mar 8, 2021 at 5:24 PM Felix Kuehling > > wrote: > >> The driver build should work without IOMMUv2. In amdkfd/Makefile, we > >>

Re: [PATCH] drm/amdkfd: fix build error with missing AMD_IOMMU_V2

2021-03-08 Thread Arnd Bergmann
On Mon, Mar 8, 2021 at 5:24 PM Felix Kuehling wrote: > > The driver build should work without IOMMUv2. In amdkfd/Makefile, we > have this condition: > > ifneq ($(CONFIG_AMD_IOMMU_V2),) > AMDKFD_FILES += $(AMDKFD_PATH)/kfd_iommu.o > endif > > In amdkfd/kfd_iommu.h we define inline stubs of the

Re: [PATCH] drm/amdkfd: fix build error with missing AMD_IOMMU_V2

2021-03-08 Thread Arnd Bergmann
On Mon, Mar 8, 2021 at 9:12 PM Christian König wrote: > Am 08.03.21 um 21:02 schrieb Felix Kuehling: > > Am 2021-03-08 um 2:33 p.m. schrieb Arnd Bergmann: > > I don't want to create a hard dependency on AMD_IOMMU_V2 if I can avoid > > it, because it is only really need

Re: [PATCH] Enable '-Werror' by default for all kernel builds

2021-09-09 Thread Arnd Bergmann
On Thu, Sep 9, 2021 at 1:43 PM Marco Elver wrote: > On Thu, 9 Sept 2021 at 13:00, Arnd Bergmann wrote: > > On Thu, Sep 9, 2021 at 12:54 PM Marco Elver wrote: > > > On Thu, 9 Sept 2021 at 07:59, Christoph Hellwig > > > wrote: > > > > On Wed, Sep 08, 2021

Re: [PATCH] Enable '-Werror' by default for all kernel builds

2021-09-09 Thread Arnd Bergmann
On Thu, Sep 9, 2021 at 12:54 PM Marco Elver wrote: > On Thu, 9 Sept 2021 at 07:59, Christoph Hellwig wrote: > > On Wed, Sep 08, 2021 at 11:58:56PM +0200, Marco Elver wrote: > > > It'd be good to avoid. It has helped uncover build issues with KASAN in > > > the past. Or at least make it dependent

Re: [PATCH] drm/amd/display: Reduce stack size for dml21_ModeSupportAndSystemConfigurationFull

2021-09-14 Thread Arnd Bergmann
these numbers by recompiling the file with the frame size warning set to a low value, e.g. adding -Wframe-larger-than=100 to the command line. Acked-by: Arnd Bergmann

[PATCH] drm/amd/display: fix empty debug macros

2021-09-20 Thread Arnd Bergmann
From: Arnd Bergmann Using an empty macro expansion as a conditional expression produces a W=1 warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c: In function 'dce_aux_transfer_with_retries': drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:775:156: error: suggest braces

[PATCH] drm/amd/display: fix apply_degamma_for_user_regamma() warning

2021-10-13 Thread Arnd Bergmann
From: Arnd Bergmann It appears that the wrong argument was removed in this call: drivers/gpu/drm/amd/amdgpu/../display/modules/color/color_gamma.c: In function 'apply_degamma_for_user_regamma': drivers/gpu/drm/amd/amdgpu/../display/modules/color/color_gamma.c:1694:36: error: implicit

[PATCH] gpu: amd: replace open-coded offsetof() with builtin

2021-09-27 Thread Arnd Bergmann
From: Arnd Bergmann The two AMD drivers have their own custom offsetof() implementation that now triggers a warning with recent versions of clang: drivers/gpu/drm/radeon/radeon_atombios.c:133:14: error: performing pointer subtraction with a null pointer has undefined behavior [-Werror,-Wnull

[PATCH] drm/amdgpu: fix clang out-of-range warning

2021-09-27 Thread Arnd Bergmann
From: Arnd Bergmann clang-14 points out that comparing an 'unsigned int' against a large 64-bit constantn is pointless: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1206:18: error: result of comparison of constant 4294967296 with expression of type 'resource_size_t' (aka 'unsigned int

[PATCH] [RESEND] drm/amdgpu: fix enum odm_combine_mode mismatch

2021-09-27 Thread Arnd Bergmann
From: Arnd Bergmann A conversion from 'bool' to 'enum odm_combine_mode' was incomplete, and gcc warns about this with many instances of display/dc/dml/dcn20/display_mode_vba_20.c:3899:44: warning: implicit conversion from 'enum ' to 'enum odm_combine_mode' [-Wenum-conversion] 3899

[PATCH] drm/amdgpu: fix warning for overflow check

2021-09-27 Thread Arnd Bergmann
From: Arnd Bergmann The overflow check in amdgpu_bo_list_create() causes a warning with clang-14 on 64-bit architectures, since the limit can never be exceeded. drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c:74:18: error: result of comparison of constant 256204778801521549 with expression of type

Re: [PATCH] Enable '-Werror' by default for all kernel builds

2021-09-21 Thread Arnd Bergmann
On Wed, Sep 8, 2021 at 10:55 PM Nathan Chancellor wrote: > On Tue, Sep 07, 2021 at 11:11:17AM +0200, Arnd Bergmann wrote: > > On Tue, Sep 7, 2021 at 4:32 AM Nathan Chancellor wrote: function 'rtw_aes_decrypt' [-Werror,-Wframe-larger-than] > > > arm32-fedora.log: > > >

Re: [PATCH 2/2] drm/amdkfd: drop struct kfd_cu_info

2023-09-26 Thread Arnd Bergmann
also avoids having the kfd_cu_info structures on > the stack when inlining which can blow up the stack. > > Cc: Arnd Bergmann > Signed-off-by: Alex Deucher Nice cleanup! Acked-by: Arnd Bergmann I guess you could fold patch 1/2 into this as it removes all the added code from that anyway.

Re: [PATCH 1/2] drm/amdkfd: reduce stack size in kfd_topology_add_device()

2023-09-26 Thread Arnd Bergmann
On Tue, Sep 26, 2023, at 18:39, Alex Deucher wrote: > kfd_topology.c:2082:1: warning: the frame size of 1440 bytes is larger > than 1024 bytes > > Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2866 > Cc: Arnd Bergmann > Signed-off-by: Alex Deucher Acked-by: Arnd Bergmann

Re: [PATCH 2/2] drm/amdkfd: drop struct kfd_cu_info

2023-09-26 Thread Arnd Bergmann
On Tue, Sep 26, 2023, at 20:47, Deucher, Alexander wrote: >> From: Arnd Bergmann >> Subject: Re: [PATCH 2/2] drm/amdkfd: drop struct kfd_cu_info >> >> On Tue, Sep 26, 2023, at 18:39, Alex Deucher wrote: >> > I think this was an abstraction back from when kfd supp

Re: [linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-05-26 Thread Arnd Bergmann
On Wed, May 25, 2022 at 11:35 PM kernel test robot wrote: > .__mulsi3.o.cmd: No such file or directory > Makefile:686: arch/h8300/Makefile: No such file or directory > Makefile:765: arch/h8300/Makefile: No such file or directory > arch/Kconfig:10: can't open file "arch/h8300/Kconfig" Please stop

Re: [PATCH v2 1/1] drm/amd/display: add DCN support for ARM64

2022-10-27 Thread Arnd Bergmann
On Thu, Oct 27, 2022, at 16:45, Ao Zhong wrote: > After moving all FPU code to the DML folder, we can enable DCN support > for the ARM64 platform. Remove the -mgeneral-regs-only CFLAG from the > code in the DML folder that needs to use hardware FPU, and add a control > mechanism for ARM Neon. > >

Re: [PATCH RESEND 1/1] drm/amd/display: add DCN support for ARM64

2022-10-27 Thread Arnd Bergmann
On Thu, Oct 27, 2022, at 15:38, Ao Zhong wrote: > Am Do., 27. Okt. 2022 um 12:52 Uhr schrieb Arnd Bergmann : > >> Why do you need separate $(dml_rcflags) and $(dml_rcflags_arm64) >> rather than adding -mgeneral-regs-only to $(dml_rcflags) directly? > > I don't know if $(dm

Re: [PATCH RESEND 1/1] drm/amd/display: add DCN support for ARM64

2022-10-27 Thread Arnd Bergmann
On Thu, Oct 27, 2022, at 02:25, Ao Zhong wrote: > After moving all FPU code to the DML folder, we can enable DCN support > for the ARM64 platform. Remove the -mgeneral-regs-only CFLAG from the > code in the DML folder that needs to use hardware FPU, and add a control > mechanism for ARM Neon. > >

Re: [PATCH v3 1/1] drm/amd/display: add DCN support for ARM64

2022-10-27 Thread Arnd Bergmann
for ARM Neon. > > Signed-off-by: Ao Zhong Looks good to me, Acked-by: Arnd Bergmann

Re: mainline build failure for x86_64 allmodconfig with clang

2022-08-05 Thread Arnd Bergmann
On Fri, Aug 5, 2022 at 5:32 PM Harry Wentland wrote: > > I do notice that these files build with a non-configurable > > -Wframe-large-than value: > > > > $ rg frame_warn_flag drivers/gpu/drm/amd/display/dc/dml/Makefile > > 54:frame_warn_flag := -Wframe-larger-than=2048 > > Tbh, I was looking at

Re: mainline build failure for x86_64 allmodconfig with clang

2022-08-05 Thread Arnd Bergmann
On Fri, Aug 5, 2022 at 8:02 PM Nathan Chancellor wrote: > On Fri, Aug 05, 2022 at 06:16:45PM +0200, Arnd Bergmann wrote: > > On Fri, Aug 5, 2022 at 5:32 PM Harry Wentland > > wrote: > > While splitting out sub-functions can help reduce the maximum stack > > usage,

Re: mainline build failure for x86_64 allmodconfig with clang

2022-08-04 Thread Arnd Bergmann
On Thu, Aug 4, 2022 at 8:52 PM Linus Torvalds wrote: > > On Thu, Aug 4, 2022 at 11:37 AM Sudip Mukherjee (Codethink) > wrote:cov_trace_cmp > > > > git bisect points to 3876a8b5e241 ("drm/amd/display: Enable building new > > display engine with KCOV enabled"). > > Ahh. So that was presumably why

Re: [PATCH] drm/amd/display: fix dp_retrieve_lttpr_cap return code

2022-12-16 Thread Arnd Bergmann
On Thu, Dec 15, 2022, at 18:56, Michel Dänzer wrote: > On 12/15/22 17:37, Arnd Bergmann wrote: /amd/display/dc/core/dc_link_dp.c >> index af9411ee3c74..95dbfa4e996a 100644 >> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c >> +++ b/drivers/gpu/drm/amd/display

[PATCH] drm/amd/display: fix dp_retrieve_lttpr_cap return code

2022-12-15 Thread Arnd Bergmann
From: Arnd Bergmann The dp_retrieve_lttpr_cap() return type changed from 'bool' to 'enum dc_status', so now the early 'return' uses the wrong type: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c: In function 'dp_retrieve_lttpr_cap': drivers/gpu/drm/amd/amdgpu/../display/dc/core

[PATCH] drm/amd/display: fix duplicate assignments

2022-12-15 Thread Arnd Bergmann
From: Arnd Bergmann The .set_odm_combine callback pointer was added twice, causing a harmless -Wextra warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn314/dcn314_optc.c:258:36: error: initialized field overwritten [-Werror=override-init] 258 | .set_odm_combine

[PATCH] drm/amd/pm: avoid large variable on kernel stack

2022-12-15 Thread Arnd Bergmann
From: Arnd Bergmann The activity_monitor_external[] array is too big to fit on the kernel stack, resulting in this warning with clang: drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_7_ppt.c:1438:12: error: stack frame size (1040) exceeds limit (1024

Re: [PATCH 3/3] Kconfig.debug: Provide a little extra FRAME_WARN leeway when KASAN is enabled

2022-11-25 Thread Arnd Bergmann
-off-by: Lee Jones Acked-by: Arnd Bergmann If this affects only clang but not gcc, I wonder if we could limit the scope and keep the 1024 byte limit on gcc builds. > --- > lib/Kconfig.debug | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/lib/Kconfig.debug b/lib/Kc

Re: [PATCH 1/3] drm/amd/display/dc/calcs/dce_calcs: Break-out a stack-heavy chunk of code

2022-11-25 Thread Arnd Bergmann
On Fri, Nov 25, 2022, at 10:25, Lee Jones wrote: > bw_calcs() presently blows the stack-frame limit by calling functions > inside a argument list which return quite a bit of data to be passed > onto sub-functions. Simply breaking out this hunk reduces the > stack-frame use by 500 Bytes,

Re: [PATCH v2 2/2] Kconfig.debug: Provide a little extra FRAME_WARN leeway when KASAN is enabled

2022-11-25 Thread Arnd Bergmann
AN && !64BIT >> default 1024 if !64BIT >> default 2048 if 64BIT >> help > > Note this also fixes 61 warnings when > > (GCC && !GCC_PLUGIN_LATENT_ENTROPY) > > ... which as Arnd says should not be enabled by default. We'll > address that issue once this set has been applied. Thanks a lot for checking this! Reviewed-by: Arnd Bergmann

Re: [PATCH v2 1/2] drm/amdgpu: Temporarily disable broken Clang builds due to blown stack-frame

2022-11-25 Thread Arnd Bergmann
anic on most architectures. We'll revert this when the following bug report > has been resolved: https://github.com/llvm/llvm-project/issues/41896. > > Suggested-by: Arnd Bergmann > Signed-off-by: Lee Jones Acked-by: Arnd Bergmann

Re: [PATCH 2/3] drm/amdgpu: Temporarily disable broken Clang builds due to blown stack-frame

2022-11-25 Thread Arnd Bergmann
anic on most architectures. We'll revert this when the following bug report > has been resolved: https://github.com/llvm/llvm-project/issues/41896. > > Suggested-by: Arnd Bergmann > Signed-off-by: Lee Jones > --- > drivers/gpu/drm/Kconfig | 7 +++ > 1 file change

[PATCH] drm/amd/display: fix dp_retrieve_lttpr_cap() return value

2023-01-18 Thread Arnd Bergmann
From: Arnd Bergmann gcc-13 notices a mismatch between the return type of dp_retrieve_lttpr_cap() and the returned value: drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dp_capability.c: In function 'dp_retrieve_lttpr_cap': drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dp_capability.c

[PATCH] drm/amd/display: fix hdmi_encoded_link_bw definition

2023-01-18 Thread Arnd Bergmann
From: Arnd Bergmann Some of the data structures are hidden when CONFIG_DRM_AMD_DC_DCN is disabled, which leads to a link failure: drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dp_capability.c:234:21: error: 'union hdmi_encoded_link_bw' declared inside parameter list will not be visible

[PATCH] drm/amdgpu/display/mst: fix an unused-variable warning

2023-01-26 Thread Arnd Bergmann
From: Arnd Bergmann The newly added code is in an #ifdef, so the variables that are only used in there cause a warning if CONFIG_DRM_AMD_DC_DCN is disabled: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function 'amdgpu_dm_atomic_check': drivers/gpu/drm/amd/amdgpu/../display

[PATCH] [v2] drm/amd/display: fix dp_retrieve_lttpr_cap return code

2023-01-17 Thread Arnd Bergmann
From: Arnd Bergmann The dp_retrieve_lttpr_cap() return type changed from 'bool' to 'enum dc_status', so now the early 'return' uses the wrong type: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c: In function 'dp_retrieve_lttpr_cap': drivers/gpu/drm/amd/amdgpu/../display/dc/core

[PATCH 1/2] drm/amd/display: mark dccg314_init() static

2023-04-17 Thread Arnd Bergmann
From: Arnd Bergmann The newly introduced global function is not declared in a header or called from another file, causing a harmless warning with sparse or W=1 builds: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn314/dcn314_dccg.c:277:6: error: no previous prototype for 'dccg314_init' [-Werror

[PATCH 2/2] drm/amd/display: fix missing=prototypes warnings

2023-04-17 Thread Arnd Bergmann
From: Arnd Bergmann Three functions in the amdgpu display driver cause -Wmissing-prototype warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:1858:6: error: no previous prototype for 'is_timing_changed' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/../display

[PATCH] drm/radeon: move prototypes to header

2023-04-17 Thread Arnd Bergmann
From: Arnd Bergmann Global functions in radeon_atpx_handler.c are not declared in a header but instead in each file using them. This risks the types getting out of sync and causes warnings: drivers/gpu/drm/radeon/radeon_atpx_handler.c:64:6: error: no previous prototype for 'radeon_has_atpx

[PATCH] [v2] drm/amd/display: fix is_timing_changed() prototype

2023-04-17 Thread Arnd Bergmann
From: Arnd Bergmann Three functions in the amdgpu display driver cause -Wmissing-prototype warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:1858:6: error: no previous prototype for 'is_timing_changed' [-Werror=missing-prototypes] is_timing_changed() is actually meant

Re: [PATCH 1/2] drm/amd/display: mark dccg314_init() static

2023-04-17 Thread Arnd Bergmann
On Mon, Apr 17, 2023, at 23:12, Hamza Mahfooz wrote: > On 4/17/23 17:05, Arnd Bergmann wrote: >> From: Arnd Bergmann >> >> The newly introduced global function is not declared in a header or >> called from another file, causing a harmless warning with sparse >>

[PATCH 2/3] drm/amd/display: dumb_abm_lcd: avoid missing-prototype warnings

2023-04-20 Thread Arnd Bergmann
From: Arnd Bergmann The dmub_abm_set_ambient_level() function has no caller and can just be removed, the other ones have a declaration in the header file and just need to see the prototype: drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:122:14: error: no previous prototype

[PATCH 3/3] drm/amd/display: remove unused variables in dcn21_set_backlight_level

2023-04-20 Thread Arnd Bergmann
From: Arnd Bergmann The only references to these variables were removed, so they now cause warnings and have to be removed as well: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_hwseq.c:226:20: error: unused variable 'cmd' [-Werror,-Wunused-variable] drivers/gpu/drm/amd/amdgpu

[PATCH 1/3] drm/amdgpu: mark gfx_v9_4_3_disable_gpa_mode() static

2023-04-20 Thread Arnd Bergmann
From: Arnd Bergmann This was left global by accident, the corresponding functions for other hardware types are already static: drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:1072:6: error: no previous prototype for function 'gfx_v9_4_3_disable_gpa_mode' [-Werror,-Wmissing-prototypes] Fixes

Re: [PATCH 2/2] drm/amd/display: fix missing=prototypes warnings

2023-04-18 Thread Arnd Bergmann
On Mon, Apr 17, 2023, at 23:17, Hamza Mahfooz wrote: > On 4/17/23 17:05, Arnd Bergmann wrote: >> From: Arnd Bergmann >> >> Three functions in the amdgpu display driver cause -Wmissing-prototype >> warnings: >> >> drivers/gpu/drm/amd/amdgpu/../disp

[PATCH] drm/amd/display: mark amdgpu_dm_connector_funcs_force static

2023-05-01 Thread Arnd Bergmann
From: Arnd Bergmann A global function without a header prototype has made it into linux-next during the merge window: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:6339:6: error: no previous prototype for 'amdgpu_dm_connector_funcs_force' [-Werror=missing-prototypes] Mark

[PATCH] [SUBMITTED 20210927] [RESEND^2] drm/amdgpu: fix enum odm_combine_mode mismatch

2023-02-06 Thread Arnd Bergmann
From: Arnd Bergmann A conversion from 'bool' to 'enum odm_combine_mode' was incomplete, and gcc warns about this with many instances of display/dc/dml/dcn20/display_mode_vba_20.c:3899:44: warning: implicit conversion from 'enum ' to 'enum odm_combine_mode' [-Wenum-conversion] 3899

[PATCH] drm/amd/display: fix link_validation build failure

2023-02-09 Thread Arnd Bergmann
From: Arnd Bergmann When CONFIG_DRM_AMD_DC_DCN is disabled, the is_frl member is not defined: drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_validation.c: In function 'dp_active_dongle_validate_timing': drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_validation.c:126:66: error: 'const

[PATCH] drm/amdgpu: avoid integer overflow warning in amdgpu_device_resize_fb_bar()

2023-07-03 Thread Arnd Bergmann
From: Arnd Bergmann On 32-bit architectures comparing a resource against a value larger than U32_MAX can cause a warning: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1344:18: error: result of comparison of constant 4294967296 with expression of type 'resource_size_t' (aka 'unsigned int

[PATCH] [v2] drm/amdgpu: avoid integer overflow warning in amdgpu_device_resize_fb_bar()

2023-07-07 Thread Arnd Bergmann
From: Arnd Bergmann On 32-bit architectures comparing a resource against a value larger than U32_MAX can cause a warning: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1344:18: error: result of comparison of constant 4294967296 with expression of type 'resource_size_t' (aka 'unsigned int

Re: [PATCH] drm/amdgpu: avoid integer overflow warning in amdgpu_device_resize_fb_bar()

2023-07-05 Thread Arnd Bergmann
On Tue, Jul 4, 2023, at 08:54, Christian König wrote: > Am 03.07.23 um 14:35 schrieb Arnd Bergmann: >> From: Arnd Bergmann >> >> On 32-bit architectures comparing a resource against a value larger than >> U32_MAX can cause a warning: >> >> drivers/gpu/drm/am

Re: [PATCH] drm/amdgpu: avoid integer overflow warning in amdgpu_device_resize_fb_bar()

2023-07-05 Thread Arnd Bergmann
On Tue, Jul 4, 2023, at 16:51, Christian König wrote: > Am 04.07.23 um 16:31 schrieb Arnd Bergmann: >> On Tue, Jul 4, 2023, at 14:33, Christian König wrote: >>> >>> Modern AMD GPUs have 16GiB of local memory (VRAM), making those >>> accessible to a CPU w

Re: [PATCH] drm/amdgpu: avoid integer overflow warning in amdgpu_device_resize_fb_bar()

2023-07-05 Thread Arnd Bergmann
On Tue, Jul 4, 2023, at 14:33, Christian König wrote: > Am 04.07.23 um 14:24 schrieb Arnd Bergmann: >> On Tue, Jul 4, 2023, at 08:54, Christian König wrote: >>> Am 03.07.23 um 14:35 schrieb Arnd Bergmann: >> Not sure I understand the specific requirement. Do you mean the

[PATCH] drm/amdkfd: mark som eclear_address_watch() callback static

2023-06-05 Thread Arnd Bergmann
From: Arnd Bergmann Some of the newly introduced clear_address_watch callback handlers have no prototype because they are only used in one file, which causes a W=1 warning: drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c:164:10: error: no previous prototype

[PATCH] drm/amd/display: avoid calling missing .resync_fifo_dccg_dio()

2023-05-23 Thread Arnd Bergmann
From: Arnd Bergmann The .resync_fifo_dccg_dio() callback pointer was added in an #ifdef block, but is called unconditionally: drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_hw_sequencer.c:2292:31: error: 'struct hwseq_private_funcs' has no member named 'resync_fifo_dccg_dio' Add

[PATCH 1/5] drm/amd/pm: mark irq functions as 'static'

2023-05-22 Thread Arnd Bergmann
From: Arnd Bergmann Two newly added functions cause a warning because they lack a prototype: drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.c:1328:5: error: no previous prototype for 'smu_v13_0_6_set_irq_state' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/../pm/swsmu

[PATCH 3/5] drm/amdgpu:mark aqua_vanjaram_reg_init.c function as static

2023-05-22 Thread Arnd Bergmann
From: Arnd Bergmann A few newly added global functions have no prototype, which causes warnings: drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c:169:5: error: no previous prototype for 'aqua_vanjaram_select_scheds' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu

[PATCH 4/5] drm/amdgpu: use %pad format string for dma_addr_t

2023-05-22 Thread Arnd Bergmann
From: Arnd Bergmann DMA addresses can be shorter than u64, which results in a broken debug output: drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c: In function 'amdgpu_gart_table_ram_alloc': drivers/gpu/drm/amd/amdgpu/amdgpu.h:41:22: error: format '%llx' expects argument of type 'long long unsigned

[PATCH 5/5] drm/amdgpu: fix acpi build warnings

2023-05-22 Thread Arnd Bergmann
From: Arnd Bergmann Two newly introduced functions are in the global namespace but have no prototypes or callers outside of amdgpu_acpi.c, another function is static but only has a caller inside of an #ifdef: drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:902:13: error: no previous prototype

[PATCH 2/5] drm/amdkfd: mark local functions as static

2023-05-22 Thread Arnd Bergmann
From: Arnd Bergmann The file was newly added and causes some -Wmissing-prototype warnings: drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c:57:5: error: no previous prototype for 'kgd_gfx_v9_4_3_hqd_sdma_load' [-Werror=missing-prototypes] drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gc_9_4_3.c

[PATCH] drm/amdkfd: fix build failure without CONFIG_DYNAMIC_DEBUG

2023-08-04 Thread Arnd Bergmann
From: Arnd Bergmann When CONFIG_DYNAMIC_DEBUG is disabled altogether, calling _dynamic_func_call_no_desc() does not work: drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c: In function 'svm_range_set_attr': drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c:52:9: error: implicit declaration

[PATCH] drm/amdgpu: fix building without DEBUG_FS

2023-06-22 Thread Arnd Bergmann
From: Arnd Bergmann The debugfs file is defined unconditionally, but the registration is hidden in an #ifdef, which causes a warning: drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c:110:37: error: unused variable 'amdgpu_rap_debugfs_ops' [-Werror,-Wunused-const-variable] static const struct

Re: [PATCH 3/3] drm/amd/display: Support DRM_AMD_DC_FP on RISC-V

2023-12-11 Thread Arnd Bergmann
On Sat, Dec 9, 2023, at 22:29, Samuel Holland wrote: > On 2023-12-09 2:38 PM, Arnd Bergmann wrote: >> On Fri, Dec 8, 2023, at 06:04, Samuel Holland wrote: >>> On 2023-11-29 6:42 PM, Nathan Chancellor wrote: >>>> >>>> https://lore.kernel.org/20231019205117

Re: [PATCH 3/3] drm/amd/display: Support DRM_AMD_DC_FP on RISC-V

2023-12-11 Thread Arnd Bergmann
On Fri, Dec 8, 2023, at 06:04, Samuel Holland wrote: > On 2023-11-29 6:42 PM, Nathan Chancellor wrote: >> On Thu, Nov 23, 2023 at 02:23:01PM +, Conor Dooley wrote: >>> On Tue, Nov 21, 2023 at 07:05:15PM -0800, Samuel Holland wrote: RISC-V uses kernel_fpu_begin()/kernel_fpu_end() like

[PATCH] drm/amd/display: avoid stringop-overflow warnings for dp_decide_lane_settings()

2023-11-22 Thread Arnd Bergmann
From: Arnd Bergmann gcc prints a warning about a possible array overflow for a couple of callers of dp_decide_lane_settings() after commit 1b56c90018f0 ("Makefile: Enable -Wstringop-overflow globally"): drivers/gpu/drm/amd/amdgpu/../display/dc/link

[PATCH 00/12] kbuild: enable some -Wextra warnings by default

2024-03-26 Thread Arnd Bergmann
From: Arnd Bergmann This is a follow-up on a couple of patch series I sent in the past, enabling -Wextra (aside from stuff that is explicitly disabled), -Wcast-function-pointer-strict and -Wrestrict. I have tested these on 'defconfig' and 'allmodconfig' builds across all architectures, as well

Re: [PATCH v4 13/15] drm/amd/display: Use ARCH_HAS_KERNEL_FPU_SUPPORT

2024-04-11 Thread Arnd Bergmann
On Thu, Apr 11, 2024, at 09:15, Ard Biesheuvel wrote: > On Thu, 11 Apr 2024 at 03:11, Samuel Holland > wrote: >> On 2024-04-10 8:02 PM, Thiago Jung Bauermann wrote: >> > Samuel Holland writes: >> >> >> The short-term fix would be to drop the `select >> >> ARCH_HAS_KERNEL_FPU_SUPPORT` for >> >>

[PATCH 1/2] drm/amd/display: dynamically allocate dml2_configuration_options structures

2024-04-18 Thread Arnd Bergmann
From: Arnd Bergmann This structure is too large to fit on a stack, as shown by the newly introduced warnings from a recent code change: drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn32/dcn32_resource.c: In function 'dcn32_update_bw_bounding_box': drivers/gpu/drm/amd/amdgpu/../display/dc

[PATCH 2/2] drm/amd/display: fix graphics_object_id size

2024-04-18 Thread Arnd Bergmann
From: Arnd Bergmann The graphics_object_id structure is meant to fit into 32 bits, as it's passed by value in and out of functions. A recent change increased the size to 128 bits, so it's now always passed by reference, which is clearly not intended and ends up producing a compile-time warning

<    1   2