dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Paul <sean@poorly.run>
To: Fritz Koenig <frkoenig@google.com>
Cc: sean@poorly.run, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/5] drm/msm/dpu: Plane helper for modifiers
Date: Wed, 12 Dec 2018 11:11:36 -0500	[thread overview]
Message-ID: <20181212161136.GH154160@art_vandelay> (raw)
In-Reply-To: <20181211184224.131478-3-frkoenig@google.com>

On Tue, Dec 11, 2018 at 10:42:22AM -0800, Fritz Koenig wrote:
> Filter planes based on the supported modifiers
> 
> Signed-off-by: Fritz Koenig <frkoenig@google.com>

Reviewed-by: Sean Paul <sean@poorly.run>

> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> index 6a49c253bbdc..9381c8af76d7 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> @@ -1410,6 +1410,23 @@ static void dpu_plane_early_unregister(struct drm_plane *plane)
>  	debugfs_remove_recursive(pdpu->debugfs_root);
>  }
>  
> +static bool dpu_plane_format_mod_supported(struct drm_plane *plane,
> +		uint32_t format, uint64_t modifier)
> +{
> +	if (modifier == DRM_FORMAT_MOD_LINEAR)
> +		return true;
> +
> +	if (modifier == DRM_FORMAT_MOD_QCOM_COMPRESSED) {
> +		int i;
> +		for (i = 0; i < ARRAY_SIZE(qcom_compressed_supported_formats); i++) {
> +			if (format == qcom_compressed_supported_formats[i])
> +				return true;
> +		}
> +	}
> +
> +	return false;

nit: You could have removed the top conditional and just do
        return modifier == DRM_FORMAT_MOD_LINEAR; 
     here, but this is cool too.

> +}
> +
>  static const struct drm_plane_funcs dpu_plane_funcs = {
>  		.update_plane = drm_atomic_helper_update_plane,
>  		.disable_plane = drm_atomic_helper_disable_plane,
> @@ -1419,6 +1436,7 @@ static const struct drm_plane_funcs dpu_plane_funcs = {
>  		.atomic_destroy_state = dpu_plane_destroy_state,
>  		.late_register = dpu_plane_late_register,
>  		.early_unregister = dpu_plane_early_unregister,
> +		.format_mod_supported = dpu_plane_format_mod_supported,
>  };
>  
>  static const struct drm_plane_helper_funcs dpu_plane_helper_funcs = {
> -- 
> 2.20.0.rc2.403.gdbc3b29805-goog
> 

-- 
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-12-12 16:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11 18:42 [PATCH 1/5] drm/msm/dpu: Remove unused format tables Fritz Koenig
2018-12-11 18:42 ` [PATCH 2/5] drm/msm/dpu: Use simple list for plane format init Fritz Koenig
2018-12-12 16:08   ` Sean Paul
2018-12-11 18:42 ` [PATCH 3/5] drm/msm/dpu: Plane helper for modifiers Fritz Koenig
2018-12-12 16:11   ` Sean Paul [this message]
2018-12-11 18:42 ` [PATCH 4/5] drm/msm/dpu: Initialize supported modifiers Fritz Koenig
2018-12-12 16:12   ` Sean Paul
2018-12-12 18:02     ` Fritz Koenig
2018-12-12 20:35       ` Sean Paul
2018-12-11 18:42 ` [PATCH 5/5] drm/msm/dpu: Correct initialization of modifiers Fritz Koenig
2018-12-12 16:13   ` Sean Paul
2018-12-12 16:05 ` [PATCH 1/5] drm/msm/dpu: Remove unused format tables Sean Paul

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=20181212161136.GH154160@art_vandelay \
    --to=sean@poorly.run \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=frkoenig@google.com \
    /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