[PATCH v2 1/2] drm/exynos: mixer: move pixelformat defines

Tobias Jakobi tjakobi at math.uni-bielefeld.de
Wed Apr 15 12:54:51 PDT 2015


Move the defines for the pixelformats that the mixer supports out
of mixer_graph_buffer() to the top of the source.
Also add handling of RGB565 and exit if the pixelformat is not
supported.

Reviewed-by: Gustavo Padovan <gustavo.padovan at collabora.co.uk>
Signed-off-by: Tobias Jakobi <tjakobi at math.uni-bielefeld.de>
---
 drivers/gpu/drm/exynos/exynos_mixer.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 3e07f04..9c398d5 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -44,6 +44,11 @@
 #define MIXER_WIN_NR		3
 #define MIXER_DEFAULT_WIN	0
 
+#define MIXER_PIXELFORMAT_RGB565 4
+#define MIXER_PIXELFORMAT_ARGB1555 5
+#define MIXER_PIXELFORMAT_ARGB4444 6
+#define MIXER_PIXELFORMAT_ARGB8888 7
+
 struct mixer_resources {
 	int			irq;
 	void __iomem		*mixer_regs;
@@ -536,31 +541,30 @@ static void mixer_graph_buffer(struct mixer_context *ctx, int win)
 
 	plane = &ctx->planes[win];
 
-	#define RGB565 4
-	#define ARGB1555 5
-	#define ARGB4444 6
-	#define ARGB8888 7
-
 	switch (plane->pixel_format) {
 	case DRM_FORMAT_ARGB4444:
-		fmt = ARGB4444;
+		fmt = MIXER_PIXELFORMAT_ARGB4444;
 		blend = 1;
 		break;
 
 	case DRM_FORMAT_ARGB8888:
-		fmt = ARGB8888;
+		fmt = MIXER_PIXELFORMAT_ARGB8888;
 		blend = 1;
 		break;
 
 	case DRM_FORMAT_XRGB8888:
-		fmt = ARGB8888;
+		fmt = MIXER_PIXELFORMAT_ARGB8888;
 		blend = 0;
 		break;
 
-	default:
-		fmt = ARGB8888;
+	case DRM_FORMAT_RGB565:
+		fmt = MIXER_PIXELFORMAT_RGB565;
 		blend = 0;
 		break;
+
+	default:
+		DRM_DEBUG_KMS("pixelformat unsupported by mixer\n");
+		return;
 	}
 
 	/* check if mixer supports requested scaling setup */
-- 
2.0.5



More information about the dri-devel mailing list