Skip to contentSkip to conversation

Add generic FPU api similar to x86

RFC Superseded Anson Jacob 5 participants 9 messages Jul 19, 2021 – Mar 2, 2022

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Add generic FPU api similar to x86

This is an attempt to have generic FPU enable/disable calls similar to x86.
So that we can simplify gpu/drm/amd/display/dc/os_types.h

Also adds FPU correctness logic seen in x86.

Anson Jacob (2):
ppc/fpu: Add generic FPU api similar to x86
drm/amd/display: Use PPC FPU functions

 arch/powerpc/include/asm/switch_to.h      |  29 ++---
 arch/powerpc/kernel/process.c             | 130 ++++++++++++++++++++++
 drivers/gpu/drm/amd/display/dc/os_types.h |  28 +----
 3 files changed, 139 insertions(+), 48 deletions(-)
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw

RFC 1/2 ppc/fpu: Add generic FPU api similar to x86

- Add kernel_fpu_begin & kernel_fpu_end API as x86
- Add logic similar to x86 to ensure fpu begin/end call correctness
- Add kernel_fpu_enabled to know if FPU is enabled

---
 arch/powerpc/include/asm/switch_to.h |  29 ++----
 arch/powerpc/kernel/process.c        | 130 +++++++++++++++++++++++++++
 2 files changed, 137 insertions(+), 22 deletions(-)
arch/powerpc/include/asm/switch_to.h +7 -22
index 9d1fbd8be1c7..aded7aa661c0 100644
@@ -41,10 +41,7 @@ extern void enable_kernel_fp(void);
 extern void flush_fp_to_thread(struct task_struct *);
 extern void giveup_fpu(struct task_struct *);
 extern void save_fpu(struct task_struct *);
-static inline void disable_kernel_fp(void)
-{
-	msr_check_and_clear(MSR_FP);
-}
+extern void disable_kernel_fp(void);
 #else
 static inline void save_fpu(struct task_struct *t) { }
 static inline void flush_fp_to_thread(struct task_struct *t) { }
@@ -55,10 +52,7 @@ extern void enable_kernel_altivec(void);
 extern void flush_altivec_to_thread(struct task_struct *);
 extern void giveup_altivec(struct task_struct *);
 extern void save_altivec(struct task_struct *);
-static inline void disable_kernel_altivec(void)
-{
-	msr_check_and_clear(MSR_VEC);
-}
+extern void disable_kernel_altivec(void);
 #else
 static inline void save_altivec(struct task_struct *t) { }
 static inline void __giveup_altivec(struct task_struct *t) { }
@@ -67,20 +61,7 @@ static inline void __giveup_altivec(struct task_struct *t) { }
 #ifdef CONFIG_VSX
 extern void enable_kernel_vsx(void);
 extern void flush_vsx_to_thread(struct task_struct *);
-static inline void disable_kernel_vsx(void)
-{
-	msr_check_and_clear(MSR_FP|MSR_VEC|MSR_VSX);
-}
-#else
-static inline void enable_kernel_vsx(void)
-{
-	BUILD_BUG();
-}
-
-static inline void disable_kernel_vsx(void)
-{
-	BUILD_BUG();
-}
+extern void disable_kernel_vsx(void);
 #endif
 
 #ifdef CONFIG_SPE
@@ -114,4 +95,8 @@ static inline void clear_task_ebb(struct task_struct *t)
 
 extern int set_thread_tidr(struct task_struct *t);
 
+bool kernel_fpu_enabled(void);
+void kernel_fpu_begin(void);
+void kernel_fpu_end(void);
+
 #endif /* _ASM_POWERPC_SWITCH_TO_H */
arch/powerpc/kernel/process.c +130 -0

178 lines not on this page · raw message

Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#2 lore raw

Re: [RFC 1/2] ppc/fpu: Add generic FPU api similar to x86

Quoted 6 lines · Anson Jacob

- Add kernel_fpu_begin & kernel_fpu_end API as x86
- Add logic similar to x86 to ensure fpu begin/end call correctness
- Add kernel_fpu_enabled to know if FPU is enabled

All the x86 FPU support is EXPORT_SYMBOL_GPL for a good reason, so please stick to that.

#3 lore raw

Re: [RFC 1/2] ppc/fpu: Add generic FPU api similar to x86

In reply to Anson Jacob
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch]

Hi Anson,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on powerpc/next]
[also build test ERROR on linus/master v5.14-rc2 next-20210720] [cannot apply to paulus-powerpc/kvm-ppc-next]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Anson-Jacob/Add-generic-FPU-api-similar-to-x86/20210720-143354
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-stx_gp3_defconfig (attached as .config)
compiler: powerpc-linux-gcc (GCC) 10.3.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/5cd65b03db50b99961fa08fdc6aa8ca919cb05d4
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Anson-Jacob/Add-generic-FPU-api-similar-to-x86/20210720-143354 git checkout 5cd65b03db50b99961fa08fdc6aa8ca919cb05d4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=powerpc

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

arch/powerpc/kernel/process.c: In function 'kernel_fpu_end':

>> arch/powerpc/kernel/process.c:534:1: error: label 'done' defined but not used [-Werror=unused-label]
     534 | done:
         | ^~~~

cc1: all warnings being treated as errors

vim +/done +534 arch/powerpc/kernel/process.c

533

 > 534	done:

535 preempt_enable();
536 }
537 EXPORT_SYMBOL_GPL(kernel_fpu_end);
538

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#4 lore raw

RFC 2/2 drm/amd/display: Use PPC FPU functions

In reply to Anson Jacob

Use kernel_fpu_begin & kernel_fpu_end for PPC

Depends on "ppc/fpu: Add generic FPU api similar to x86"

---
 drivers/gpu/drm/amd/display/dc/os_types.h | 28 ++---------------------
 1 file changed, 2 insertions(+), 26 deletions(-)
drivers/gpu/drm/amd/display/dc/os_types.h +2 -26
index 126c2f3a4dd3..999c5103357e 100644
@@ -57,32 +57,8 @@
 #define DC_FP_END() kernel_fpu_end()
 #elif defined(CONFIG_PPC64)
 #include <asm/switch_to.h>
-#include <asm/cputable.h>
-#define DC_FP_START() { \
-	if (cpu_has_feature(CPU_FTR_VSX_COMP)) { \
-		preempt_disable(); \
-		enable_kernel_vsx(); \
-	} else if (cpu_has_feature(CPU_FTR_ALTIVEC_COMP)) { \
-		preempt_disable(); \
-		enable_kernel_altivec(); \
-	} else if (!cpu_has_feature(CPU_FTR_FPU_UNAVAILABLE)) { \
-		preempt_disable(); \
-		enable_kernel_fp(); \
-	} \
-}
-#define DC_FP_END() { \
-	if (cpu_has_feature(CPU_FTR_VSX_COMP)) { \
-		disable_kernel_vsx(); \
-		preempt_enable(); \
-	} else if (cpu_has_feature(CPU_FTR_ALTIVEC_COMP)) { \
-		disable_kernel_altivec(); \
-		preempt_enable(); \
-	} else if (!cpu_has_feature(CPU_FTR_FPU_UNAVAILABLE)) { \
-		disable_kernel_fp(); \
-		preempt_enable(); \
-	} \
-}
-#endif
+#define DC_FP_START() kernel_fpu_begin()
+#define DC_FP_END() kernel_fpu_end()
 #endif
 
 /*
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#5 lore raw

Re: [RFC 2/2] drm/amd/display: Use PPC FPU functions

drivers/gpu/drm/amd/display/dc/os_types.h line 62

Quoted 6 lines

#define DC_FP_END() kernel_fpu_end()
#elif defined(CONFIG_PPC64)
#include <asm/switch_to.h>

drivers/gpu/drm/amd/display/dc/os_types.h +2 -0
+#define DC_FP_START() kernel_fpu_begin()
+#define DC_FP_END() kernel_fpu_end()
 #endif

Please use the same header as x86 in your first patch and then kill this ifdefered and the DC_FP_START/DC_FP_END definitions entirely.

#6 lore raw

Re: [RFC 2/2] drm/amd/display: Use PPC FPU functions

In reply to Anson Jacob
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch]

Hi Anson,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on powerpc/next]
[also build test ERROR on linus/master v5.14-rc2 next-20210720] [cannot apply to paulus-powerpc/kvm-ppc-next]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Anson-Jacob/Add-generic-FPU-api-similar-to-x86/20210720-143354
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: alpha-buildonly-randconfig-r002-20210720 (attached as .config)
compiler: alpha-linux-gcc (GCC) 10.3.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/46ec3bc66107042f3b73b08f66d88f233c86f8f3
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Anson-Jacob/Add-generic-FPU-api-similar-to-x86/20210720-143354 git checkout 46ec3bc66107042f3b73b08f66d88f233c86f8f3
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=alpha SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:29,

                    from drivers/gpu/drm/amd/amdgpu/../include/dm_pp_interface.h:26,
                    from drivers/gpu/drm/amd/amdgpu/amdgpu.h:66,
                    from drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c:29:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:32,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../include/dm_pp_interface.h:26,
                    from drivers/gpu/drm/amd/amdgpu/amdgpu.h:66,
                    from drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c:29:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:33,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../include/dm_pp_interface.h:26,
                    from drivers/gpu/drm/amd/amdgpu/amdgpu.h:66,
                    from drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c:29:
   drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h: In function 'dc_fixpt_shl':
>> drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:212:2: error: implicit declaration of function 'ASSERT' [-Werror=implicit-function-declaration]
     212 |  ASSERT(((arg.value >= 0) && (arg.value <= LLONG_MAX >> shift)) ||
         |  ^~~~~~
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/irq_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:34,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../include/dm_pp_interface.h:26,
                    from drivers/gpu/drm/amd/amdgpu/amdgpu.h:66,
                    from drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c:29:
   drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h: At top level:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dp_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:35,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../include/dm_pp_interface.h:26,
                    from drivers/gpu/drm/amd/amdgpu/amdgpu.h:66,
                    from drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c:29:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_hw_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:36,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../include/dm_pp_interface.h:26,
                    from drivers/gpu/drm/amd/amdgpu/amdgpu.h:66,
                    from drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c:29:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 

cc1: some warnings being treated as errors
--
In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:29,
from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:29:

>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:32,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:29:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:33,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:29:
   drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h: In function 'dc_fixpt_shl':
>> drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:212:2: error: implicit declaration of function 'ASSERT' [-Werror=implicit-function-declaration]
     212 |  ASSERT(((arg.value >= 0) && (arg.value <= LLONG_MAX >> shift)) ||
         |  ^~~~~~
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/irq_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:34,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:29:
   drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h: At top level:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dp_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:35,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:29:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_hw_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:36,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:29:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/include/logger_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc.h:31,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:30:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/inc/hw/hw_shared.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/inc/hw/opp.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc.h:38,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:30:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:37:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/modules/inc/mod_hdcp.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:49:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function 'amdgpu_dm_atomic_commit_tail':
>> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8983:5: error: implicit declaration of function 'DC_ERR'; did you mean 'IS_ERR'? [-Werror=implicit-function-declaration]
    8983 |     DC_ERR("got no status for stream %p on acrtc%p\n", dm_new_crtc_state->stream, acrtc);
         |     ^~~~~~
         |     IS_ERR

cc1: some warnings being treated as errors
--
In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:29,
from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_irq.c:26:

>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:32,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_irq.c:26:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:33,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_irq.c:26:
   drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h: In function 'dc_fixpt_shl':
>> drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:212:2: error: implicit declaration of function 'ASSERT' [-Werror=implicit-function-declaration]
     212 |  ASSERT(((arg.value >= 0) && (arg.value <= LLONG_MAX >> shift)) ||
         |  ^~~~~~
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/irq_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:34,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_irq.c:26:
   drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h: At top level:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dp_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:35,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_irq.c:26:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_hw_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:36,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_irq.c:26:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/include/logger_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc.h:31,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_irq.c:27:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/inc/hw/hw_shared.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/inc/hw/opp.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc.h:38,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_irq.c:27:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   cc1: some warnings being treated as errors
--
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services.h:35,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_pp_smu.c:29:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:32,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services.h:35,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_pp_smu.c:29:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:33,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services.h:35,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_pp_smu.c:29:
   drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h: In function 'dc_fixpt_shl':
>> drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:212:2: error: implicit declaration of function 'ASSERT' [-Werror=implicit-function-declaration]
     212 |  ASSERT(((arg.value >= 0) && (arg.value <= LLONG_MAX >> shift)) ||
         |  ^~~~~~
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/irq_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:34,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services.h:35,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_pp_smu.c:29:
   drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h: At top level:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dp_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:35,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services.h:35,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_pp_smu.c:29:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_hw_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:36,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services.h:35,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_pp_smu.c:29:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/include/logger_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/include/logger_interface.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services.h:36,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_pp_smu.c:29:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 

cc1: some warnings being treated as errors
--
In file included from drivers/gpu/drm/amd/amdgpu/../display/modules/inc/mod_hdcp.h:29,
from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.h:29, from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.c:26:

>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:32,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.h:31,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.c:26:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:33,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.h:31,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.c:26:
   drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h: In function 'dc_fixpt_shl':
>> drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:212:2: error: implicit declaration of function 'ASSERT' [-Werror=implicit-function-declaration]
     212 |  ASSERT(((arg.value >= 0) && (arg.value <= LLONG_MAX >> shift)) ||
         |  ^~~~~~
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/irq_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:34,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.h:31,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.c:26:
   drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h: At top level:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dp_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:35,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.h:31,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.c:26:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_hw_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:36,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.h:31,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.c:26:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/include/logger_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc.h:31,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.h:31,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.c:26:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/inc/hw/hw_shared.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/inc/hw/opp.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc.h:38,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.h:31,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.c:26:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services.h:35,
                    from drivers/gpu/drm/amd/amdgpu/../display/include/bios_parser_types.h:30,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/inc/clock_source.h:31,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/inc/hw_sequencer.h:29,
                    from drivers/gpu/drm/amd/amdgpu/../display/dc/dc.h:40,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.h:31,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.c:26:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h:27: error: unterminated #ifndef
      27 | #ifndef _OS_TYPES_H_
         | 

cc1: some warnings being treated as errors
..

vim +27 drivers/gpu/drm/amd/amdgpu/../display/dc/os_types.h

4562236b3bc0a2 Harry Wentland 2017-09-12 @27 #ifndef _OS_TYPES_H_ 4562236b3bc0a2 Harry Wentland 2017-09-12 28 #define _OS_TYPES_H_ 4562236b3bc0a2 Harry Wentland 2017-09-12 29

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#7 lore raw
In reply to Anson Jacob

While you already CCed a bunch of people stuff like that needs to go to the appropriate mailing list and not just amd-gfx.

Especially LKML so that other core devs can take a look as well.

Regards,
Christian.

Am 19.07.21 um 21:52 schrieb Anson Jacob:

Quoted 6 lines

This is an attempt to have generic FPU enable/disable calls similar to x86.
So that we can simplify gpu/drm/amd/display/dc/os_types.h

Also adds FPU correctness logic seen in x86.

Quoted 9 lines

Anson Jacob (2):
ppc/fpu: Add generic FPU api similar to x86
drm/amd/display: Use PPC FPU functions

  arch/powerpc/include/asm/switch_to.h      |  29 ++---
  arch/powerpc/kernel/process.c             | 130 ++++++++++++++++++++++
  drivers/gpu/drm/amd/display/dc/os_types.h |  28 +----
  3 files changed, 139 insertions(+), 48 deletions(-)

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#8 lore raw
In reply to Anson Jacob

Le 19/07/2021 à 21:52, Anson Jacob a écrit :

Quoted 3 lines

This is an attempt to have generic FPU enable/disable calls similar to x86.
So that we can simplify gpu/drm/amd/display/dc/os_types.h

Seems like gpu/drm/amd/display/dc/os_types.h has been simplified through another way via commit 96ee63730fa3 ("drm/amd/display: Add control mechanism for FPU")

Are powerpc changes in patch 1 still relevant ? In that case please rebase.

Quoted 12 lines

Also adds FPU correctness logic seen in x86.

Anson Jacob (2):
ppc/fpu: Add generic FPU api similar to x86
drm/amd/display: Use PPC FPU functions

  arch/powerpc/include/asm/switch_to.h      |  29 ++---
  arch/powerpc/kernel/process.c             | 130 ++++++++++++++++++++++
  drivers/gpu/drm/amd/display/dc/os_types.h |  28 +----
  3 files changed, 139 insertions(+), 48 deletions(-)