From patchwork Sun May 4 15:26:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kurtz X-Patchwork-Id: 4107751 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DF59D9F271 for ; Sun, 4 May 2014 15:29:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 190EC20414 for ; Sun, 4 May 2014 15:29:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EDE6320411 for ; Sun, 4 May 2014 15:29:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WgyJi-0006cb-4E; Sun, 04 May 2014 15:27:02 +0000 Received: from mail-pd0-x22c.google.com ([2607:f8b0:400e:c02::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WgyJd-0006IY-2Q for linux-arm-kernel@lists.infradead.org; Sun, 04 May 2014 15:26:57 +0000 Received: by mail-pd0-f172.google.com with SMTP id g10so7140372pdj.31 for ; Sun, 04 May 2014 08:26:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=N0IvF+BX3+XsD3EAi/ASzv7J6wd/5ZRO5dOwKtVdUTg=; b=PhroUJxVPzEzv+7GX1ZCGTP+/vw6ePbzzN1ZGgQjACNU3SXLTrr/FvgnNYmj6PvwlI e1ekL1ttvokjzpToCV3ldrgOk3FBNucCyKOsg++ypmE0yJmjA/Fr5kuEZGELPfAs7Ihf lJHEQKM9lnhzvUdvbWHqd55ULmBbHs8W9ZTHU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=N0IvF+BX3+XsD3EAi/ASzv7J6wd/5ZRO5dOwKtVdUTg=; b=KOsfE5MyaL6Jawy3pdXL7ACQDA0EjTpRvfq6FhY0QLMpVIULCDcxIFm9RYuyaxHVap HeolgmzdO2s9Qli2J6c+yUNIjUqgwBpJCbfbe9njT31SyPu/JQAFwCZFmFVFlhc0+G9K n67U7CT9ygMtwvtYykbbbz04FwT8LvrqMpb2CsviFwbVuXxIiasCGEz9mQc+M402IvKy D6XTFyMjZj/Kybv5ZGx3o5UERvAVpJotQd2/fJf9GUS8YlqIsAHXCrtH9c8R1NL0ZlqV +8mQHPRWONjNqY/HXpBKTvlFTETALpeK6PE7PfmY7K+D6bTeMH7hnbiznbt5vO7e3rT3 +RXg== X-Gm-Message-State: ALoCoQk/n2lW8UqkCBelgJgbiH1+EpiVtWrlNYbApRIMQO9UYXD4E69vkbhoNnOKRe+hLqe7w2y0 X-Received: by 10.67.14.69 with SMTP id fe5mr61065496pad.120.1399217196152; Sun, 04 May 2014 08:26:36 -0700 (PDT) Received: from djkurtzt530-glaptop.hitronhub.home (123-193-41-132.dynamic.kbronet.com.tw. [123.193.41.132]) by mx.google.com with ESMTPSA id ry10sm48005129pab.38.2014.05.04.08.26.32 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 04 May 2014 08:26:35 -0700 (PDT) From: Daniel Kurtz To: Inki Dae , Kukjin Kim Subject: [PATCH 1/4] drm/exynos/mixer: move format definitions to regs-mixer Date: Sun, 4 May 2014 23:26:18 +0800 Message-Id: <1399217181-26442-2-git-send-email-djkurtz@chromium.org> X-Mailer: git-send-email 1.9.1.423.g4596e3a In-Reply-To: <1399217181-26442-1-git-send-email-djkurtz@chromium.org> References: <1399217181-26442-1-git-send-email-djkurtz@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140504_082657_162377_01DD15DB X-CRM114-Status: GOOD ( 11.56 ) X-Spam-Score: -0.1 (/) Cc: linux-samsung-soc@vger.kernel.org, Joonyoung Shim , David Airlie , Seung-Woo Kim , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Kyungmin Park , seanpaul@chromium.org, Daniel Kurtz , marcheu@chromium.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 These constants directly define register values, so move them to the register definition header. Also, the logic used for setting fmt from bpp is either/or, so just use if/else. ** No functional change Signed-off-by: Daniel Kurtz --- drivers/gpu/drm/exynos/exynos_mixer.c | 19 ++++--------------- drivers/gpu/drm/exynos/regs-mixer.h | 4 ++++ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index ce28881..475eb49 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -518,21 +518,10 @@ static void mixer_graph_buffer(struct mixer_context *ctx, int win) win_data = &ctx->win_data[win]; - #define RGB565 4 - #define ARGB1555 5 - #define ARGB4444 6 - #define ARGB8888 7 - - switch (win_data->bpp) { - case 16: - fmt = ARGB4444; - break; - case 32: - fmt = ARGB8888; - break; - default: - fmt = ARGB8888; - } + if (win_data->bpp == 16) + fmt = MXR_GRP_CFG_FORMAT_ARGB4444; + else + fmt = MXR_GRP_CFG_FORMAT_ARGB8888; /* 2x scaling feature */ x_ratio = 0; diff --git a/drivers/gpu/drm/exynos/regs-mixer.h b/drivers/gpu/drm/exynos/regs-mixer.h index 4537026..785a97a 100644 --- a/drivers/gpu/drm/exynos/regs-mixer.h +++ b/drivers/gpu/drm/exynos/regs-mixer.h @@ -114,6 +114,10 @@ #define MXR_GRP_CFG_PIXEL_BLEND_EN (1 << 16) #define MXR_GRP_CFG_FORMAT_VAL(x) MXR_MASK_VAL(x, 11, 8) #define MXR_GRP_CFG_FORMAT_MASK MXR_GRP_CFG_FORMAT_VAL(~0) +#define MXR_GRP_CFG_FORMAT_RGB565 4 +#define MXR_GRP_CFG_FORMAT_ARGB1555 5 +#define MXR_GRP_CFG_FORMAT_ARGB4444 6 +#define MXR_GRP_CFG_FORMAT_ARGB8888 7 #define MXR_GRP_CFG_ALPHA_VAL(x) MXR_MASK_VAL(x, 7, 0) /* bits for MXR_GRAPHICn_WH */