linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] amdgpu: re-enable DCN for ppc64le
@ 2022-07-22  8:21 Dan Horák
  2022-07-22 12:32 ` Michael Ellerman
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Horák @ 2022-07-22  8:21 UTC (permalink / raw)
  To: amd-gfx, Linus Torvalds, Guenter Roeck, Michael Ellerman, linux-kernel
  Cc: Alex Deucher

Commit d11219ad53dc disabled the DCN driver for all platforms that
define PPC64 due long build issues during "make allmodconfig" using
cross-compilation. Cross-compilation defaults to the ppc64_defconfig
and thus big-endian toolchain configuration. The ppc64le platform uses a
different ABI and doesn't suffer from the build issues. Thus keep the
DCN driver disabled only for big-endian ppc64 builds and avoid
regression for ppc64le users of the amdgpu driver. Distros are mostly
focusing on ppc64le and that's likely why it got unnoticed, because
there were no build issues related to the amdgpu driver on ppc64le in
the 5.19 development cycle.

Tested by a local rebuild on ppc64le and using make.cross from a x86_64
machines.

Fixes: d11219ad53dc ("amdgpu: disable powerpc support for the newer display engine")

Signed-off-by: Dan Horák <dan@danny.cz>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2100
---
 drivers/gpu/drm/amd/display/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig
index 0ba0598eba20..778a6f58047c 100644
--- a/drivers/gpu/drm/amd/display/Kconfig
+++ b/drivers/gpu/drm/amd/display/Kconfig
@@ -6,7 +6,7 @@ config DRM_AMD_DC
 	bool "AMD DC - Enable new display engine"
 	default y
 	select SND_HDA_COMPONENT if SND_HDA_CORE
-	select DRM_AMD_DC_DCN if X86 && !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS)
+	select DRM_AMD_DC_DCN if (X86 || (PPC64 && CPU_LITTLE_ENDIAN)) && !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS)
 	help
 	  Choose this option if you want to use the new display engine
 	  support for AMDGPU. This adds required support for Vega and
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] amdgpu: re-enable DCN for ppc64le
  2022-07-22  8:21 [PATCH] amdgpu: re-enable DCN for ppc64le Dan Horák
@ 2022-07-22 12:32 ` Michael Ellerman
  2022-07-22 12:54   ` Dan Horák
  2022-07-22 13:23   ` Dan Horák
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Ellerman @ 2022-07-22 12:32 UTC (permalink / raw)
  To: Dan Horák, amd-gfx, Linus Torvalds, Guenter Roeck, linux-kernel
  Cc: Alex Deucher, linuxppc-dev

Hi Dan,

[ Cc += linuxppc-dev  ]

Dan Horák <dan@danny.cz> writes:
> Commit d11219ad53dc disabled the DCN driver for all platforms that
> define PPC64 due long build issues during "make allmodconfig" using
> cross-compilation. Cross-compilation defaults to the ppc64_defconfig
> and thus big-endian toolchain configuration. The ppc64le platform uses a
> different ABI and doesn't suffer from the build issues.

Unfortunately it's a bit messier than that.

The build error occurs when the compiler is built to use a 64-bit long
double type.

The ppc64le ABI document says that long double should be 128-bits, but
there are ppc64le compilers out there that are configured to use 64-bit
long double, notably the kernel.org crosstool compilers.

So just testing for CPU_LITTLE_ENDIAN means we'll still get build errors
on those compilers.

But I think we can detect the long double size and key off that. Can you
test the patch below works for you?

cheers


diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 7aa12e88c580..e9f8cd50af99 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -281,6 +281,9 @@ config PPC
 	# Please keep this list sorted alphabetically.
 	#
 
+config PCC_LONG_DOUBLE_128
+	def_bool $(success,test "$(shell,echo __LONG_DOUBLE_128__ | $(CC) -E -P -)" = 1)
+
 config PPC_BARRIER_NOSPEC
 	bool
 	default y
diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig
index b4029c0d5d8c..ec6771e87e73 100644
--- a/drivers/gpu/drm/amd/display/Kconfig
+++ b/drivers/gpu/drm/amd/display/Kconfig
@@ -6,7 +6,7 @@ config DRM_AMD_DC
 	bool "AMD DC - Enable new display engine"
 	default y
 	select SND_HDA_COMPONENT if SND_HDA_CORE
-	select DRM_AMD_DC_DCN if (X86 || PPC64) && !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS)
+	select DRM_AMD_DC_DCN if (X86 || PPC_LONG_DOUBLE_128) && !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS)
 	help
 	  Choose this option if you want to use the new display engine
 	  support for AMDGPU. This adds required support for Vega and

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] amdgpu: re-enable DCN for ppc64le
  2022-07-22 12:32 ` Michael Ellerman
@ 2022-07-22 12:54   ` Dan Horák
  2022-07-25 12:25     ` Michael Ellerman
  2022-07-22 13:23   ` Dan Horák
  1 sibling, 1 reply; 5+ messages in thread
From: Dan Horák @ 2022-07-22 12:54 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: amd-gfx, Linus Torvalds, Guenter Roeck, linux-kernel,
	Alex Deucher, linuxppc-dev

On Fri, 22 Jul 2022 22:32:06 +1000
Michael Ellerman <michael@ellerman.id.au> wrote:

> Hi Dan,
> 
> [ Cc += linuxppc-dev  ]
> 
> Dan Horák <dan@danny.cz> writes:
> > Commit d11219ad53dc disabled the DCN driver for all platforms that
> > define PPC64 due long build issues during "make allmodconfig" using
> > cross-compilation. Cross-compilation defaults to the ppc64_defconfig
> > and thus big-endian toolchain configuration. The ppc64le platform uses a
> > different ABI and doesn't suffer from the build issues.
> 
> Unfortunately it's a bit messier than that.
> 
> The build error occurs when the compiler is built to use a 64-bit long
> double type.
> 
> The ppc64le ABI document says that long double should be 128-bits, but
> there are ppc64le compilers out there that are configured to use 64-bit
> long double, notably the kernel.org crosstool compilers.
> 
> So just testing for CPU_LITTLE_ENDIAN means we'll still get build errors
> on those compilers.
> 
> But I think we can detect the long double size and key off that. Can you
> test the patch below works for you?
> 
> cheers
> 
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 7aa12e88c580..e9f8cd50af99 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -281,6 +281,9 @@ config PPC
>  	# Please keep this list sorted alphabetically.
>  	#
>  
> +config PCC_LONG_DOUBLE_128
> +	def_bool $(success,test "$(shell,echo __LONG_DOUBLE_128__ | $(CC) -E -P -)" = 1)

^^^ there is a typo s/PCC/PPC/ :-)

with that fixed, it then defines AMD_DC_DCN on Fedora 36 with
gcc-12.1.1-1.fc36.ppc64le and we should be OK.


		Dan

> +
>  config PPC_BARRIER_NOSPEC
>  	bool
>  	default y
> diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig
> index b4029c0d5d8c..ec6771e87e73 100644
> --- a/drivers/gpu/drm/amd/display/Kconfig
> +++ b/drivers/gpu/drm/amd/display/Kconfig
> @@ -6,7 +6,7 @@ config DRM_AMD_DC
>  	bool "AMD DC - Enable new display engine"
>  	default y
>  	select SND_HDA_COMPONENT if SND_HDA_CORE
> -	select DRM_AMD_DC_DCN if (X86 || PPC64) && !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS)
> +	select DRM_AMD_DC_DCN if (X86 || PPC_LONG_DOUBLE_128) && !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS)
>  	help
>  	  Choose this option if you want to use the new display engine
>  	  support for AMDGPU. This adds required support for Vega and

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] amdgpu: re-enable DCN for ppc64le
  2022-07-22 12:32 ` Michael Ellerman
  2022-07-22 12:54   ` Dan Horák
@ 2022-07-22 13:23   ` Dan Horák
  1 sibling, 0 replies; 5+ messages in thread
From: Dan Horák @ 2022-07-22 13:23 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: amd-gfx, Linus Torvalds, Guenter Roeck, linux-kernel,
	Alex Deucher, linuxppc-dev

On Fri, 22 Jul 2022 22:32:06 +1000
Michael Ellerman <michael@ellerman.id.au> wrote:

> Hi Dan,
> 
> [ Cc += linuxppc-dev  ]
> 
> Dan Horák <dan@danny.cz> writes:
> > Commit d11219ad53dc disabled the DCN driver for all platforms that
> > define PPC64 due long build issues during "make allmodconfig" using
> > cross-compilation. Cross-compilation defaults to the ppc64_defconfig
> > and thus big-endian toolchain configuration. The ppc64le platform uses a
> > different ABI and doesn't suffer from the build issues.
> 
> Unfortunately it's a bit messier than that.

yes, seems it is :-)

> The build error occurs when the compiler is built to use a 64-bit long
> double type.
> 
> The ppc64le ABI document says that long double should be 128-bits, but
> there are ppc64le compilers out there that are configured to use 64-bit
> long double, notably the kernel.org crosstool compilers.
> 
> So just testing for CPU_LITTLE_ENDIAN means we'll still get build errors
> on those compilers.
> 
> But I think we can detect the long double size and key off that. Can you
> test the patch below works for you?

yes, it does work, meaning it defines AMD_DC_DCN on Fedora/ppc64le (and
build is OK)


		Dan

> 
> cheers
> 
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 7aa12e88c580..e9f8cd50af99 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -281,6 +281,9 @@ config PPC
>  	# Please keep this list sorted alphabetically.
>  	#
>  
> +config PCC_LONG_DOUBLE_128
> +	def_bool $(success,test "$(shell,echo __LONG_DOUBLE_128__ | $(CC) -E -P -)" = 1)
> +
>  config PPC_BARRIER_NOSPEC
>  	bool
>  	default y
> diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig
> index b4029c0d5d8c..ec6771e87e73 100644
> --- a/drivers/gpu/drm/amd/display/Kconfig
> +++ b/drivers/gpu/drm/amd/display/Kconfig
> @@ -6,7 +6,7 @@ config DRM_AMD_DC
>  	bool "AMD DC - Enable new display engine"
>  	default y
>  	select SND_HDA_COMPONENT if SND_HDA_CORE
> -	select DRM_AMD_DC_DCN if (X86 || PPC64) && !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS)
> +	select DRM_AMD_DC_DCN if (X86 || PPC_LONG_DOUBLE_128) && !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS)
>  	help
>  	  Choose this option if you want to use the new display engine
>  	  support for AMDGPU. This adds required support for Vega and

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] amdgpu: re-enable DCN for ppc64le
  2022-07-22 12:54   ` Dan Horák
@ 2022-07-25 12:25     ` Michael Ellerman
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2022-07-25 12:25 UTC (permalink / raw)
  To: Dan Horák
  Cc: amd-gfx, Linus Torvalds, Guenter Roeck, linux-kernel,
	Alex Deucher, linuxppc-dev

Dan Horák <dan@danny.cz> writes:
> On Fri, 22 Jul 2022 22:32:06 +1000
> Michael Ellerman <michael@ellerman.id.au> wrote:
>> Dan Horák <dan@danny.cz> writes:
>> > Commit d11219ad53dc disabled the DCN driver for all platforms that
>> > define PPC64 due long build issues during "make allmodconfig" using
>> > cross-compilation. Cross-compilation defaults to the ppc64_defconfig
>> > and thus big-endian toolchain configuration. The ppc64le platform uses a
>> > different ABI and doesn't suffer from the build issues.
>> 
>> Unfortunately it's a bit messier than that.
>> 
>> The build error occurs when the compiler is built to use a 64-bit long
>> double type.
>> 
>> The ppc64le ABI document says that long double should be 128-bits, but
>> there are ppc64le compilers out there that are configured to use 64-bit
>> long double, notably the kernel.org crosstool compilers.
>> 
>> So just testing for CPU_LITTLE_ENDIAN means we'll still get build errors
>> on those compilers.
>> 
>> But I think we can detect the long double size and key off that. Can you
>> test the patch below works for you?
>> 
>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>> index 7aa12e88c580..e9f8cd50af99 100644
>> --- a/arch/powerpc/Kconfig
>> +++ b/arch/powerpc/Kconfig
>> @@ -281,6 +281,9 @@ config PPC
>>  	# Please keep this list sorted alphabetically.
>>  	#
>>  
>> +config PCC_LONG_DOUBLE_128
>> +	def_bool $(success,test "$(shell,echo __LONG_DOUBLE_128__ | $(CC) -E -P -)" = 1)
>
> ^^^ there is a typo s/PCC/PPC/ :-)

Oops, renamed it after testing :}

> with that fixed, it then defines AMD_DC_DCN on Fedora 36 with
> gcc-12.1.1-1.fc36.ppc64le and we should be OK.

Thanks. I'll send a proper patch.

cheers

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-25 12:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-22  8:21 [PATCH] amdgpu: re-enable DCN for ppc64le Dan Horák
2022-07-22 12:32 ` Michael Ellerman
2022-07-22 12:54   ` Dan Horák
2022-07-25 12:25     ` Michael Ellerman
2022-07-22 13:23   ` Dan Horák

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).