From: Gustavo Padovan <gustavo@padovan.org>
To: Sean Paul <seanpaul@chromium.org>
Cc: rodrigosiqueiramelo@gmail.com,
Haneen Mohammed <hamohammed.sa@gmail.com>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 2/2] drm/vkms: Implement CRC debugfs API
Date: Fri, 3 Aug 2018 15:10:57 -0300 [thread overview]
Message-ID: <20180803181057.GA17770@juma> (raw)
In-Reply-To: <20180803164215.GK20303@art_vandelay>
On Fri, Aug 03, 2018 at 12:42:15PM -0400, Sean Paul wrote:
> On Thu, Aug 02, 2018 at 08:09:51AM -0300, Gustavo Padovan wrote:
> > Hi Haneen,
> >
> > On Thu, Aug 02, 2018 at 04:10:26AM +0300, Haneen Mohammed wrote:
> > > This patch implement the necessary functions to compute and add CRCs
> > > entries:
> > >
> > > - Implement the set_crc_source() callback.
> > > - Compute CRC using crc32 on the visible part of the framebuffer.
> > > - Use ordered workqueue per output to compute and add CRC at the end
> > > of a vblank.
> > > - Use appropriate synchronization methods since the CRC computation must
> > > be atomic wrt the generated vblank event for a given atomic update, by
> > > using spinlock across atomic_begin/atomic_flush to wrap the event
> > > handling code completely and match the flip event with the CRC.
> > >
> > > Since vkms_crc_work_handle() can sleep, spinlock can't be acquired
> > > while accessing vkms_output->primary_crc to compute CRC.
> > > To make sure the data is updated and released without conflict with
> > > the vkms_crc_work_handle(), the work_struct is flushed @crtc_destroy
> > > and the data is updated before scheduling the work handle again, as
> > > follow:
> >
> > I'm not sure I get why this is a spinlock and not a mutex. With the
> > later you are able to sleep. Also, your spinlock held through the whole
> > atomic commit (from the begin to flush) which seems too much time for
> > busy waiting. Or am I missing something here?
>
> I expressed some of the same concerns here:
>
> https://lists.freedesktop.org/archives/dri-devel/2018-July/183584.html
>
> The tl;dr is that the spinlock is required so we can acquire it in the vblank
> hrtimer. It is held across begin/flush to prevent sending vblank eventss until
> the crc has been fully calculated for the frame. More details in the thread,
> ofc.
Sounds good to me!
Gustavo
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-08-03 18:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-02 1:06 [PATCH v2 0/2] drm/vkms: Add CRC support Haneen Mohammed
2018-08-02 1:08 ` [PATCH v2 1/2] drm/vkms: Subclass plane state Haneen Mohammed
2018-08-02 1:10 ` [PATCH v2 2/2] drm/vkms: Implement CRC debugfs API Haneen Mohammed
2018-08-02 11:09 ` Gustavo Padovan
2018-08-03 16:42 ` Sean Paul
2018-08-03 18:10 ` Gustavo Padovan [this message]
2018-08-03 18:55 ` Sean Paul
2018-08-03 16:53 ` Sean Paul
2018-08-03 19:36 ` Haneen Mohammed
2018-08-03 19:41 ` 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=20180803181057.GA17770@juma \
--to=gustavo@padovan.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hamohammed.sa@gmail.com \
--cc=rodrigosiqueiramelo@gmail.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.