[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1124363169.403562.1702523581672.JavaMail.zimbra@raptorengineeringinc.com>
Date: Wed, 13 Dec 2023 21:13:01 -0600 (CST)
From: Timothy Pearson <tpearson@...torengineering.com>
To: Samuel Holland <samuel.holland@...ive.com>
Cc: Michael Ellerman <mpe@...erman.id.au>,
linux-kernel <linux-kernel@...r.kernel.org>,
amd-gfx <amd-gfx@...ts.freedesktop.org>,
linux-arch <linux-arch@...r.kernel.org>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
loongarch@...ts.linux.dev,
linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
x86 <x86@...nel.org>, linux-riscv@...ts.infradead.org,
Christoph Hellwig <hch@...radead.org>,
Timothy Pearson <tpearson@...torengineering.com>
Subject: Re: [RFC PATCH 10/12] drm/amd/display: Use
ARCH_HAS_KERNEL_FPU_SUPPORT
----- Original Message -----
> From: "Samuel Holland" <samuel.holland@...ive.com>
> To: "Michael Ellerman" <mpe@...erman.id.au>
> Cc: "linux-kernel" <linux-kernel@...r.kernel.org>, "amd-gfx" <amd-gfx@...ts.freedesktop.org>, "linux-arch"
> <linux-arch@...r.kernel.org>, "linux-arm-kernel" <linux-arm-kernel@...ts.infradead.org>, loongarch@...ts.linux.dev,
> "linuxppc-dev" <linuxppc-dev@...ts.ozlabs.org>, "x86" <x86@...nel.org>, linux-riscv@...ts.infradead.org, "Christoph
> Hellwig" <hch@...radead.org>, "Timothy Pearson" <tpearson@...torengineering.com>
> Sent: Wednesday, December 13, 2023 7:03:20 PM
> Subject: Re: [RFC PATCH 10/12] drm/amd/display: Use ARCH_HAS_KERNEL_FPU_SUPPORT
> On 2023-12-11 6:23 AM, Michael Ellerman wrote:
>> Hi Samuel,
>>
>> Thanks for trying to clean all this up.
>>
>> One problem below.
>>
>> Samuel Holland <samuel.holland@...ive.com> writes:
>>> Now that all previously-supported architectures select
>>> ARCH_HAS_KERNEL_FPU_SUPPORT, this code can depend on that symbol instead
>>> of the existing list of architectures. It can also take advantage of the
>>> common kernel-mode FPU API and method of adjusting CFLAGS.
>>>
>>> Signed-off-by: Samuel Holland <samuel.holland@...ive.com>
>> ...
>>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c
>>> b/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c
>>> index 4ae4720535a5..b64f917174ca 100644
>>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c
>>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c
>>> @@ -87,20 +78,9 @@ void dc_fpu_begin(const char *function_name, const int line)
>>> WARN_ON_ONCE(!in_task());
>>> preempt_disable();
>>> depth = __this_cpu_inc_return(fpu_recursion_depth);
>>> -
>>> if (depth == 1) {
>>> -#if defined(CONFIG_X86) || defined(CONFIG_LOONGARCH)
>>> + BUG_ON(!kernel_fpu_available());
>>> kernel_fpu_begin();
>>> -#elif defined(CONFIG_PPC64)
>>> - if (cpu_has_feature(CPU_FTR_VSX_COMP))
>>> - enable_kernel_vsx();
>>> - else if (cpu_has_feature(CPU_FTR_ALTIVEC_COMP))
>>> - enable_kernel_altivec();
>>
>> Note altivec.
>>
>>> - else if (!cpu_has_feature(CPU_FTR_FPU_UNAVAILABLE))
>>> - enable_kernel_fp();
>>> -#elif defined(CONFIG_ARM64)
>>> - kernel_neon_begin();
>>> -#endif
>>> }
>>>
>>> TRACE_DCN_FPU(true, function_name, line, depth);
>>> diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile
>>> b/drivers/gpu/drm/amd/display/dc/dml/Makefile
>>> index ea7d60f9a9b4..5aad0f572ba3 100644
>>> --- a/drivers/gpu/drm/amd/display/dc/dml/Makefile
>>> +++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile
>>> @@ -25,40 +25,8 @@
>>> # It provides the general basic services required by other DAL
>>> # subcomponents.
>>>
>>> -ifdef CONFIG_X86
>>> -dml_ccflags-$(CONFIG_CC_IS_GCC) := -mhard-float
>>> -dml_ccflags := $(dml_ccflags-y) -msse
>>> -endif
>>> -
>>> -ifdef CONFIG_PPC64
>>> -dml_ccflags := -mhard-float -maltivec
>>> -endif
>>
>> And altivec is enabled in the flags there.
>>
>> That doesn't match your implementation for powerpc in patch 7, which
>> only deals with float.
>>
>> I suspect the AMD driver actually doesn't need altivec enabled, but I
>> don't know that for sure. It compiles without it, but I don't have a GPU
>> to actually test. I've added Timothy on Cc who added the support for
>> powerpc to the driver originally, hopefully he has a test system.
If you would like me to test I'm happy to do so, but I am travelling until Friday so would need to wait until then.
Thanks!
Powered by blists - more mailing lists