Miouyouyou / rockchip-vcodec

The Rockchip VPU driver module code for Linux, taken from rockchip-forwardports. I'm still hesitating between rockchip-vcodec and literate-octo-guacamole though...
12 stars 5 forks source link

vcodec_service.c:449:3: error: implicit declaration of function ‘do_gettimeofday’ #9

Open gounthar opened 4 years ago

gounthar commented 4 years ago

Hi,

As I wrote in your other projects, I'm trying to get hardware encoding and decoding for the RK3399 boards I have. I gave a try at compiling your driver on my Orange Pi 4B running Armbian with kernel aarch64 Linux 5.4.49-rockchip64 and got:

make M=$PWD -C /usr/src/linux-source-5.4.49-rockchip64/ CONFIG_RK_VCODEC=m
make: Entering directory '/usr/src/linux-source-5.4.49-rockchip64'
  AR      /home/poddingue/ffmpeg_sources/rockchip-vcodec/built-in.a
  CC [M]  /home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.o
/home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.c: In function ‘time_record’:
/home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.c:449:3: error: implicit declaration of function ‘do_gettimeofday’; did you mean ‘do_settimeofday64’? [-Werror=implicit-function-declaration]
   do_gettimeofday((is_end) ? (&task->end) : (&task->start));
   ^~~~~~~~~~~~~~~
   do_settimeofday64
In file included from ./include/linux/byteorder/little_endian.h:5,
                 from ./arch/arm64/include/uapi/asm/byteorder.h:23,
                 from ./include/asm-generic/bitops/le.h:6,
                 from ./arch/arm64/include/asm/bitops.h:29,
                 from ./include/linux/bitops.h:26,
                 from ./include/linux/kernel.h:12,
                 from ./include/linux/clk.h:13,
                 from /home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.c:20:
/home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.c: In function ‘vpu_service_power_on’:
/home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.c:48:41: error: implicit declaration of function ‘IOMEM’; did you mean ‘ENOMEM’? [-Werror=implicit-function-declaration]
 #define RK_IO_ADDRESS(x)                IOMEM(0xFED00000 + x)
                                         ^~~~~
./include/uapi/linux/byteorder/little_endian.h:33:51: note: in definition of macro ‘__cpu_to_le32’
 #define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
                                                   ^
/home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.c:789:3: note: in expansion of macro ‘writel_relaxed’
   writel_relaxed(readl_relaxed(RK_GRF_VIRT + RK312X_GRF_SOC_CON1)
   ^~~~~~~~~~~~~~
./include/linux/byteorder/generic.h:89:21: note: in expansion of macro ‘__le32_to_cpu’
 #define le32_to_cpu __le32_to_cpu
                     ^~~~~~~~~~~~~
/home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.c:789:18: note: in expansion of macro ‘readl_relaxed’
   writel_relaxed(readl_relaxed(RK_GRF_VIRT + RK312X_GRF_SOC_CON1)
                  ^~~~~~~~~~~~~
/home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.c:49:41: note: in expansion of macro ‘RK_IO_ADDRESS’
 #define RK_GRF_VIRT                     RK_IO_ADDRESS(0x00010000)
                                         ^~~~~~~~~~~~~
/home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.c:789:32: note: in expansion of macro ‘RK_GRF_VIRT’
   writel_relaxed(readl_relaxed(RK_GRF_VIRT + RK312X_GRF_SOC_CON1)
                                ^~~~~~~~~~~
/home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.c:789:44: warning: passing argument 1 of ‘__raw_readl’ makes pointer from integer without a cast [-Wint-conversion]
   writel_relaxed(readl_relaxed(RK_GRF_VIRT + RK312X_GRF_SOC_CON1)
                                            ^
./include/uapi/linux/byteorder/little_endian.h:33:51: note: in definition of macro ‘__cpu_to_le32’
 #define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
                                                   ^
/home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.c:789:3: note: in expansion of macro ‘writel_relaxed’
   writel_relaxed(readl_relaxed(RK_GRF_VIRT + RK312X_GRF_SOC_CON1)
   ^~~~~~~~~~~~~~
./include/linux/byteorder/generic.h:89:21: note: in expansion of macro ‘__le32_to_cpu’
 #define le32_to_cpu __le32_to_cpu
                     ^~~~~~~~~~~~~
/home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.c:789:18: note: in expansion of macro ‘readl_relaxed’
   writel_relaxed(readl_relaxed(RK_GRF_VIRT + RK312X_GRF_SOC_CON1)
                  ^~~~~~~~~~~~~
In file included from ./include/linux/io.h:13,
                 from ./include/linux/irq.h:20,
                 from ./include/linux/of_irq.h:7,
                 from /home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.c:35:
./arch/arm64/include/asm/io.h:72:60: note: expected ‘const volatile void *’ but argument is of type ‘int’
 static inline u32 __raw_readl(const volatile void __iomem *addr)
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.c:791:16: warning: passing argument 2 of ‘__raw_writel’ makes pointer from integer without a cast [-Wint-conversion]
    RK_GRF_VIRT + RK312X_GRF_SOC_CON1);
./arch/arm64/include/asm/io.h:126:78: note: in definition of macro ‘writel_relaxed’
 #define writel_relaxed(v,c) ((void)__raw_writel((__force u32)cpu_to_le32(v),(c)))
                                                                              ^
./arch/arm64/include/asm/io.h:37:65: note: expected ‘volatile void *’ but argument is of type ‘int’
 static inline void __raw_writel(u32 val, volatile void __iomem *addr)
                                          ~~~~~~~~~~~~~~~~~~~~~~~^~~~
/home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.c: In function ‘vpu_get_clk’:
/home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.c:561:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (IS_ERR(pservice->pd_video)) {
      ^
/home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.c:565:2: note: here
  case VCODEC_DEVICE_ID_COMBO:
  ^~~~
/home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.c:573:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (IS_ERR(pservice->clk_core)) {
      ^
/home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.c:580:2: note: here
  case VCODEC_DEVICE_ID_VPU:
  ^~~~
cc1: some warnings being treated as errors
make[1]: *** [scripts/Makefile.build:266: /home/poddingue/ffmpeg_sources/rockchip-vcodec/vcodec_service.o] Error 1
make: *** [Makefile:1706: /home/poddingue/ffmpeg_sources/rockchip-vcodec] Error 2
make: Leaving directory '/usr/src/linux-source-5.4.49-rockchip64'

My gcc is

 gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/8/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 8.3.0-6' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --disable-libphobos --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu
Thread model: posix
gcc version 8.3.0 (Debian 8.3.0-6)

Thanks.

Miouyouyou commented 3 years ago

Greetings,

This project is quite outdated. I'll highly recommend using the latest 5.7 or, better, 5.8 kernels, and enable the 'staging' driver rkvdec (and disable the Hantro VPU driver), which seems to lead to good results according to https://forum.armbian.com/topic/13622-mainline-vpu/page/2/#comments

I'll try to provide a release of RockMyy64 with the appropriate drivers enabled this week. But meanwhile, if you can compile kernels, give it a try. You might also want to try Kwiboo's branch here : https://github.com/Kwiboo/linux-rockchip