notro / fbtft

Linux Framebuffer drivers for small TFT LCD display modules. Development has moved to https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/tree/drivers/staging/fbtft?h=staging-testing
1.85k stars 493 forks source link

Buildroot failed because of fbtft #590

Closed OmidID closed 2 years ago

OmidID commented 2 years ago

Hello,

I trying to build my custom kernel using buildroot for RPi3 and I get error that I cannot get rid of it.

In file included from drivers/video/fbdev/fbtft/fbtft-core.c:43:
drivers/video/fbdev/fbtft/fbtft.h:254:25: error: field ‘update_time’ has incomplete type
  254 |         struct timespec update_time;
      |                         ^~~~~~~~~~~
drivers/video/fbdev/fbtft/fbtft-core.c: In function ‘fbtft_update_display’:
drivers/video/fbdev/fbtft/fbtft-core.c:373:25: error: storage size of ‘ts_start’ isn’t known
  373 |         struct timespec ts_start, ts_end, ts_fps, ts_duration;
      |                         ^~~~~~~~
drivers/video/fbdev/fbtft/fbtft-core.c:373:35: error: storage size of ‘ts_end’ isn’t known
  373 |         struct timespec ts_start, ts_end, ts_fps, ts_duration;
      |                                   ^~~~~~
drivers/video/fbdev/fbtft/fbtft-core.c:373:43: error: storage size of ‘ts_fps’ isn’t known
  373 |         struct timespec ts_start, ts_end, ts_fps, ts_duration;
      |                                           ^~~~~~
drivers/video/fbdev/fbtft/fbtft-core.c:373:51: error: storage size of ‘ts_duration’ isn’t known
  373 |         struct timespec ts_start, ts_end, ts_fps, ts_duration;
      |                                                   ^~~~~~~~~~~
drivers/video/fbdev/fbtft/fbtft-core.c:382:25: error: implicit declaration of function ‘getnstimeofday’ [-Werror=implicit-function-declaration]
  382 |                         getnstimeofday(&ts_start);
      |                         ^~~~~~~~~~~~~~
drivers/video/fbdev/fbtft/fbtft-core.c:424:26: error: implicit declaration of function ‘timespec_sub’; did you mean ‘timespec64_sub’? [-Werror=implicit-function-declaration]
  424 |                 ts_fps = timespec_sub(ts_start, par->update_time);
      |                          ^~~~~~~~~~~~
      |                          timespec64_sub
drivers/video/fbdev/fbtft/fbtft-core.c:373:51: warning: unused variable ‘ts_duration’ [-Wunused-variable]
  373 |         struct timespec ts_start, ts_end, ts_fps, ts_duration;
      |                                                   ^~~~~~~~~~~
drivers/video/fbdev/fbtft/fbtft-core.c:373:43: warning: unused variable ‘ts_fps’ [-Wunused-variable]
  373 |         struct timespec ts_start, ts_end, ts_fps, ts_duration;
      |                                           ^~~~~~
drivers/video/fbdev/fbtft/fbtft-core.c:373:35: warning: unused variable ‘ts_end’ [-Wunused-variable]
  373 |         struct timespec ts_start, ts_end, ts_fps, ts_duration;
      |                                   ^~~~~~
drivers/video/fbdev/fbtft/fbtft-core.c:373:25: warning: unused variable ‘ts_start’ [-Wunused-variable]
  373 |         struct timespec ts_start, ts_end, ts_fps, ts_duration;
      |                         ^~~~~~~~
drivers/video/fbdev/fbtft/fbtft-core.c: In function ‘fbtft_unregister_framebuffer’:
drivers/video/fbdev/fbtft/fbtft-core.c:1053:13: error: void value not ignored as it ought to be
 1053 |         ret = unregister_framebuffer(fb_info);
      |             ^
cc1: some warnings being treated as errors
make[6]: *** [scripts/Makefile.build:280: drivers/video/fbdev/fbtft/fbtft-core.o] Error 1
make[5]: *** [scripts/Makefile.build:497: drivers/video/fbdev/fbtft] Error 2
make[5]: *** Waiting for unfinished jobs....

I also try to change the gcc to 11 but same error.

Any suggestion that I can fix this issue?

Thanks a lot. :)

notro commented 2 years ago

Are you enabling this option on a >=4.0 kernel?

config BR2_LINUX_KERNEL_EXT_FBTFT
    bool "FB TFT drivers"
    select BR2_PACKAGE_FBTFT
    help
      Linux Framebuffer drivers for small TFT LCD display modules,
      e.g. Adafruit PiTFT displays for Raspberry Pi (this extra
      package is only needed for linux kernels until v3.19, since
      v4.0 the drivers are included in the staging area).

If so that's your problem.

OmidID commented 2 years ago

Hello @notro . thanks for the answer. Yes, that is enabled image

notro commented 2 years ago

Unless you use an old kernel you need to disable that.

OmidID commented 2 years ago

I using 5.17 . Actually, I tried both, disabled and enabled. the result will be the same :( Is there any flag or something that I must set to the gcc? Currently, I using gcc 11.

notro commented 2 years ago

fbtft doesn't use struct timespec in 5.17, it uses ktime_t so I don't know how you can get the same compile error: https://elixir.bootlin.com/linux/v5.17/source/drivers/staging/fbtft/fbtft.h#L228

OmidID commented 2 years ago

YOU RIGHT!!! I confused. How did I end up with this problem! :D Maybe something is wrong with the Buildroot. Do you have any idea what can check?

notro commented 2 years ago

If you disable the config option but doesn't clean the builddir, the driver stays around and you keep getting the error. The buildroot dependency system doesn't detect things like this.

OmidID commented 2 years ago

I did clean before each make run. each time I waited for 1-2 hours.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.