From: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
To: linux-samsung-soc@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org, a.hajda@samsung.com,
inki.dae@samsung.com
Subject: Re: [PATCH v2 1/2] drm/exynos: mixer: simplify mixer_cfg_rgb_fmt()
Date: Wed, 22 Mar 2017 12:18:11 +0100 [thread overview]
Message-ID: <e6a5e1d6-a31b-758b-932d-8e2114114cdd@math.uni-bielefeld.de> (raw)
In-Reply-To: <1489152617-10425-1-git-send-email-tjakobi@math.uni-bielefeld.de>
Gentle ping.
- Tobias
Tobias Jakobi wrote:
> Convert if-statements to switch statement. Removes
> duplicated code.
>
> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
> ---
> drivers/gpu/drm/exynos/exynos_mixer.c | 30 ++++++++----------------------
> 1 file changed, 8 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index 72143ac..41d0c36 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -382,29 +382,14 @@ static void mixer_cfg_rgb_fmt(struct mixer_context *ctx, unsigned int height)
> struct mixer_resources *res = &ctx->mixer_res;
> u32 val;
>
> - if (height == 480) {
> + switch (height) {
> + case 480:
> + case 576:
> val = MXR_CFG_RGB601_0_255;
> - } else if (height == 576) {
> - val = MXR_CFG_RGB601_0_255;
> - } else if (height == 720) {
> - val = MXR_CFG_RGB709_16_235;
> - mixer_reg_write(res, MXR_CM_COEFF_Y,
> - (1 << 30) | (94 << 20) | (314 << 10) |
> - (32 << 0));
> - mixer_reg_write(res, MXR_CM_COEFF_CB,
> - (972 << 20) | (851 << 10) | (225 << 0));
> - mixer_reg_write(res, MXR_CM_COEFF_CR,
> - (225 << 20) | (820 << 10) | (1004 << 0));
> - } else if (height == 1080) {
> - val = MXR_CFG_RGB709_16_235;
> - mixer_reg_write(res, MXR_CM_COEFF_Y,
> - (1 << 30) | (94 << 20) | (314 << 10) |
> - (32 << 0));
> - mixer_reg_write(res, MXR_CM_COEFF_CB,
> - (972 << 20) | (851 << 10) | (225 << 0));
> - mixer_reg_write(res, MXR_CM_COEFF_CR,
> - (225 << 20) | (820 << 10) | (1004 << 0));
> - } else {
> + break;
> + case 720:
> + case 1080:
> + default:
> val = MXR_CFG_RGB709_16_235;
> mixer_reg_write(res, MXR_CM_COEFF_Y,
> (1 << 30) | (94 << 20) | (314 << 10) |
> @@ -413,6 +398,7 @@ static void mixer_cfg_rgb_fmt(struct mixer_context *ctx, unsigned int height)
> (972 << 20) | (851 << 10) | (225 << 0));
> mixer_reg_write(res, MXR_CM_COEFF_CR,
> (225 << 20) | (820 << 10) | (1004 << 0));
> + break;
> }
>
> mixer_reg_writemask(res, MXR_CFG, val, MXR_CFG_RGB_FMT_MASK);
>
next prev parent reply other threads:[~2017-03-22 11:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-10 13:30 [PATCH v2 1/2] drm/exynos: mixer: simplify mixer_cfg_rgb_fmt() Tobias Jakobi
2017-03-10 13:30 ` [PATCH v2 2/2] drm/exynos: mixer: document YCbCr magic numbers Tobias Jakobi
2017-03-10 13:59 ` Andrzej Hajda
2017-03-22 11:18 ` Tobias Jakobi [this message]
2017-03-29 11:55 ` [PATCH v2 1/2] drm/exynos: mixer: simplify mixer_cfg_rgb_fmt() Tobias Jakobi
2017-04-08 16:22 ` Inki Dae
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=e6a5e1d6-a31b-758b-932d-8e2114114cdd@math.uni-bielefeld.de \
--to=tjakobi@math.uni-bielefeld.de \
--cc=a.hajda@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=inki.dae@samsung.com \
--cc=linux-samsung-soc@vger.kernel.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).