Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime@cerno.tech>
To: Jernej Skrabec <jernej.skrabec@siol.net>
Cc: airlied@linux.ie, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, wens@csie.org, daniel@ffwll.ch,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 6/7] drm/sun4i: de2: Don't return de2_fmt_info struct
Date: Tue, 25 Feb 2020 09:34:48 +0100	[thread overview]
Message-ID: <20200225083448.6upblnctjjrbarje@gilmour.lan> (raw)
In-Reply-To: <20200224173901.174016-7-jernej.skrabec@siol.net>


[-- Attachment #1.1: Type: text/plain, Size: 1880 bytes --]

Hi,

On Mon, Feb 24, 2020 at 06:39:00PM +0100, Jernej Skrabec wrote:
> Now that de2_fmt_info contains only DRM <-> HW format mapping, it
> doesn't make sense to return pointer to structure when searching by DRM
> format. Rework that to return only HW format instead.
>
> This doesn't make any functional change.
>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
> ---
>  drivers/gpu/drm/sun4i/sun8i_mixer.c    | 15 +++++++++++----
>  drivers/gpu/drm/sun4i/sun8i_mixer.h    |  7 +------
>  drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 10 +++++-----
>  drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 12 ++++++------
>  4 files changed, 23 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c
> index e078ec96de2d..56cc037fd312 100644
> --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
> +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
> @@ -27,6 +27,11 @@
>  #include "sun8i_vi_layer.h"
>  #include "sunxi_engine.h"
>
> +struct de2_fmt_info {
> +	u32	drm_fmt;
> +	u32	de2_fmt;
> +};
> +
>  static const struct de2_fmt_info de2_formats[] = {
>  	{
>  		.drm_fmt = DRM_FORMAT_ARGB8888,
> @@ -230,15 +235,17 @@ static const struct de2_fmt_info de2_formats[] = {
>  	},
>  };
>
> -const struct de2_fmt_info *sun8i_mixer_format_info(u32 format)
> +int sun8i_mixer_drm_format_to_hw(u32 format, u32 *hw_format)
>  {
>  	unsigned int i;
>
>  	for (i = 0; i < ARRAY_SIZE(de2_formats); ++i)
> -		if (de2_formats[i].drm_fmt == format)
> -			return &de2_formats[i];
> +		if (de2_formats[i].drm_fmt == format) {
> +			*hw_format = de2_formats[i].de2_fmt;
> +			return 0;
> +		}
>
> -	return NULL;
> +	return -EINVAL;
>  }

I'm not too sure about that one. It breaks the consistency with the
other functions, and I don't really see a particular benefit to it?

The rest of the series is
Acked-by: Maxime Ripard <mripard@kernel.org>

Maxime

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-02-25  8:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-24 17:38 [PATCH 0/7] drm/sun4i: de2/de3 format fixes and updates Jernej Skrabec
2020-02-24 17:38 ` [PATCH 1/7] drm/sun4i: de2/de3: Remove unsupported VI layer formats Jernej Skrabec
2020-02-24 17:38 ` [PATCH 2/7] drm/sun4i: Add separate DE3 " Jernej Skrabec
2020-02-24 17:38 ` [PATCH 3/7] drm/sun4i: Fix DE2 VI layer format support Jernej Skrabec
2020-02-24 17:38 ` [PATCH 4/7] drm/sun4i: de2: rgb field in de2 format struct is redundant Jernej Skrabec
2020-02-24 17:38 ` [PATCH 5/7] drm/sun4i: de2: csc_mode in de2 format struct is mostly redundant Jernej Skrabec
2020-02-24 17:39 ` [PATCH 6/7] drm/sun4i: de2: Don't return de2_fmt_info struct Jernej Skrabec
2020-02-25  8:34   ` Maxime Ripard [this message]
2020-02-25  8:52     ` Chen-Yu Tsai
2020-02-25 18:50       ` Jernej Škrabec
2020-02-26  3:29         ` Chen-Yu Tsai
2020-02-26 17:25         ` Maxime Ripard
2020-02-24 17:39 ` [PATCH 7/7] drm/sun4i: Sort includes in VI and UI layer code Jernej Skrabec

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=20200225083448.6upblnctjjrbarje@gilmour.lan \
    --to=maxime@cerno.tech \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@siol.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wens@csie.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