From: Daniel Vetter <daniel@ffwll.ch>
To: Rob Clark <robdclark@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 06/13] drm: add atomic hook to read property plus helper
Date: Wed, 17 Dec 2014 15:06:08 +0100 [thread overview]
Message-ID: <20141217140608.GK2711@phenom.ffwll.local> (raw)
In-Reply-To: <20141217140241.GJ2711@phenom.ffwll.local>
On Wed, Dec 17, 2014 at 03:02:41PM +0100, Daniel Vetter wrote:
> On Tue, Dec 16, 2014 at 06:05:34PM -0500, Rob Clark wrote:
> > Once a driver is using atomic helpers for modeset, the next step is to
> > switch over to atomic properties. To do this, plug in the helper
> > function to your modeconfig funcs and be sure to implement the plane/
> > crtc/connector atomic_{get,set}_property vfuncs for any of your mode-
> > objects which have driver custom properties.
> >
> > Signed-off-by: Rob Clark <robdclark@gmail.com>
> > ---
> > drivers/gpu/drm/drm_atomic_helper.c | 46 +++++++++++++++++++++++++++++++++++++
> > drivers/gpu/drm/drm_crtc.c | 9 ++++++++
> > include/drm/drm_atomic_helper.h | 2 ++
> > include/drm/drm_crtc.h | 3 +++
> > 4 files changed, 60 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> > index d42fdb1..1a1ab34 100644
> > --- a/drivers/gpu/drm/drm_atomic_helper.c
> > +++ b/drivers/gpu/drm/drm_atomic_helper.c
> > @@ -1703,6 +1703,52 @@ backoff:
> > EXPORT_SYMBOL(drm_atomic_helper_connector_set_property);
> >
> > /**
> > + * drm_atomic_helper_get_property - helper to read atomic property
> > + * @obj: drm mode object whose property to read
> > + * @property: the property to read
> > + * @val: the read value, returned by reference
> > + *
> > + * RETURNS:
> > + * Zero on success, error code on failure
> > + */
> > +int drm_atomic_helper_get_property(struct drm_mode_object *obj,
> > + struct drm_property *property, uint64_t *val)
> > +{
> > + struct drm_device *dev = property->dev;
> > + int ret;
> > +
> > + switch (obj->type) {
> > + case DRM_MODE_OBJECT_CONNECTOR: {
> > + struct drm_connector *connector = obj_to_connector(obj);
> > + WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
> > + ret = connector->funcs->atomic_get_property(connector,
> > + connector->state, property, val);
>
> Shouldn't we use the get helpers introduced in previous patches here? For
> legacy support we definitely want old core stuff like dpms to keep
> working. Of course that means all the new atomic properties won't get
> magically filtered out. But I think we need to hide them explicitly
> anyway, e.g. with a new DRM_MODE_PROP_ATOMIC and checking for that in
> legacy paths.
Also I'm not sure if there's a benefit to make this a vfunc+helper instead
of just core code called unconditionally. Meaning I can't think of any
case where drivers want to overwrite this, ever. They can do all the fancy
they want for their private properties in the per-object hooks. And for
core/shared stuff we better not allow them to play with fire.
Or do I miss an important case here?
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2014-12-17 14:05 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-16 23:05 [PATCH 00/13] Atomic Properties Rob Clark
2014-12-16 23:05 ` [PATCH 01/13] drm: allow property validation for refcnted props Rob Clark
2014-12-17 12:31 ` Daniel Vetter
2014-12-16 23:05 ` [PATCH 02/13] drm: store property instead of id in obj attachment Rob Clark
2014-12-17 13:29 ` Daniel Vetter
2014-12-16 23:05 ` [PATCH 03/13] drm: get rid of direct property value access Rob Clark
2014-12-17 13:37 ` Daniel Vetter
2014-12-16 23:05 ` [PATCH 04/13] drm: add atomic_set_property wrappers Rob Clark
2014-12-17 12:49 ` Sean Paul
2014-12-17 13:43 ` Daniel Vetter
2014-12-16 23:05 ` [PATCH 05/13] drm: add atomic_get_property Rob Clark
2014-12-17 12:52 ` Sean Paul
2014-12-17 13:54 ` Daniel Vetter
2014-12-16 23:05 ` [PATCH 06/13] drm: add atomic hook to read property plus helper Rob Clark
2014-12-17 14:02 ` Daniel Vetter
2014-12-17 14:06 ` Daniel Vetter [this message]
2014-12-17 14:15 ` Rob Clark
2014-12-17 14:29 ` Daniel Vetter
2014-12-17 14:12 ` Rob Clark
2014-12-17 14:32 ` Daniel Vetter
2014-12-16 23:05 ` [PATCH 07/13] drm: small property creation cleanup Rob Clark
2014-12-17 14:13 ` Daniel Vetter
2014-12-16 23:05 ` [PATCH 08/13] drm: tweak getconnector locking Rob Clark
2014-12-17 14:14 ` Daniel Vetter
2014-12-16 23:05 ` [PATCH 09/13] drm/atomic: atomic_check functions Rob Clark
2014-12-17 14:25 ` Daniel Vetter
2014-12-16 23:05 ` [PATCH 10/13] drm/atomic: atomic plane properties Rob Clark
2014-12-17 14:41 ` Daniel Vetter
2014-12-16 23:05 ` [PATCH 11/13] drm/atomic: atomic connector properties Rob Clark
2014-12-17 14:48 ` Daniel Vetter
2014-12-16 23:05 ` [PATCH 12/13] drm/msm: atomic property support Rob Clark
2014-12-16 23:05 ` [PATCH 13/13] RFC: drm: Atomic modeset ioctl Rob Clark
2014-12-17 2:48 ` Michel Dänzer
2014-12-17 7:20 ` Pekka Paalanen
2014-12-17 9:31 ` Michel Dänzer
2014-12-17 11:18 ` Daniel Vetter
2014-12-19 3:29 ` Michel Dänzer
2014-12-19 7:55 ` Daniel Vetter
2014-12-17 14:04 ` Rob Clark
2014-12-17 15:04 ` Daniel Vetter
2014-12-17 13:08 ` [PATCH 00/13] Atomic Properties 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=20141217140608.GK2711@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=robdclark@gmail.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