All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Foss <robert.foss@collabora.com>
To: Sean Paul <seanpaul@chromium.org>
Cc: dri-devel <dri-devel@lists.freedesktop.org>,
	Adrian Salido <salidoa@google.com>
Subject: Re: [PATCH hwc v2 3/6] drm_hwcomposer: Submit in-fence to DRM
Date: Wed, 27 Sep 2017 20:59:15 +0200	[thread overview]
Message-ID: <1506538755.2462.4.camel@collabora.com> (raw)
In-Reply-To: <CAOw6vbK7swrG3nzFigUg+m0EHx0ZicE779DM+q09+6WZsoEoCg@mail.gmail.com>

Hey Sean,

On Wed, 2017-09-27 at 14:55 -0400, Sean Paul wrote:
> On Wed, Sep 27, 2017 at 7:58 AM, Robert Foss <robert.foss@collabora.c
> om> wrote:
> > Add support for in-fences through the IN_FENCE_FD property. In-
> > fences signal
> > when their associated buffer may be read by DRM/KMS.
> > 
> > Signed-off-by: Robert Foss <robert.foss@collabora.com>
> > ---
> >  drmdisplaycompositor.cpp | 35 ++++++++++++++++-------------------
> >  1 file changed, 16 insertions(+), 19 deletions(-)
> > 
> > diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
> > index bd670cf..71c0451 100644
> > --- a/drmdisplaycompositor.cpp
> > +++ b/drmdisplaycompositor.cpp
> > @@ -529,6 +529,7 @@ int
> > DrmDisplayCompositor::CommitFrame(DrmDisplayComposition
> > *display_comp,
> >      std::vector<size_t> &source_layers =
> > comp_plane.source_layers();
> > 
> >      int fb_id = -1;
> > +    int fence_fd = -1;
> >      DrmHwcRect<int> display_frame;
> >      DrmHwcRect<float> source_crop;
> >      uint64_t rotation = 0;
> > @@ -547,30 +548,12 @@ int
> > DrmDisplayCompositor::CommitFrame(DrmDisplayComposition
> > *display_comp,
> >          break;
> >        }
> >        DrmHwcLayer &layer = layers[source_layers.front()];
> > -      if (!test_only && layer.acquire_fence.get() >= 0) {
> > -        int acquire_fence = layer.acquire_fence.get();
> > -        int total_fence_timeout = 0;
> > -        for (int i = 0; i < kAcquireWaitTries; ++i) {
> > -          int fence_timeout = kAcquireWaitTimeoutMs * (1 << i);
> > -          total_fence_timeout += fence_timeout;
> > -          ret = sync_wait(acquire_fence, fence_timeout);
> > -          if (ret)
> > -            ALOGW("Acquire fence %d wait %d failed (%d). Total
> > time %d",
> > -                  acquire_fence, i, ret, total_fence_timeout);
> > -          else
> > -            break;
> > -        }
> > -        if (ret) {
> > -          ALOGE("Failed to wait for acquire %d/%d", acquire_fence,
> > ret);
> > -          break;
> > -        }
> > -        layer.acquire_fence.Close();
> > -      }
> >        if (!layer.buffer) {
> >          ALOGE("Expected a valid framebuffer for pset");
> >          break;
> >        }
> >        fb_id = layer.buffer->fb_id;
> > +      fence_fd = layer.acquire_fence.get();
> >        display_frame = layer.display_frame;
> >        source_crop = layer.source_crop;
> >        if (layer.blending == DrmHwcBlending::kPreMult)
> > @@ -587,7 +570,21 @@ int
> > DrmDisplayCompositor::CommitFrame(DrmDisplayComposition
> > *display_comp,
> >          rotation |= 1 << DRM_ROTATE_180;
> >        else if (layer.transform & DrmHwcTransform::kRotate270)
> >          rotation |= 1 << DRM_ROTATE_270;
> > +
> > +      if (fence_fd != -1) {
> 
> nit: if (fence_fd < 0)
> 
> With that fixed:
> 
> Reviewed-by: Sean Paul <seanpaul@chromium.org>

Ack.
Submitting a fix in v3 tomorrow.

> 
> > +        int prop_id = plane->in_fence_fd_property().id();
> > +        if (prop_id == 0) {
> > +                ALOGE("Failed to get IN_FENCE_FD property id");
> > +                break;
> > +        }
> > +        ret = drmModeAtomicAddProperty(pset, plane->id(), prop_id,
> > fence_fd);
> > +        if (ret < 0) {
> > +          ALOGE("Failed to add IN_FENCE_FD property to pset: %d",
> > ret);
> > +          break;
> > +        }
> > +      }
> >      }
> > +
> >      // Disable the plane if there's no framebuffer
> >      if (fb_id < 0) {
> >        ret = drmModeAtomicAddProperty(pset, plane->id(),
> > --
> > 2.11.0
> > 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-09-27 18:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-27 11:58 [PATCH hwc v2 0/6] Implement fencing Robert Foss
2017-09-27 11:58 ` [PATCH hwc v2 1/6] drm_hwcomposer: Remove threading Robert Foss
2017-09-27 13:34   ` Emil Velikov
2017-09-27 18:53     ` Robert Foss
2017-09-27 19:14   ` Sean Paul
2017-09-28 16:22     ` Robert Foss
2017-09-28 16:43   ` Chih-Wei Huang
2017-09-28 21:29     ` Rob Herring
2017-09-29  5:49       ` Chih-Wei Huang
2017-09-29  8:44         ` Robert Foss
2017-09-29  9:07           ` Chih-Wei Huang
2017-09-29 13:16             ` Robert Foss
2017-09-27 11:58 ` [PATCH hwc v2 2/6] drm_hwcomposer: Add support for IN_FENCE_FD property to DrmPlane Robert Foss
2017-09-27 19:14   ` Sean Paul
2017-09-27 11:58 ` [PATCH hwc v2 3/6] drm_hwcomposer: Submit in-fence to DRM Robert Foss
2017-09-27 18:55   ` Sean Paul
2017-09-27 18:59     ` Robert Foss [this message]
2018-02-12 22:10     ` Rob Herring
2017-09-27 11:58 ` [PATCH hwc v2 4/6] drm_hwcomposer: Add FENCE_OUT_PTR property to DrmCrtc Robert Foss
2017-09-27 19:15   ` Sean Paul
2017-09-27 11:58 ` [PATCH hwc v2 5/6] drm_hwcomposer: Add GetCrtcCount function Robert Foss
2017-09-27 19:12   ` Sean Paul
2017-09-28 16:21     ` Robert Foss
2017-09-27 11:58 ` [PATCH hwc v2 6/6] drm_hwcomposer: Add out-fence support Robert Foss
2017-09-27 19:11   ` Sean Paul
2017-09-28 16:21     ` 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=1506538755.2462.4.camel@collabora.com \
    --to=robert.foss@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=salidoa@google.com \
    --cc=seanpaul@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.