From: Eric Anholt <eric@anholt.net>
To: Daniel Stone <daniels@collabora.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/vc4: Advertise supported modifiers for planes
Date: Fri, 04 Aug 2017 13:50:07 -0700 [thread overview]
Message-ID: <87wp6jqcqo.fsf@eliezer.anholt.net> (raw)
In-Reply-To: <20170803140359.18379-1-daniels@collabora.com>
[-- Attachment #1.1: Type: text/plain, Size: 1394 bytes --]
Daniel Stone <daniels@collabora.com> writes:
> The IN_FORMATS blob allows the kernel to advertise to userspace which
> format/modifier combinations are supported, per plane. Use this to
> advertise that we support both T_TILED and linear.
>
> Signed-off-by: Daniel Stone <daniels@collabora.com>
> ---
> drivers/gpu/drm/vc4/vc4_plane.c | 22 +++++++++++++++++++++-
> 1 file changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
> index 2968b3ebb895..554325117a4e 100644
> --- a/drivers/gpu/drm/vc4/vc4_plane.c
> +++ b/drivers/gpu/drm/vc4/vc4_plane.c
> @@ -863,6 +863,20 @@ vc4_update_plane(struct drm_plane *plane,
> ctx);
> }
>
> +static bool vc4_format_mod_supported(struct drm_plane *plane,
> + uint32_t format,
> + uint64_t modifier)
> +{
> + /* This is easy: both tiled and linear are supported for all formats. */
> + switch (modifier) {
> + case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED:
> + case DRM_FORMAT_MOD_LINEAR:
> + return true;
> + default:
> + return false;
> + }
> +}
If this is being used for userspace to decide what modifiers it might
want to use for the format, we should disable T_TILED for multi-plane
formats.
However, it also looks like this won't be called unless
dev->mode_config.allow_fb_modifiers, which we should also set.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2017-08-04 20:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-03 14:03 [PATCH] drm/vc4: Advertise supported modifiers for planes Daniel Stone
2017-08-04 20:50 ` Eric Anholt [this message]
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=87wp6jqcqo.fsf@eliezer.anholt.net \
--to=eric@anholt.net \
--cc=daniels@collabora.com \
--cc=dri-devel@lists.freedesktop.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