Commit a63416f3 authored by Neil Armstrong's avatar Neil Armstrong Committed by Greg Kroah-Hartman

drm/meson: Add support for XBGR8888 & ABGR8888 formats

commit 5ffff441 upstream.

Add missing XBGR8888 & ABGR8888 formats variants from the primary plane.

Fixes: bbbe775e ("drm: Add support for Amlogic Meson Graphic Controller")
Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Reviewed-by: default avatarKevin Hilman <khilman@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190429075238.7884-1-narmstrong@baylibre.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d9e8b4ba
...@@ -120,6 +120,13 @@ static void meson_plane_atomic_update(struct drm_plane *plane, ...@@ -120,6 +120,13 @@ static void meson_plane_atomic_update(struct drm_plane *plane,
priv->viu.osd1_blk0_cfg[0] |= OSD_BLK_MODE_32 | priv->viu.osd1_blk0_cfg[0] |= OSD_BLK_MODE_32 |
OSD_COLOR_MATRIX_32_ARGB; OSD_COLOR_MATRIX_32_ARGB;
break; break;
case DRM_FORMAT_XBGR8888:
/* 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_ARGB8888: case DRM_FORMAT_ARGB8888:
/* For ARGB, use the pixel's alpha */ /* For ARGB, use the pixel's alpha */
writel_bits_relaxed(OSD_REPLACE_EN, 0, writel_bits_relaxed(OSD_REPLACE_EN, 0,
...@@ -127,6 +134,13 @@ static void meson_plane_atomic_update(struct drm_plane *plane, ...@@ -127,6 +134,13 @@ static void meson_plane_atomic_update(struct drm_plane *plane,
priv->viu.osd1_blk0_cfg[0] |= OSD_BLK_MODE_32 | priv->viu.osd1_blk0_cfg[0] |= OSD_BLK_MODE_32 |
OSD_COLOR_MATRIX_32_ARGB; OSD_COLOR_MATRIX_32_ARGB;
break; break;
case DRM_FORMAT_ABGR8888:
/* 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: case DRM_FORMAT_RGB888:
priv->viu.osd1_blk0_cfg[0] |= OSD_BLK_MODE_24 | priv->viu.osd1_blk0_cfg[0] |= OSD_BLK_MODE_24 |
OSD_COLOR_MATRIX_24_RGB; OSD_COLOR_MATRIX_24_RGB;
...@@ -196,7 +210,9 @@ static const struct drm_plane_funcs meson_plane_funcs = { ...@@ -196,7 +210,9 @@ static const struct drm_plane_funcs meson_plane_funcs = {
static const uint32_t supported_drm_formats[] = { static const uint32_t supported_drm_formats[] = {
DRM_FORMAT_ARGB8888, DRM_FORMAT_ARGB8888,
DRM_FORMAT_ABGR8888,
DRM_FORMAT_XRGB8888, DRM_FORMAT_XRGB8888,
DRM_FORMAT_XBGR8888,
DRM_FORMAT_RGB888, DRM_FORMAT_RGB888,
DRM_FORMAT_RGB565, DRM_FORMAT_RGB565,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment