sunxi_metadata.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Allwinner SoCs display driver.
  3. *
  4. * Copyright (C) 2016 Allwinner.
  5. *
  6. * This file is licensed under the terms of the GNU General Public
  7. * License version 2. This program is licensed "as is" without any
  8. * warranty of any kind, whether express or implied.
  9. */
  10. #ifndef __SUNXI_METADATA_H__
  11. #define __SUNXI_METADATA_H__
  12. enum {
  13. /* hdr static metadata is available */
  14. SUNXI_METADATA_FLAG_HDR_SATIC_METADATA = 0x00000001,
  15. /* hdr dynamic metadata is available */
  16. SUNXI_METADATA_FLAG_HDR_DYNAMIC_METADATA = 0x00000002,
  17. /* afbc header data is available */
  18. SUNXI_METADATA_FLAG_AFBC_HEADER = 0x00000010,
  19. };
  20. struct afbc_header {
  21. u32 signature;
  22. u16 filehdr_size;
  23. u16 version;
  24. u32 body_size;
  25. u8 ncomponents;
  26. u8 header_layout;
  27. u8 yuv_transform;
  28. u8 block_split;
  29. u8 inputbits[4];
  30. u16 block_width;
  31. u16 block_height;
  32. u16 width;
  33. u16 height;
  34. u8 left_crop;
  35. u8 top_crop;
  36. u16 block_layout;
  37. };
  38. struct display_master_data {
  39. /* display primaries */
  40. u16 display_primaries_x[3];
  41. u16 display_primaries_y[3];
  42. /* white_point */
  43. u16 white_point_x;
  44. u16 white_point_y;
  45. /* max/min display mastering luminance */
  46. u32 max_display_mastering_luminance;
  47. u32 min_display_mastering_luminance;
  48. };
  49. /* static metadata type 1 */
  50. struct hdr_static_metadata {
  51. struct display_master_data disp_master;
  52. u16 maximum_content_light_level;
  53. u16 maximum_frame_average_light_level;
  54. };
  55. /* sunxi video metadata for ve and de */
  56. struct sunxi_metadata {
  57. struct hdr_static_metadata hdr_smetada;
  58. struct afbc_header afbc_head;
  59. };
  60. #endif /* #ifndef __SUNXI_METADATA_H__ */