drm/amd/display: Limit DCN to x86 arch
Subsystems (3)
PATCH 1/1 drm/amd/display: Limit DCN to x86 arch
DCN bw calcs currently rely on the following gcc options:
-mhard-float -msse -mpreferred-stack-boundary=4
We probably shouldn't allow building this on architectures other than x86.
---
Tested this change by running make menuconfig and make modules with ARCH=arm.
Harry
drivers/gpu/drm/amd/display/Kconfig | 2 +- drivers/gpu/drm/amd/display/dc/calcs/Makefile | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/Kconfig +1 -1
@@ -11,7 +11,7 @@ config DRM_AMD_DC config DRM_AMD_DC_DCN1_0 bool "DCN 1.0 Raven family" - depends on DRM_AMD_DC + depends on DRM_AMD_DC && X86 help Choose this option if you want to have RV family for display engine
drivers/gpu/drm/amd/display/dc/calcs/Makefile +2 -0
@@ -3,9 +3,11 @@ # It calculates Bandwidth and Watermarks values for HW programming # +ifeq ($(ARCH),x86) CFLAGS_dcn_calcs.o := -mhard-float -msse -mpreferred-stack-boundary=4 CFLAGS_dcn_calc_auto.o := -mhard-float -msse -mpreferred-stack-boundary=4 CFLAGS_dcn_calc_math.o := -mhard-float -msse -mpreferred-stack-boundary=4 +endif BW_CALCS = dce_calcs.o bw_fixed.o custom_float.o
Signature · 6 lines
2.11.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20170519140121.14296-1-harry.wentland-5C7GfCeVMHo@public.gmane.org
Lazare, Jordan
Acked-by Jordan Lazare-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Harry Wentland
Sent: Friday, May 19, 2017 10:01 AM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Daenzer, Michel <[email protected]>; Laktyushkin, Dmytro <[email protected]>; Deucher, Alexander <[email protected]>; Cheng, Tony <[email protected]>; Koenig, Christian <[email protected]>
Subject: [PATCH] drm/amd/display: Limit DCN to x86 arch
DCN bw calcs currently rely on the following gcc options:
-mhard-float -msse -mpreferred-stack-boundary=4
We probably shouldn't allow building this on architectures other than x86.
---
Tested this change by running make menuconfig and make modules with ARCH=arm.
Harry
drivers/gpu/drm/amd/display/Kconfig | 2 +- drivers/gpu/drm/amd/display/dc/calcs/Makefile | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/Kconfig +1 -1
@@ -11,7 +11,7 @@ config DRM_AMD_DC config DRM_AMD_DC_DCN1_0 bool "DCN 1.0 Raven family" - depends on DRM_AMD_DC + depends on DRM_AMD_DC && X86 help Choose this option if you want to have RV family for display engine diff --git a/drivers/gpu/drm/amd/display/dc/calcs/Makefile b/drivers/gpu/drm/amd/display/dc/calcs/Makefile
index a095472bf4b5..2e4ce0918c02 100644
drivers/gpu/drm/amd/display/dc/calcs/Makefile +2 -1
@@ -3,9 +3,11 @@ # It calculates Bandwidth and Watermarks values for HW programming # +ifeq ($(ARCH),x86) CFLAGS_dcn_calcs.o := -mhard-float -msse -mpreferred-stack-boundary=4 CFLAGS_dcn_calc_auto.o := -mhard-float -msse -mpreferred-stack-boundary=4 CFLAGS_dcn_calc_math.o := -mhard-float -msse -mpreferred-stack-boundary=4 +endif BW_CALCS = dce_calcs.o bw_fixed.o custom_float.o --
2.11.0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 19.05.2017 um 16:01 schrieb Harry Wentland:
Quoted 2 lines
DCN bw calcs currently rely on the following gcc options:
-mhard-float -msse -mpreferred-stack-boundary=4
Mhm, price question: Why does DCN rely on the gcc options?
That is something very unusual for drivers. We occasionally have something like enabling additional warnings, but things like "-mhard-float" is clearly raising an eyebrow here.
Christian.
Quoted 40 lines
We probably shouldn't allow building this on architectures other than x86.
CC Alex Deucher <[email protected]>CC Christian König <[email protected]>CC Michel Dänzer <[email protected]>CC Tony Cheng <[email protected]>CC Dmytro Laktyushkin <[email protected]>Signed-off-by Harry Wentland <[email protected]>---
Tested this change by running make menuconfig and make modules with ARCH=arm.
Harry
drivers/gpu/drm/amd/display/Kconfig | 2 +- drivers/gpu/drm/amd/display/dc/calcs/Makefile | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/display/Kconfig +1
-1@@ -11,7 +11,7 @@ config DRM_AMD_DC config DRM_AMD_DC_DCN1_0 bool "DCN 1.0 Raven family" - depends on DRM_AMD_DC + depends on DRM_AMD_DC && X86 help Choose this option if you want to have RV family for display enginedrivers/gpu/drm/amd/display/dc/calcs/Makefile +0
-0@@ -3,9 +3,11 @@ # It calculates Bandwidth and Watermarks values for HW programming
drivers/gpu/drm/amd/display/dc/calcs/Makefile line 13
Quoted 10 lines
drivers/gpu/drm/amd/display/dc/calcs/Makefile +2
-0# +ifeq ($(ARCH),x86) CFLAGS_dcn_calcs.o := -mhard-float -msse -mpreferred-stack-boundary=4 CFLAGS_dcn_calc_auto.o := -mhard-float -msse -mpreferred-stack-boundary=4 CFLAGS_dcn_calc_math.o := -mhard-float -msse -mpreferred-stack-boundary=4 +endif BW_CALCS = dce_calcs.o bw_fixed.o custom_float.o
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): f84c51b6-06f1-b4d2-c472-89265ebb26cb-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Quoted 6 lines · Christian König
Am 19.05.2017 um 16:01 schrieb Harry Wentland:
Quoted 2 lines
DCN bw calcs currently rely on the following gcc options:
-mhard-float -msse -mpreferred-stack-boundary=4Mhm, price question: Why does DCN rely on the gcc options?
Tony and Dmytro can probably provide more info here but my understanding is that DCN bandwidth calcs requires floating point support. This code comes pretty much straight from hardware teams with a guarantee that the output is good.
If we were to rewrite bandwidth calculations that guarantee would basically fly out the window, which means when there's a bandwidth bug we cannot easily get HW support unless we can prove that our calculations yield the exact same results in all cases as HWs formula. Covering all scenarios that bandwidth calcs covers would be quite an extensive undertaking and I'm sure we'd miss important cases.
Bandwidth issues can be very hard to pin down and changes in the calculations can have significant impact on our power efficiency.
Quoted 2 lines
That is something very unusual for drivers. We occasionally have something like enabling additional warnings, but things like "-mhard-float" is clearly raising an eyebrow here.
Absolutely, and I'd love to hear more opinions on this.
Harry
Quoted 42 lines
Christian.
Quoted 40 lines
We probably shouldn't allow building this on architectures other than x86.
CC Alex Deucher <[email protected]>CC Christian König <[email protected]>CC Michel Dänzer <[email protected]>CC Tony Cheng <[email protected]>CC Dmytro Laktyushkin <[email protected]>Signed-off-by Harry Wentland <[email protected]>---
Tested this change by running make menuconfig and make modules with ARCH=arm.
Harry
drivers/gpu/drm/amd/display/Kconfig | 2 +- drivers/gpu/drm/amd/display/dc/calcs/Makefile | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/display/Kconfig +1
-1@@ -11,7 +11,7 @@ config DRM_AMD_DC config DRM_AMD_DC_DCN1_0 bool "DCN 1.0 Raven family" - depends on DRM_AMD_DC + depends on DRM_AMD_DC && X86 help Choose this option if you want to have RV family for display enginedrivers/gpu/drm/amd/display/dc/calcs/Makefile +0
-0@@ -3,9 +3,11 @@ # It calculates Bandwidth and Watermarks values for HW programming #
Quoted 10 lines
drivers/gpu/drm/amd/display/dc/calcs/Makefile line 12
Quoted 8 lines
drivers/gpu/drm/amd/display/dc/calcs/Makefile +2
-2+ifeq ($(ARCH),x86) CFLAGS_dcn_calcs.o := -mhard-float -msse -mpreferred-stack-boundary=4 CFLAGS_dcn_calc_auto.o := -mhard-float -msse -mpreferred-stack-boundary=4 CFLAGS_dcn_calc_math.o := -mhard-float -msse -mpreferred-stack-boundary=4 +endif BW_CALCS = dce_calcs.o bw_fixed.o custom_float.o
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 7a8b84af-38f7-33d2-5bbb-473f2ea35bb2-5C7GfCeVMHo@public.gmane.org
Quoted 16 lines · Harry Wentland
Quoted 9 lines · Christian König
Am 19.05.2017 um 16:01 schrieb Harry Wentland:
Quoted 3 lines
DCN bw calcs currently rely on the following gcc options:
-mhard-float -msse -mpreferred-stack-boundary=4Mhm, price question: Why does DCN rely on the gcc options?
Tony and Dmytro can probably provide more info here but my understanding is that DCN bandwidth calcs requires floating point support. This code comes pretty much straight from hardware teams with a guarantee that the output is good.
Quoted 6 lines
If we were to rewrite bandwidth calculations that guarantee would basically fly out the window, which means when there's a bandwidth bug we cannot easily get HW support unless we can prove that our calculations yield the exact same results in all cases as HWs formula. Covering all scenarios that bandwidth calcs covers would be quite an extensive undertaking and I'm sure we'd miss important cases.
Is this only going to happen for X86 APUs? Using floating point in the kernel requires
a lot of care to be taken, are we doing it properly?
Really rewriting the calcs in fixed point is the best option, maybe push back on the hardware team to have a fixed point version created.
Dave.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): CAPM=9tzcA8t-ji6qNQhycB0cezz2vH6HMixCgvKQ78cY1Y8fsA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 24 lines · Dave Airlie
Quoted 16 lines · Harry Wentland
Quoted 9 lines · Christian König
Am 19.05.2017 um 16:01 schrieb Harry Wentland:
Quoted 3 lines
DCN bw calcs currently rely on the following gcc options:
-mhard-float -msse -mpreferred-stack-boundary=4Mhm, price question: Why does DCN rely on the gcc options?
Tony and Dmytro can probably provide more info here but my understanding is that DCN bandwidth calcs requires floating point support. This code comes pretty much straight from hardware teams with a guarantee that the output is good.
Quoted 6 lines
If we were to rewrite bandwidth calculations that guarantee would basically fly out the window, which means when there's a bandwidth bug we cannot easily get HW support unless we can prove that our calculations yield the exact same results in all cases as HWs formula. Covering all scenarios that bandwidth calcs covers would be quite an extensive undertaking and I'm sure we'd miss important cases.
Quoted 4 lines
Is this only going to happen for X86 APUs? Using floating point in the kernel requires
a lot of care to be taken, are we doing it properly?
This case would be only for AMD X86 APUs, although I wouldn't be surprised if we'd see something similar for discrete ASICs in the future.
Are you aware of anyone using our GPUs on non-X86 architectures? If so, I never heard of it.
I realize this is raising a lot of concern. I was concerned myself when I first saw this. Beside calling kernel_fpu_begin() and kernel_fpu_end() are there other things to watch out for?
Harry
Quoted 5 lines
Really rewriting the calcs in fixed point is the best option, maybe push back on the hardware team to have a fixed point version created.
Dave.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 4e0c342b-d18e-5f7a-bd30-9becd0e97e3c-5C7GfCeVMHo@public.gmane.org
Am 19.05.2017 um 22:28 schrieb Harry Wentland:
Quoted 27 lines · Dave Airlie
Quoted 24 lines · Harry Wentland
Quoted 22 lines · Christian König
Quoted 9 lines
Am 19.05.2017 um 16:01 schrieb Harry Wentland:
Quoted 3 lines
DCN bw calcs currently rely on the following gcc options:
-mhard-float -msse -mpreferred-stack-boundary=4Mhm, price question: Why does DCN rely on the gcc options?
Tony and Dmytro can probably provide more info here but my understanding is that DCN bandwidth calcs requires floating point support. This code comes pretty much straight from hardware teams with a guarantee that the output is good.
If we were to rewrite bandwidth calculations that guarantee would basically fly out the window, which means when there's a bandwidth bug we cannot easily get HW support unless we can prove that our calculations yield the exact same results in all cases as HWs formula. Covering all scenarios that bandwidth calcs covers would be quite an extensive undertaking and I'm sure we'd miss important cases.
Quoted 7 lines
Quoted 4 lines
Is this only going to happen for X86 APUs? Using floating point in the kernel requires
a lot of care to be taken, are we doing it properly?This case would be only for AMD X86 APUs, although I wouldn't be surprised if we'd see something similar for discrete ASICs in the future.
Ok, that makes at least a bit more sense. On APUs we obviously know exactly what CPU we have.
Quoted 1 line
Are you aware of anyone using our GPUs on non-X86 architectures? If so, I never heard of it.
Yeah, there are actually quite a number of people. That's one of the reasons why we still have a bunch of "#ifdef __BIG_ENDIAN" in the amdgpu source.
Quoted 1 line
I realize this is raising a lot of concern. I was concerned myself when I first saw this. Beside calling
kernel_fpu_begin()andkernel_fpu_end()are there other things to watch out for?
Yeah, especially setting "-msse" is rather questionable. As far as I know on 64bit systems it is the default, but on 32bit systems that could silently break some assumptions.
Additional to that as far as I know "-msse" is just for optimization and that isn't performance critical code, so why exactly do we need it?
Christian.
Quoted 6 lines
Harry
Quoted 3 lines
Really rewriting the calcs in fixed point is the best option, maybe push back on the hardware team to have a fixed point version created.
Quoted 6 lines
Quoted 2 lines
Dave.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 013f44e3-1734-43f8-4cd7-e950ffb014f0-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Quoted 33 lines · Christian König
Am 19.05.2017 um 22:28 schrieb Harry Wentland:
Quoted 32 lines · Dave Airlie
Quoted 28 lines · Harry Wentland
Quoted 16 lines · Christian König
Quoted 9 lines
Am 19.05.2017 um 16:01 schrieb Harry Wentland:
Quoted 3 lines
DCN bw calcs currently rely on the following gcc options:
-mhard-float -msse -mpreferred-stack-boundary=4Mhm, price question: Why does DCN rely on the gcc options?
Tony and Dmytro can probably provide more info here but my understanding is that DCN bandwidth calcs requires floating point support. This code comes pretty much straight from hardware teams with a guarantee that the output is good.
Quoted 6 lines
If we were to rewrite bandwidth calculations that guarantee would basically fly out the window, which means when there's a bandwidth bug we cannot easily get HW support unless we can prove that our calculations yield the exact same results in all cases as HWs formula. Covering all scenarios that bandwidth calcs covers would be quite an extensive undertaking and I'm sure we'd miss important cases.
Is this only going to happen for X86 APUs? Using floating point in the kernel requires
a lot of care to be taken, are we doing it properly?
Quoted 9 lines
Quoted 2 lines
This case would be only for AMD X86 APUs, although I wouldn't be surprised if we'd see something similar for discrete ASICs in the future.
Ok, that makes at least a bit more sense. On APUs we obviously know exactly what CPU we have.
Quoted 1 line
Are you aware of anyone using our GPUs on non-X86 architectures? If so, I never heard of it.
Yeah, there are actually quite a number of people. That's one of the reasons why we still have a bunch of "#ifdef
__BIG_ENDIAN" in the amdgpu source.
Interesting. I'd love to know more about this, like which platforms, etc, since sadly we've been pretty unaware of this.
Quoted 6 lines
Quoted 1 line
I realize this is raising a lot of concern. I was concerned myself when I first saw this. Beside calling
kernel_fpu_begin()andkernel_fpu_end()are there other things to watch out for?Yeah, especially setting "-msse" is rather questionable. As far as I know on 64bit systems it is the default, but on 32bit systems that could silently break some assumptions.
Additional to that as far as I know "-msse" is just for optimization and that isn't performance critical code, so why exactly do we need it?
Once we enable multi-plane code this code becomes performance critical as I believe it gets executed when resizing an underlay surface, such as a video player.
I don't we've tried running without -msse, though. It might be good enough.
Harry
Quoted 16 lines
Christian.
Quoted 12 lines
Harry
Quoted 5 lines
Really rewriting the calcs in fixed point is the best option, maybe push back on the hardware team to have a fixed point version created.
Dave.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): ff8918ec-ee0e-692e-4ada-cd6bd939d902-5C7GfCeVMHo@public.gmane.org
Quoted 6 lines · Harry Wentland
Quoted 3 lines · Christian König
Are you aware of anyone using our GPUs on non-X86 architectures? If so, I never heard of it.
Quoted 7 lines
Quoted 4 lines
Yeah, there are actually quite a number of people. That's one of the reasons why we still have a bunch of "#ifdef
__BIG_ENDIAN" in the amdgpu source.Interesting. I'd love to know more about this, like which platforms, etc, since sadly we've been pretty unaware of this.
For ROCm we're working on supporting ARMv8 and Power8. This is for compute, so mostly headless. Not sure if they would care about display in the future.
Regards,
Felix
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 11 lines · Harry Wentland
Quoted 10 lines · Christian König
Am 19.05.2017 um 22:28 schrieb Harry Wentland:
Quoted 4 lines
I realize this is raising a lot of concern. I was concerned myself when I first saw this. Beside calling
kernel_fpu_begin()andkernel_fpu_end()are there other things to watch out for?Yeah, especially setting "-msse" is rather questionable. As far as I know on 64bit systems it is the default, but on 32bit systems that could silently break some assumptions.
Quoted 6 lines
Quoted 2 lines
Additional to that as far as I know "-msse" is just for optimization and that isn't performance critical code, so why exactly do we need it?
Once we enable multi-plane code this code becomes performance critical as I believe it gets executed when resizing an underlay surface, such as a video player.
That should still only happen once per frame though, i.e. on the order of 10s to 100s of times per second.
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx