From: Eric Anholt <eric@anholt.net>
To: Daniel Stone <daniels@collabora.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/vc4: Advertise supported modifiers for planes
Date: Tue, 08 Aug 2017 13:36:19 -0700 [thread overview]
Message-ID: <878titg5ks.fsf@eliezer.anholt.net> (raw)
In-Reply-To: <20170808163731.5922-1-daniels@collabora.com>
[-- Attachment #1.1: Type: text/plain, Size: 2395 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.
>
> v2:
> - Only advertise T_TILED for RGB (Eric)
> - Actually turn on allow_fb_modifiers (Eric)
>
> Signed-off-by: Daniel Stone <daniels@collabora.com>
> ---
> drivers/gpu/drm/vc4/vc4_kms.c | 1 +
> drivers/gpu/drm/vc4/vc4_plane.c | 33 ++++++++++++++++++++++++++++++++-
> 2 files changed, 33 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c
> index 893312e4e2d7..ef82b5de71fd 100644
> --- a/drivers/gpu/drm/vc4/vc4_kms.c
> +++ b/drivers/gpu/drm/vc4/vc4_kms.c
> @@ -224,6 +224,7 @@ int vc4_kms_load(struct drm_device *dev)
> dev->mode_config.funcs = &vc4_mode_funcs;
> dev->mode_config.preferred_depth = 24;
> dev->mode_config.async_page_flip = true;
> + dev->mode_config.allow_fb_modifiers = true;
>
> drm_mode_config_reset(dev);
>
> diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
> index 2968b3ebb895..a21590991490 100644
> --- a/drivers/gpu/drm/vc4/vc4_plane.c
> +++ b/drivers/gpu/drm/vc4/vc4_plane.c
> @@ -863,6 +863,31 @@ vc4_update_plane(struct drm_plane *plane,
> ctx);
> }
>
> +static bool vc4_format_mod_supported(struct drm_plane *plane,
> + uint32_t format,
> + uint64_t modifier)
> +{
> + /* Support T_TILING for RGB formats only. */
> + switch (format) {
> + case DRM_FORMAT_XRGB8888:
> + case DRM_FORMAT_ARGB8888:
> + case DRM_FORMAT_ABGR8888:
> + case DRM_FORMAT_XBGR8888:
> + case DRM_FORMAT_RGB565:
> + case DRM_FORMAT_BGR565:
> + case DRM_FORMAT_ARGB1555:
> + case DRM_FORMAT_XRGB1555:
> + return true;
> + case DRM_FORMAT_YUV422:
> + case DRM_FORMAT_YVU422:
> + case DRM_FORMAT_YUV420:
> + case DRM_FORMAT_YVU420:
> + case DRM_FORMAT_NV12:
> + case DRM_FORMAT_NV16:
> + return (modifier == DRM_FORMAT_MOD_LINEAR);
> + }
> +}
drivers/gpu/drm/vc4/vc4_plane.c: In function ‘vc4_format_mod_supported’:
drivers/gpu/drm/vc4/vc4_plane.c:889:1: warning: control reaches end of non-void function [-Wreturn-type]
}
Can we just replace the ARGB cases with a default case? Or maybe just
drm_format_info(format)->num_planes > 1?
[-- 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
next prev parent reply other threads:[~2017-08-09 16:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-08 16:37 [PATCH v2] drm/vc4: Advertise supported modifiers for planes Daniel Stone
2017-08-08 20:36 ` Eric Anholt [this message]
2017-08-09 16:50 ` Daniel Stone
-- strict thread matches above, loose matches on Subject: below --
2017-08-08 16:44 Daniel Stone
2018-03-05 18:21 ` Eric Anholt
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=878titg5ks.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