tegra_drm_nvdc.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. #ifndef _TEGRA_DRM_NVDC_H_
  23. #define _TEGRA_DRM_NVDC_H_
  24. #define fourcc_code_tegra(a,b,c,d) ((__u32)(a) | ((__u32)(b) << 8) | \
  25. ((__u32)(c) << 16) | ((__u32)(d) << 24))
  26. /*
  27. * 2 plane YCrCb, 10 bits per channel
  28. * index 0 = Y plane, [15:0] Y
  29. * index 1 = Cr:Cb plane, [31:0] Cr:Cb
  30. *
  31. * Pixel packing:
  32. *
  33. * Y plane
  34. * MS-Byte LS-Byte
  35. * Y9Y8Y7Y6Y5Y4Y3Y2 | Y1Y0XXXXXX
  36. *
  37. * UV plane
  38. * MS-Byte LS-Byte
  39. * V9V8V7V6V5V4V3V2 | V1V0XXXXXX | U9U8U7U6U5U4U3U2 | U1U0XXXXXX
  40. */
  41. #define DRM_FORMAT_TEGRA_P010_709 fourcc_code_tegra('H', 'D', '0', '1') /* 2x2 subsampled Cr:Cb plane BT.709 */
  42. #define DRM_FORMAT_TEGRA_P010_2020 fourcc_code_tegra('U', 'H', 'D', '0') /* 2x2 subsampled Cr:Cb plane BT.2020 */
  43. struct drm_tegra_hdr_metadata_smpte_2086 {
  44. // idx 0 : G, 1 : B, 2 : R
  45. __u16 display_primaries_x[3]; // normalized x chromaticity cordinate. It shall be in the range of 0 to 50000
  46. __u16 display_primaries_y[3]; // normalized y chromaticity cordinate. It shall be in the range of 0 to 50000
  47. __u16 white_point_x; // normalized x chromaticity cordinate of white point of mastering display
  48. __u16 white_point_y; // normalized y chromaticity cordinate of white point of mastering display
  49. __u32 max_display_parameter_luminance; // nominal maximum display luminance in units of 0.0001 candelas per square metre
  50. __u32 min_display_parameter_luminance; // nominal minimum display luminance in units of 0.0001 candelas per square metre
  51. };
  52. #endif