drm_fourcc.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright 2011 Intel Corporation
  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 (including the next
  12. * paragraph) shall be included in all copies or substantial portions of the
  13. * Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  18. * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
  19. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  20. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  21. * OTHER DEALINGS IN THE SOFTWARE.
  22. */
  23. #ifndef DRM_FOURCC_H
  24. #define DRM_FOURCC_H
  25. /*
  26. * We don't use the V4L header because
  27. * 1) the fourcc codes are well defined and trivial to construct
  28. * 2) we don't want user apps to have to pull in v4l headers just for fourcc
  29. * 3) the v4l fourcc codes are mixed up with a bunch of other code and are
  30. * part of the v4l API, so changing them to something linux-generic isn't
  31. * feasible
  32. *
  33. * So the below includes the fourcc codes used by the DRM and its drivers,
  34. * along with potential device specific codes.
  35. */
  36. #include <linux/types.h>
  37. #define fourcc_code(a,b,c,d) ((u32)(a) | ((u32)(b) << 8) | \
  38. ((u32)(c) << 16) | ((u32)(d) << 24))
  39. /* RGB codes */
  40. #define DRM_FOURCC_RGB332 fourcc_code('R','G','B','1')
  41. #define DRM_FOURCC_RGB555 fourcc_code('R','G','B','O')
  42. #define DRM_FOURCC_RGB565 fourcc_code('R','G','B','P')
  43. #define DRM_FOURCC_RGB24 fourcc_code('R','G','B','3')
  44. #define DRM_FOURCC_RGB32 fourcc_code('R','G','B','4')
  45. #define DRM_FOURCC_BGR24 fourcc_code('B','G','R','3')
  46. #define DRM_FOURCC_BGR32 fourcc_code('B','G','R','4')
  47. /* YUV codes */
  48. #define DRM_FOURCC_YUYV fourcc_code('Y', 'U', 'Y', 'V')
  49. #define DRM_FOURCC_YVYU fourcc_code('Y', 'V', 'Y', 'U')
  50. #define DRM_FOURCC_UYVY fourcc_code('U', 'Y', 'V', 'Y')
  51. #define DRM_FOURCC_VYUY fourcc_code('V', 'Y', 'U', 'Y')
  52. /* DRM specific codes */
  53. #define DRM_INTEL_RGB30 fourcc_code('R','G','B','0') /* RGB x:10:10:10 */
  54. #endif /* DRM_FOURCC_H */