g2d_bsp.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * g2d_bsp/g2d_bsp.h
  3. *
  4. * Copyright (c) 2007-2019 Allwinnertech Co., Ltd.
  5. * Author: zhengxiaobin <zhengxiaobin@allwinnertech.com>
  6. *
  7. * This software is licensed under the terms of the GNU General Public
  8. * License version 2, as published by the Free Software Foundation, and
  9. * may be copied, distributed, and modified under those terms.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. */
  17. #ifndef __G2D_BSP_H
  18. #define __G2D_BSP_H
  19. #include <log.h>
  20. #include <stdlib.h>
  21. #include <string.h>
  22. #include <sunxi_hal_common.h>
  23. #include <hal_log.h>
  24. #include "g2d_driver.h"
  25. #include <hal_mem.h>
  26. #define G2D_FINISH_IRQ (1<<8)
  27. #define G2D_ERROR_IRQ (1<<9)
  28. extern __u32 dbg_info;
  29. #define G2D_INFO_MSG(fmt, ...) \
  30. do {\
  31. if (dbg_info)\
  32. hal_log_info("g2d: [%s %d]"fmt, __func__, __LINE__, ##__VA_ARGS__);\
  33. } while (0)
  34. #define G2D_ERR_MSG(fmt, ...) \
  35. do {\
  36. hal_log_err("g2d: [%s %d]"fmt, __func__, __LINE__, ##__VA_ARGS__);\
  37. } while (0)
  38. typedef struct {
  39. unsigned long g2d_base;
  40. } g2d_init_para;
  41. typedef struct {
  42. g2d_init_para init_para;
  43. } g2d_dev_t;
  44. typedef enum {
  45. G2D_RGB2YUV_709,
  46. G2D_YUV2RGB_709,
  47. G2D_RGB2YUV_601,
  48. G2D_YUV2RGB_601,
  49. G2D_RGB2YUV_2020,
  50. G2D_YUV2RGB_2020,
  51. } g2d_csc_sel;
  52. typedef enum {
  53. VSU_FORMAT_YUV422 = 0x00,
  54. VSU_FORMAT_YUV420 = 0x01,
  55. VSU_FORMAT_YUV411 = 0x02,
  56. VSU_FORMAT_RGB = 0x03,
  57. VSU_FORMAT_BUTT = 0x04,
  58. } vsu_pixel_format;
  59. #define VSU_ZOOM0_SIZE 1
  60. #define VSU_ZOOM1_SIZE 8
  61. #define VSU_ZOOM2_SIZE 4
  62. #define VSU_ZOOM3_SIZE 1
  63. #define VSU_ZOOM4_SIZE 1
  64. #define VSU_ZOOM5_SIZE 1
  65. #define VSU_PHASE_NUM 32
  66. #define VSU_PHASE_FRAC_BITWIDTH 19
  67. #define VSU_PHASE_FRAC_REG_SHIFT 1
  68. #define VSU_FB_FRAC_BITWIDTH 32
  69. #define VI_LAYER_NUMBER 1
  70. #define UI_LAYER_NUMBER 3
  71. #endif /* __G2D_BSP_H */