stf_framebuffer.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (C) 2021 StarFive Technology Co., Ltd.
  4. */
  5. #ifndef __STF_FRAMEBUFFER_H__
  6. #define __STF_FRAMEBUFFER_H__
  7. #include <linux/fb.h>
  8. #include <stdbool.h>
  9. #include "common.h"
  10. struct pp_video_mode {
  11. enum COLOR_FORMAT format;
  12. unsigned int height;
  13. unsigned int width;
  14. unsigned int addr;
  15. };
  16. struct pp_mode {
  17. char pp_id;
  18. bool bus_out; /*out to ddr*/
  19. bool fifo_out; /*out to lcdc*/
  20. bool inited;
  21. struct pp_video_mode src;
  22. struct pp_video_mode dst;
  23. };
  24. typedef struct FBParam_t {
  25. int fd;
  26. int stfbc_fd;
  27. struct fb_var_screeninfo vinfo;
  28. struct fb_fix_screeninfo finfo;
  29. uint8_t *screen_buf;
  30. uint32_t screen_size;
  31. int pixformat; // default COLOR_YUV420_NV21
  32. uint32_t width; // default 1920
  33. uint32_t height; // default 1080
  34. uint32_t bpp;
  35. } FBParam_t;
  36. extern void stf_fb_open(FBParam_t *param, char *device_name, char *stfbc_name);
  37. extern void stf_fb_close(FBParam_t *param);
  38. extern void stf_fb_init(FBParam_t *param, uint32_t v4l2_fmt);
  39. extern void stf_fb_uninit(FBParam_t *param);
  40. #endif // __STF_FRAMEBUFFER_H__