aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <paul.kocialkowski@bootlin.com>2018-11-23 04:24:53 -0500
committerMaxime Ripard <maxime.ripard@bootlin.com>2018-11-27 03:56:53 -0500
commitb636d3f97d041cbb5e782a29b282c40cbd77c0aa (patch)
treec19f8b3bc9cfb5988dfd77d325f0421ee1487f79
parentae4ba1936ab97c6a2733a243370f303da3c11839 (diff)
drm/sun4i: frontend: Add support for the BGRX8888 input format
This introduces support for the BGRX8888 input format for the frontend, with its associated pixel sequence value definition. Other fields are already configured correctly as they no longer depend on the format's fourcc directly. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20181123092515.2511-22-paul.kocialkowski@bootlin.com
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_frontend.c5
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_frontend.h1
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_layer.c1
3 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_frontend.c b/drivers/gpu/drm/sun4i/sun4i_frontend.c
index a16697b0eac5..a75a74fc225d 100644
--- a/drivers/gpu/drm/sun4i/sun4i_frontend.c
+++ b/drivers/gpu/drm/sun4i/sun4i_frontend.c
@@ -129,6 +129,10 @@ static int sun4i_frontend_drm_format_to_input_mode(uint32_t fmt, u32 *val)
129static int sun4i_frontend_drm_format_to_input_sequence(uint32_t fmt, u32 *val) 129static int sun4i_frontend_drm_format_to_input_sequence(uint32_t fmt, u32 *val)
130{ 130{
131 switch (fmt) { 131 switch (fmt) {
132 case DRM_FORMAT_BGRX8888:
133 *val = SUN4I_FRONTEND_INPUT_FMT_DATA_PS_BGRX;
134 return 0;
135
132 case DRM_FORMAT_XRGB8888: 136 case DRM_FORMAT_XRGB8888:
133 *val = SUN4I_FRONTEND_INPUT_FMT_DATA_PS_XRGB; 137 *val = SUN4I_FRONTEND_INPUT_FMT_DATA_PS_XRGB;
134 return 0; 138 return 0;
@@ -151,6 +155,7 @@ static int sun4i_frontend_drm_format_to_output_fmt(uint32_t fmt, u32 *val)
151} 155}
152 156
153static const uint32_t sun4i_frontend_formats[] = { 157static const uint32_t sun4i_frontend_formats[] = {
158 DRM_FORMAT_BGRX8888,
154 DRM_FORMAT_XRGB8888, 159 DRM_FORMAT_XRGB8888,
155}; 160};
156 161
diff --git a/drivers/gpu/drm/sun4i/sun4i_frontend.h b/drivers/gpu/drm/sun4i/sun4i_frontend.h
index 56bd5a3f9723..2ee1bccf378a 100644
--- a/drivers/gpu/drm/sun4i/sun4i_frontend.h
+++ b/drivers/gpu/drm/sun4i/sun4i_frontend.h
@@ -28,6 +28,7 @@
28#define SUN4I_FRONTEND_INPUT_FMT_REG 0x04c 28#define SUN4I_FRONTEND_INPUT_FMT_REG 0x04c
29#define SUN4I_FRONTEND_INPUT_FMT_DATA_MOD_PACKED (1 << 8) 29#define SUN4I_FRONTEND_INPUT_FMT_DATA_MOD_PACKED (1 << 8)
30#define SUN4I_FRONTEND_INPUT_FMT_DATA_FMT_RGB (5 << 4) 30#define SUN4I_FRONTEND_INPUT_FMT_DATA_FMT_RGB (5 << 4)
31#define SUN4I_FRONTEND_INPUT_FMT_DATA_PS_BGRX 0
31#define SUN4I_FRONTEND_INPUT_FMT_DATA_PS_XRGB 1 32#define SUN4I_FRONTEND_INPUT_FMT_DATA_PS_XRGB 1
32 33
33#define SUN4I_FRONTEND_OUTPUT_FMT_REG 0x05c 34#define SUN4I_FRONTEND_OUTPUT_FMT_REG 0x05c
diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c
index 155933c62f00..29631e0efde3 100644
--- a/drivers/gpu/drm/sun4i/sun4i_layer.c
+++ b/drivers/gpu/drm/sun4i/sun4i_layer.c
@@ -133,6 +133,7 @@ static const uint32_t sun4i_layer_formats[] = {
133 DRM_FORMAT_ARGB8888, 133 DRM_FORMAT_ARGB8888,
134 DRM_FORMAT_ARGB4444, 134 DRM_FORMAT_ARGB4444,
135 DRM_FORMAT_ARGB1555, 135 DRM_FORMAT_ARGB1555,
136 DRM_FORMAT_BGRX8888,
136 DRM_FORMAT_RGBA5551, 137 DRM_FORMAT_RGBA5551,
137 DRM_FORMAT_RGBA4444, 138 DRM_FORMAT_RGBA4444,
138 DRM_FORMAT_RGB888, 139 DRM_FORMAT_RGB888,