From: djkurtz@chromium.org (Daniel Kurtz)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] drm/exynos/mixer: move format definitions to regs-mixer
Date: Sun, 4 May 2014 23:26:18 +0800 [thread overview]
Message-ID: <1399217181-26442-2-git-send-email-djkurtz@chromium.org> (raw)
In-Reply-To: <1399217181-26442-1-git-send-email-djkurtz@chromium.org>
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 <djkurtz@chromium.org>
---
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 */
--
1.9.1.423.g4596e3a
next prev parent reply other threads:[~2014-05-04 15:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-04 15:26 [PATCH 0/4] drm/exynos/mixer: small cleanups Daniel Kurtz
2014-05-04 15:26 ` Daniel Kurtz [this message]
2014-05-04 15:26 ` [PATCH 2/4] drm/exynos/mixer: use MXR_GRP_SXY_SY Daniel Kurtz
2014-05-07 5:14 ` Seung-Woo Kim
2014-05-07 14:14 ` Daniel Kurtz
2014-05-08 4:33 ` Seung-Woo Kim
2014-05-08 9:21 ` Daniel Kurtz
2014-05-08 11:38 ` Inki Dae
2014-05-04 15:26 ` [PATCH 3/4] drm/exynos/mixer: planes are not disabled by setting dma_addr to zero Daniel Kurtz
2014-05-04 15:26 ` [PATCH 4/4] drm/exynos/mixer: add support for NV21 Daniel Kurtz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1399217181-26442-2-git-send-email-djkurtz@chromium.org \
--to=djkurtz@chromium.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).