From patchwork Wed Apr 15 15:01:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Jakobi X-Patchwork-Id: 6221191 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E9B1A9F1AC for ; Wed, 15 Apr 2015 15:02:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7E8C1202A1 for ; Wed, 15 Apr 2015 15:02:30 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 12E7D20274 for ; Wed, 15 Apr 2015 15:02:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 697996E09C; Wed, 15 Apr 2015 08:02:23 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.math.uni-bielefeld.de (smtp.math.uni-bielefeld.de [129.70.45.10]) by gabe.freedesktop.org (Postfix) with ESMTP id 4C7C26E09C for ; Wed, 15 Apr 2015 08:02:22 -0700 (PDT) Received: from chidori.math.uni-bielefeld.de (dhcp24-141.math.uni-bielefeld.de [129.70.24.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by smtp.math.uni-bielefeld.de (Postfix) with ESMTPSA id 64E8C601A6; Wed, 15 Apr 2015 17:02:21 +0200 (CEST) From: Tobias Jakobi To: linux-samsung-soc@vger.kernel.org Subject: [RFC 1/6] drm/exynos: mixer: move pixelformat defines Date: Wed, 15 Apr 2015 17:01:55 +0200 Message-Id: <1429110120-7043-2-git-send-email-tjakobi@math.uni-bielefeld.de> X-Mailer: git-send-email 2.0.5 In-Reply-To: <1429110120-7043-1-git-send-email-tjakobi@math.uni-bielefeld.de> References: <1429110120-7043-1-git-send-email-tjakobi@math.uni-bielefeld.de> Cc: Tobias Jakobi , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Tobias Jakobi Reviewed-by: Gustavo Padovan --- 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 */