0453-drm-vc4-enable-XBGR8888-and-ABGR8888-pixel-formats.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. From 6771102fcd8bf6a7e1638807b78f35df4fece9a6 Mon Sep 17 00:00:00 2001
  2. From: Rob Herring <robh@kernel.org>
  3. Date: Thu, 9 Jun 2016 16:19:25 -0500
  4. Subject: [PATCH] drm: vc4: enable XBGR8888 and ABGR8888 pixel formats
  5. DRM_FORMAT_XBGR8888 and DRM_FORMAT_ABGR8888 are 2 of the native formats
  6. used in Android, so enable them for VC4. There seems to be no logic behind
  7. HVS_PIXEL_ORDER_xxxx naming, but HVS_PIXEL_ORDER_ARGB seems to work
  8. correctly.
  9. Signed-off-by: Rob Herring <robh@kernel.org>
  10. Reviewed-by: Eric Anholt <eric@anholt.net>
  11. (cherry picked from commit 93977767f092fbf0787e5d2a0bf2e0a3fc6f6ced)
  12. ---
  13. drivers/gpu/drm/vc4/vc4_plane.c | 8 ++++++++
  14. 1 file changed, 8 insertions(+)
  15. --- a/drivers/gpu/drm/vc4/vc4_plane.c
  16. +++ b/drivers/gpu/drm/vc4/vc4_plane.c
  17. @@ -94,6 +94,14 @@ static const struct hvs_format {
  18. .pixel_order = HVS_PIXEL_ORDER_ABGR, .has_alpha = true,
  19. },
  20. {
  21. + .drm = DRM_FORMAT_ABGR8888, .hvs = HVS_PIXEL_FORMAT_RGBA8888,
  22. + .pixel_order = HVS_PIXEL_ORDER_ARGB, .has_alpha = true,
  23. + },
  24. + {
  25. + .drm = DRM_FORMAT_XBGR8888, .hvs = HVS_PIXEL_FORMAT_RGBA8888,
  26. + .pixel_order = HVS_PIXEL_ORDER_ARGB, .has_alpha = false,
  27. + },
  28. + {
  29. .drm = DRM_FORMAT_RGB565, .hvs = HVS_PIXEL_FORMAT_RGB565,
  30. .pixel_order = HVS_PIXEL_ORDER_XRGB, .has_alpha = false,
  31. },