From: "Wentland, Harry" <Harry.Wentland-5C7GfCeVMHo@public.gmane.org>
To: "Kazlauskas,
Nicholas" <Nicholas.Kazlauskas-5C7GfCeVMHo@public.gmane.org>,
"dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Cc: "daniel.vetter-/w4YWyX8dFk@public.gmane.org"
<daniel.vetter-/w4YWyX8dFk@public.gmane.org>,
"michel-otUistvHUpPR7s880joybQ@public.gmane.org"
<michel-otUistvHUpPR7s880joybQ@public.gmane.org>,
"Olsak, Marek" <Marek.Olsak-5C7GfCeVMHo@public.gmane.org>,
"manasi.d.navare-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org"
<manasi.d.navare-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
"ppaalanen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
<ppaalanen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"Deucher,
Alexander" <Alexander.Deucher-5C7GfCeVMHo@public.gmane.org>,
"Koenig,
Christian" <Christian.Koenig-5C7GfCeVMHo@public.gmane.org>,
"ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org"
<ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Subject: Re: [PATCH v5 1/4] drm: Add vrr_capable property to the drm connector
Date: Thu, 25 Oct 2018 18:05:37 +0000 [thread overview]
Message-ID: <d89ebbfb-ef0a-2a2c-85cc-724293d84abc@amd.com> (raw)
In-Reply-To: <20181012164458.12864-2-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
On 2018-10-12 12:44 p.m., Nicholas Kazlauskas wrote:
> Modern display hardware is capable of supporting variable refresh rates.
> This patch introduces the "vrr_capable" property on the connector to
> allow userspace to query support for variable refresh rates.
>
> Atomic drivers should attach this property to connectors that are
> capable of driving variable refresh rates using
> drm_connector_attach_vrr_capable_property().
>
> The value should be updated based on driver and hardware capabiltiy
> by using drm_connector_set_vrr_capable_property().
>
> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> drivers/gpu/drm/drm_connector.c | 49 +++++++++++++++++++++++++++++++++
> include/drm/drm_connector.h | 15 ++++++++++
> 2 files changed, 64 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index 1e40e5decbe9..f0deeb7298d0 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -1254,6 +1254,37 @@ int drm_mode_create_scaling_mode_property(struct drm_device *dev)
> }
> EXPORT_SYMBOL(drm_mode_create_scaling_mode_property);
>
> +/**
> + * drm_connector_attach_vrr_capable_property - creates the
> + * vrr_capable property
> + * @connector: connector to create the vrr_capable property on.
> + *
> + * This is used by atomic drivers to add support for querying
> + * variable refresh rate capability for a connector.
> + *
> + * Returns:
> + * Zero on success, negative errono on failure.
> + */
> +int drm_connector_attach_vrr_capable_property(
> + struct drm_connector *connector)
> +{
> + struct drm_device *dev = connector->dev;
> + struct drm_property *prop;
> +
> + if (!connector->vrr_capable_property) {
> + prop = drm_property_create_bool(dev, DRM_MODE_PROP_IMMUTABLE,
> + "vrr_capable");
> + if (!prop)
> + return -ENOMEM;
> +
> + connector->vrr_capable_property = prop;
> + drm_object_attach_property(&connector->base, prop, 0);
> + }
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(drm_connector_attach_vrr_capable_property);
> +
> /**
> * drm_connector_attach_scaling_mode_property - attach atomic scaling mode property
> * @connector: connector to attach scaling mode property on.
> @@ -1582,6 +1613,24 @@ void drm_connector_set_link_status_property(struct drm_connector *connector,
> }
> EXPORT_SYMBOL(drm_connector_set_link_status_property);
>
> +/**
> + * drm_connector_set_vrr_capable_property - sets the variable refresh rate
> + * capable property for a connector
> + * @connector: drm connector
> + * @capable: True if the connector is variable refresh rate capable
> + *
> + * Should be used by atomic drivers to update the indicated support for
> + * variable refresh rate over a connector.
> + */
> +void drm_connector_set_vrr_capable_property(
> + struct drm_connector *connector, bool capable)
> +{
> + drm_object_property_set_value(&connector->base,
> + connector->vrr_capable_property,
> + capable);
> +}
> +EXPORT_SYMBOL(drm_connector_set_vrr_capable_property);
> +
> /**
> * drm_connector_init_panel_orientation_property -
> * initialize the connecters panel_orientation property
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 91a877fa00cb..b2263005234a 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -910,6 +910,17 @@ struct drm_connector {
> */
> struct drm_property *scaling_mode_property;
>
> + /**
> + * @vrr_capable_property: Optional property to help userspace
> + * query hardware support for variable refresh rate on a connector.
> + * connector. Drivers can add the property to a connector by
> + * calling drm_connector_attach_vrr_capable_property().
> + *
> + * This should be updated only by calling
> + * drm_connector_set_vrr_capable_property().
> + */
> + struct drm_property *vrr_capable_property;
> +
> /**
> * @content_protection_property: DRM ENUM property for content
> * protection. See drm_connector_attach_content_protection_property().
> @@ -1183,6 +1194,8 @@ int drm_mode_create_scaling_mode_property(struct drm_device *dev);
> int drm_connector_attach_content_type_property(struct drm_connector *dev);
> int drm_connector_attach_scaling_mode_property(struct drm_connector *connector,
> u32 scaling_mode_mask);
> +int drm_connector_attach_vrr_capable_property(
> + struct drm_connector *connector);
> int drm_connector_attach_content_protection_property(
> struct drm_connector *connector);
> int drm_mode_create_aspect_ratio_property(struct drm_device *dev);
> @@ -1199,6 +1212,8 @@ int drm_connector_update_edid_property(struct drm_connector *connector,
> const struct edid *edid);
> void drm_connector_set_link_status_property(struct drm_connector *connector,
> uint64_t link_status);
> +void drm_connector_set_vrr_capable_property(
> + struct drm_connector *connector, bool capable);
> int drm_connector_init_panel_orientation_property(
> struct drm_connector *connector, int width, int height);
>
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2018-10-25 18:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-12 16:44 [PATCH v5 0/4] A DRM API for adaptive sync and variable refresh rate support Nicholas Kazlauskas
2018-10-12 16:44 ` [PATCH v5 1/4] drm: Add vrr_capable property to the drm connector Nicholas Kazlauskas
[not found] ` <20181012164458.12864-2-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
2018-10-25 18:05 ` Wentland, Harry [this message]
2018-10-12 16:44 ` [PATCH v5 2/4] drm: Add vrr_enabled property to drm CRTC Nicholas Kazlauskas
2018-10-13 17:38 ` Christian König
[not found] ` <e1feafbe-2c37-d1ff-8a45-4672b4da1264-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-10-15 9:40 ` Michel Dänzer
[not found] ` <9811fdab-3efe-4701-92e1-0f53b323959d-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-10-15 9:47 ` Christian König
[not found] ` <c9afd2f9-c80c-3147-6458-14e386196fb7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-10-15 10:06 ` Michel Dänzer
[not found] ` <ec5d531d-e91a-ba2f-7e8e-4a875b183e97-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-10-15 10:47 ` Koenig, Christian
2018-10-26 14:27 ` Pekka Paalanen
2018-10-25 18:08 ` Wentland, Harry
2018-10-12 16:44 ` [PATCH v5 3/4] drm: Document variable refresh properties Nicholas Kazlauskas
[not found] ` <20181012164458.12864-4-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
2018-10-25 18:13 ` Wentland, Harry
2018-10-12 16:44 ` [PATCH v5 4/4] drm/amdgpu: Set FreeSync state using drm VRR properties Nicholas Kazlauskas
2018-10-25 18:22 ` Wentland, Harry
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=d89ebbfb-ef0a-2a2c-85cc-724293d84abc@amd.com \
--to=harry.wentland-5c7gfcevmho@public.gmane.org \
--cc=Alexander.Deucher-5C7GfCeVMHo@public.gmane.org \
--cc=Christian.Koenig-5C7GfCeVMHo@public.gmane.org \
--cc=Marek.Olsak-5C7GfCeVMHo@public.gmane.org \
--cc=Nicholas.Kazlauskas-5C7GfCeVMHo@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=daniel.vetter-/w4YWyX8dFk@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=manasi.d.navare-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=michel-otUistvHUpPR7s880joybQ@public.gmane.org \
--cc=ppaalanen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.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