Re: [PATCH] drm/meson: Add support for XBGR8888 & ABGR8888 formats

2019-06-06 Thread Kevin Hilman
Neil Armstrong  writes:

> Add missing XBGR & ABGR formats variants from the primary plane.
>
> Fixes: bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller")
> Signed-off-by: Neil Armstrong 

Reviewed-by: Kevin Hilman 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/meson: Add support for XBGR8888 & ABGR8888 formats

2019-04-29 Thread Neil Armstrong
Add missing XBGR & ABGR formats variants from the primary plane.

Fixes: bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller")
Signed-off-by: Neil Armstrong 
---
 drivers/gpu/drm/meson/meson_plane.c | 16 
 1 file changed, 16 insertions(+)

diff --git a/drivers/gpu/drm/meson/meson_plane.c 
b/drivers/gpu/drm/meson/meson_plane.c
index bf8f1fab63aa..b8f6b08a89a6 100644
--- a/drivers/gpu/drm/meson/meson_plane.c
+++ b/drivers/gpu/drm/meson/meson_plane.c
@@ -165,6 +165,13 @@ static void meson_plane_atomic_update(struct drm_plane 
*plane,
priv->viu.osd1_blk0_cfg[0] |= OSD_BLK_MODE_32 |
  OSD_COLOR_MATRIX_32_ARGB;
break;
+   case DRM_FORMAT_XBGR:
+   /* For XRGB, replace the pixel's alpha by 0xFF */
+   writel_bits_relaxed(OSD_REPLACE_EN, OSD_REPLACE_EN,
+   priv->io_base + _REG(VIU_OSD1_CTRL_STAT2));
+   priv->viu.osd1_blk0_cfg[0] |= OSD_BLK_MODE_32 |
+ OSD_COLOR_MATRIX_32_ABGR;
+   break;
case DRM_FORMAT_ARGB:
/* For ARGB, use the pixel's alpha */
writel_bits_relaxed(OSD_REPLACE_EN, 0,
@@ -172,6 +179,13 @@ static void meson_plane_atomic_update(struct drm_plane 
*plane,
priv->viu.osd1_blk0_cfg[0] |= OSD_BLK_MODE_32 |
  OSD_COLOR_MATRIX_32_ARGB;
break;
+   case DRM_FORMAT_ABGR:
+   /* For ARGB, use the pixel's alpha */
+   writel_bits_relaxed(OSD_REPLACE_EN, 0,
+   priv->io_base + _REG(VIU_OSD1_CTRL_STAT2));
+   priv->viu.osd1_blk0_cfg[0] |= OSD_BLK_MODE_32 |
+ OSD_COLOR_MATRIX_32_ABGR;
+   break;
case DRM_FORMAT_RGB888:
priv->viu.osd1_blk0_cfg[0] |= OSD_BLK_MODE_24 |
  OSD_COLOR_MATRIX_24_RGB;
@@ -356,7 +370,9 @@ static const struct drm_plane_funcs meson_plane_funcs = {
 
 static const uint32_t supported_drm_formats[] = {
DRM_FORMAT_ARGB,
+   DRM_FORMAT_ABGR,
DRM_FORMAT_XRGB,
+   DRM_FORMAT_XBGR,
DRM_FORMAT_RGB888,
DRM_FORMAT_RGB565,
 };
-- 
2.21.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel