<div>Awesome, thanks!</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Rodrigo Siqueira Jordao <<a href="mailto:Rodrigo.Siqueira@amd.com">Rodrigo.Siqueira@amd.com</a>> schrieb am Do. 3. Nov. 2022 um 15:21:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><br>
<br>
On 2022-11-01 12:31, Nathan Chancellor wrote:<br>
> On Tue, Nov 01, 2022 at 10:36:08AM -0400, Rodrigo Siqueira Jordao wrote:<br>
>><br>
>><br>
>> On 2022-10-31 15:37, Ao Zhong wrote:<br>
>>> After moving all FPU code to the DML folder, we can enable DCN support<br>
>>> for the ARM64 platform. Remove the -mgeneral-regs-only CFLAG from the<br>
>>> code in the DML folder that needs to use hardware FPU, and add a control<br>
>>> mechanism for ARM Neon.<br>
>>><br>
>>> Signed-off-by: Ao Zhong <<a href="mailto:hacc1225@gmail.com" target="_blank">hacc1225@gmail.com</a>><br>
>>> ---<br>
>>> drivers/gpu/drm/amd/display/Kconfig | 3 ++-<br>
>>> .../gpu/drm/amd/display/amdgpu_dm/dc_fpu.c | 6 ++++++<br>
>>> drivers/gpu/drm/amd/display/dc/dml/Makefile | 20 +++++++++++++++----<br>
>>> 3 files changed, 24 insertions(+), 5 deletions(-)<br>
>>><br>
>>> diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig<br>
>>> index 0142affcdaa3..843a55a6a3ac 100644<br>
>>> --- a/drivers/gpu/drm/amd/display/Kconfig<br>
>>> +++ b/drivers/gpu/drm/amd/display/Kconfig<br>
>>> @@ -6,7 +6,8 @@ config DRM_AMD_DC<br>
>>> bool "AMD DC - Enable new display engine"<br>
>>> default y<br>
>>> select SND_HDA_COMPONENT if SND_HDA_CORE<br>
>>> - select DRM_AMD_DC_DCN if (X86 || PPC64)<br>
>>> + # !CC_IS_CLANG: <a href="https://github.com/ClangBuiltLinux/linux/issues/1752" rel="noreferrer" target="_blank">https://github.com/ClangBuiltLinux/linux/issues/1752</a>>>>> + select DRM_AMD_DC_DCN if (X86 || PPC64 || (ARM64 && KERNEL_MODE_NEON && !CC_IS_CLANG))<br>
>>> help<br>
>>> Choose this option if you want to use the new display engine<br>
>>> support for AMDGPU. This adds required support for Vega and<br>
>>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c b/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c<br>
>>> index ab0c6d191038..1743ca0a3641 100644<br>
>>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c<br>
>>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c<br>
>>> @@ -31,6 +31,8 @@<br>
>>> #elif defined(CONFIG_PPC64)<br>
>>> #include <asm/switch_to.h><br>
>>> #include <asm/cputable.h><br>
>>> +#elif defined(CONFIG_ARM64)<br>
>>> +#include <asm/neon.h><br>
>>> #endif<br>
>>> /**<br>
>>> @@ -99,6 +101,8 @@ void dc_fpu_begin(const char *function_name, const int line)<br>
>>> preempt_disable();<br>
>>> enable_kernel_fp();<br>
>>> }<br>
>>> +#elif defined(CONFIG_ARM64)<br>
>>> + kernel_neon_begin();<br>
>>> #endif<br>
>>> }<br>
>>> @@ -136,6 +140,8 @@ void dc_fpu_end(const char *function_name, const int line)<br>
>>> disable_kernel_fp();<br>
>>> preempt_enable();<br>
>>> }<br>
>>> +#elif defined(CONFIG_ARM64)<br>
>>> + kernel_neon_end();<br>
>>> #endif<br>
>>> }<br>
>>> diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile<br>
>>> index d0c6cf61c676..d4e93bed1c8e 100644<br>
>>> --- a/drivers/gpu/drm/amd/display/dc/dml/Makefile<br>
>>> +++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile<br>
>>> @@ -33,6 +33,10 @@ ifdef CONFIG_PPC64<br>
>>> dml_ccflags := -mhard-float -maltivec<br>
>>> endif<br>
>>> +ifdef CONFIG_ARM64<br>
>>> +dml_rcflags := -mgeneral-regs-only<br>
>>> +endif<br>
>>> +<br>
>>> ifdef CONFIG_CC_IS_GCC<br>
>>> ifeq ($(call cc-ifversion, -lt, 0701, y), y)<br>
>>> IS_OLD_GCC = 1<br>
>>> @@ -55,8 +59,6 @@ frame_warn_flag := -Wframe-larger-than=2048<br>
>>> endif<br>
>>> CFLAGS_$(AMDDALPATH)/dc/dml/display_mode_lib.o := $(dml_ccflags)<br>
>>> -<br>
>>> -ifdef CONFIG_DRM_AMD_DC_DCN<br>
>>> CFLAGS_$(AMDDALPATH)/dc/dml/display_mode_vba.o := $(dml_ccflags)<br>
>>> CFLAGS_$(AMDDALPATH)/dc/dml/dcn10/dcn10_fpu.o := $(dml_ccflags)<br>
>>> CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/dcn20_fpu.o := $(dml_ccflags)<br>
>>> @@ -88,7 +90,6 @@ CFLAGS_$(AMDDALPATH)/dc/dml/calcs/dcn_calcs.o := $(dml_ccflags)<br>
>>> CFLAGS_$(AMDDALPATH)/dc/dml/calcs/dcn_calc_auto.o := $(dml_ccflags)<br>
>>> CFLAGS_$(AMDDALPATH)/dc/dml/calcs/dcn_calc_math.o := $(dml_ccflags) -Wno-tautological-compare<br>
>>> CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/display_mode_vba.o := $(dml_rcflags)<br>
>>> -CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn2x/dcn2x.o := $(dml_rcflags)<br>
>>> CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20.o := $(dml_rcflags)<br>
>>> CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn20/display_rq_dlg_calc_20.o := $(dml_rcflags)<br>
>>> CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20v2.o := $(dml_rcflags)<br>
>>> @@ -105,7 +106,18 @@ CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn32/display_mode_vba_util_32.o := $(dml_rcf<br>
>>> CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn301/dcn301_fpu.o := $(dml_rcflags)<br>
>>> CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/display_mode_lib.o := $(dml_rcflags)<br>
>>> CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dsc/rc_calc_fpu.o := $(dml_rcflags)<br>
>>> -endif<br>
>>> +CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn10/dcn10_fpu.o := $(dml_rcflags)<br>
>>> +CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn20/dcn20_fpu.o := $(dml_rcflags)<br>
>>> +CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn314/display_mode_vba_314.o := $(dml_rcflags)<br>
>>> +CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn314/display_rq_dlg_calc_314.o := $(dml_rcflags)<br>
>>> +CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn314/dcn314_fpu.o := $(dml_rcflags)<br>
>>> +CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn30/dcn30_fpu.o := $(dml_rcflags)<br>
>>> +CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn32/dcn32_fpu.o := $(dml_rcflags)<br>
>>> +CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn321/dcn321_fpu.o := $(dml_rcflags)<br>
>>> +CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn31/dcn31_fpu.o := $(dml_rcflags)<br>
>>> +CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn302/dcn302_fpu.o := $(dml_rcflags)<br>
>>> +CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dcn303/dcn303_fpu.o := $(dml_rcflags)<br>
>>> +CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/calcs/dcn_calc_math.o := $(dml_rcflags)<br>
>>> CFLAGS_$(AMDDALPATH)/dc/dml/dml1_display_rq_dlg_calc.o := $(dml_ccflags)<br>
>>> CFLAGS_$(AMDDALPATH)/dc/dml/display_rq_dlg_helpers.o := $(dml_ccflags)<br>
>>> CFLAGS_REMOVE_$(AMDDALPATH)/dc/dml/dml1_display_rq_dlg_calc.o := $(dml_rcflags)<br>
>><br>
>> lgtm,<br>
>><br>
>> Reviewed-by: Rodrigo Siqueira <<a href="mailto:Rodrigo.Siqueira@amd.com" target="_blank">Rodrigo.Siqueira@amd.com</a>><br>
>><br>
>> Nathan,<br>
>><br>
>> If it is ok for you, I can merge this change.<br>
> <br>
> Yes, this version looks good to me, as the code can no longer be built<br>
> for arm64 when using clang.<br>
> <br>
> Cheers,<br>
> Nathan<br>
<br>
I just merged this patch to amd-staging-drm-next.<br>
<br>
Thanks<br>
Siqueira<br>
</blockquote></div></div>