aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <paul.kocialkowski@bootlin.com>2018-11-23 04:24:51 -0500
committerMaxime Ripard <maxime.ripard@bootlin.com>2018-11-27 03:55:16 -0500
commitae4ba1936ab97c6a2733a243370f303da3c11839 (patch)
treefbec772699e73a7a731f82f6521412b114e4aeaa
parent9579f9190487cc99ac280beda5da8ba7c3414b92 (diff)
drm/sun4i: frontend: Determine input mode based on the number of planes
Use the number of planes associated with the DRM format to determine the input mode configuration instead of the format iteself. This way, the helper can be used for all packed formats without future changes. 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-20-paul.kocialkowski@bootlin.com
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_frontend.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_frontend.c b/drivers/gpu/drm/sun4i/sun4i_frontend.c
index a305b731b042..a16697b0eac5 100644
--- a/drivers/gpu/drm/sun4i/sun4i_frontend.c
+++ b/drivers/gpu/drm/sun4i/sun4i_frontend.c
@@ -118,14 +118,12 @@ static int sun4i_frontend_drm_format_to_input_fmt(uint32_t fmt, u32 *val)
118 118
119static int sun4i_frontend_drm_format_to_input_mode(uint32_t fmt, u32 *val) 119static int sun4i_frontend_drm_format_to_input_mode(uint32_t fmt, u32 *val)
120{ 120{
121 switch (fmt) { 121 if (drm_format_num_planes(fmt) == 1)
122 case DRM_FORMAT_XRGB8888:
123 *val = SUN4I_FRONTEND_INPUT_FMT_DATA_MOD_PACKED; 122 *val = SUN4I_FRONTEND_INPUT_FMT_DATA_MOD_PACKED;
124 return 0; 123 else
125
126 default:
127 return -EINVAL; 124 return -EINVAL;
128 } 125
126 return 0;
129} 127}
130 128
131static 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)