dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Padovan <gustavo@padovan.org>
To: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Gustavo Padovan <gustavo.padovan@collabora.com>,
	ML dri-devel <dri-devel@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [RFC 1/7] drm/atomic: initial support for asynchronous plane update
Date: Mon, 10 Apr 2017 11:39:14 +0200	[thread overview]
Message-ID: <20170410093914.GA15861@joana> (raw)
In-Reply-To: <CACvgo523exYmji7T-=-zS5z2bQ0t9ZyDa=8iWwx3baD4z_aFBQ@mail.gmail.com>

Hi Emil,

Thank you for your review!

2017-04-10 Emil Velikov <emil.l.velikov@gmail.com>:

> Hi Gustavo,
> 
> Mostly some documentation suggestions below. Hope that I've not lost
> the plot and they seem ok :-)
> 
> On 10 April 2017 at 01:24, Gustavo Padovan <gustavo@padovan.org> wrote:
> 
> > +static bool drm_atomic_async_check(struct drm_atomic_state *state)
> > +{
> 
> /* FIXME: we support single plane updates for now */
> > +       if (!plane || n_planes != 1)
> > +               return false;
> > +
> 
> > +       if (!funcs->atomic_async_update)
> > +               return false;
> 
> 
> > +void drm_atomic_helper_async_commit(struct drm_device *dev,
> > +                                   struct drm_atomic_state *state)
> > +{
> > +       struct drm_plane *plane;
> > +       struct drm_plane_state *plane_state;
> > +       const struct drm_plane_helper_funcs *funcs;
> > +       int i;
> > +
> > +       for_each_new_plane_in_state(state, plane, plane_state, i) {
> > +               funcs = plane->helper_private;
> > +
> > +               plane->state->src_x = plane_state->src_x;
> > +               plane->state->src_y = plane_state->src_y;
> > +               plane->state->crtc_x = plane_state->crtc_x;
> > +               plane->state->crtc_y = plane_state->crtc_y;
> > +
> > +               if (funcs && funcs->atomic_async_update)
> > +                       funcs->atomic_async_update(plane, plane_state);
> 
> This looks a bit strange. We don't want to change any state if the
> hook is missing right?
> Actually the if will always be true, since we've already validated
> that in drm_atomic_async_check().
> 
> Should we unconditionally call funcs->atomic_async_update()?

That would be much better. I'll do that.

> 
> 
> > @@ -172,6 +174,8 @@ struct drm_atomic_state {
> >         struct drm_device *dev;
> >         bool allow_modeset : 1;
> >         bool legacy_cursor_update : 1;
> > +       bool legacy_set_config : 1;
> Seems unused in this patch. Introduce at a later stage?

Hmm, rebase garbage. :(  Sorry about that.

> 
> 
> > --- a/include/drm/drm_modeset_helper_vtables.h
> > +++ b/include/drm/drm_modeset_helper_vtables.h
> > @@ -1048,6 +1048,53 @@ struct drm_plane_helper_funcs {
> >          */
> >         void (*atomic_disable)(struct drm_plane *plane,
> >                                struct drm_plane_state *old_state);
> > +
> > +       /**
> > +        * @atomic_async_check:
> > +        *
> > +        * Drivers should use this function check if the plane state
> s/use this function check/set this function pointer/
> 
> > +        * can be updated in a async fashion.
> > +        *
> > +        * This hook is called by drm_atomic_async_check() in the process
> > +        * to figure out if an given update can be committed asynchronously,
> s/in the process to figure out if an/to establish if a/ s/,/./
> 
> > +        * that is, if it can jump ahead the state currently queued for
> > +        * update.
> > +        *
> > +        * Check drm_atomic_async_check() to see what is already there
> > +        * to discover potential async updates.
> Remove these two sentences? They don't seem to bring much.
> 
> > +        *
> > +        * RETURNS:
> > +        *
> > +        * Return 0 on success and -EINVAL if the update can't be async.
> s/if the update can't be async/on error/

I don't think that is an error, it just can't be async so the regular 
atomic sync commit will be performed. For async page flip this would be
a show stopper error, but we are not there yet.

> 
> > +        * Error return doesn't mean that the update can't be applied,
> > +        * it just mean that it can't be an async one.
> > +        *
> Any error returned indicates that the update can not be applied in
> asynchronous manner.
> Side-note: suggest who/how to retry synchronously ?

Retry synchronously is the default fallback. Actually it is the
opposite, async is a special shortcut of sync.

Gustavo
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-04-10  9:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10  0:24 [RFC 0/7] drm: asynchronous atomic plane update Gustavo Padovan
2017-04-10  0:24 ` [RFC 1/7] drm/atomic: initial support for asynchronous " Gustavo Padovan
2017-04-10  7:13   ` Emil Velikov
2017-04-10  9:39     ` Gustavo Padovan [this message]
2017-04-10 19:55   ` Eric Anholt
2017-04-11 20:23     ` Daniel Vetter
2017-04-12 18:17       ` Gustavo Padovan
2017-04-21 18:41       ` Gustavo Padovan
2017-05-02  8:10         ` Daniel Vetter
2017-05-02 10:58           ` Daniel Stone
2017-04-10  0:24 ` [RFC 2/7] drm/virtio: support async cursor updates Gustavo Padovan
2017-04-10  0:24 ` [RFC 3/7] drm/i915: update cursors asynchronously through atomic Gustavo Padovan
2017-04-10  0:24 ` [RFC 4/7] drm/i915: remove intel_cursor_plane_funcs Gustavo Padovan
2017-04-10  0:24 ` [RFC 5/7] drm/msm: update cursors asynchronously through atomic Gustavo Padovan
2017-04-10  0:24 ` [RFC 6/7] drm/msm: remove mdp5_cursor_plane_funcs Gustavo Padovan
2017-04-10  0:24 ` [RFC 7/7] drm/vc4: update cursors asynchronously through atomic Gustavo Padovan
2017-04-10 20:06   ` Eric Anholt
2017-04-11 20:27     ` Daniel Vetter
2017-05-18 22:52   ` Robert Foss
2017-05-18 22:55     ` Robert Foss

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=20170410093914.GA15861@joana \
    --to=gustavo@padovan.org \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=gustavo.padovan@collabora.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