From: Sam Ravnborg <sam@ravnborg.org>
To: "Michel Dänzer" <michel@daenzer.net>
Cc: Thomas Hellstrom <thellstrom@vmware.com>,
Kevin Brace <kevinbrace@gmx.com>, David Airlie <airlied@linux.ie>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
openchrome-devel@lists.freedesktop.org,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
dri-devel@lists.freedesktop.org,
Mike Marshall <hubcap@omnibond.com>,
Ira Weiny <ira.weiny@intel.com>,
Emil Velikov <emil.velikov@collabora.com>
Subject: Re: [PATCH/RFT v1 0/6] drm/via: drop use of deprecated headers drmP.h and drm_os_linux.h
Date: Fri, 19 Jul 2019 13:32:12 +0200 [thread overview]
Message-ID: <20190719113212.GC3247@ravnborg.org> (raw)
In-Reply-To: <e2a3b772-96e7-0fed-d269-bb103057cafe@daenzer.net>
Hi Michael.
On Fri, Jul 19, 2019 at 11:05:44AM +0200, Michel Dänzer wrote:
> On 2019-07-19 8:07 a.m., Sam Ravnborg wrote:
> > On Thu, Jul 18, 2019 at 05:37:31PM +0200, Sam Ravnborg wrote:
> >> This is some janitorial updates to the via driver
> >> that is required to get rid of deprecated headers
> >> in the drm subsystem.
> >>
> >> The first three patches are trivial, where
> >> the dependencies on drmP.h and drm_os_linux are dropped.
> >>
> >> The remaining three patches drop use of DRM_WAIT_ON().
> >> They are replaced by wait_event_interruptible_timeout().
> >> These patches could use a more critical review.
> >
> > The differences between DRM_WAIT_ON() and
> > wait_event_interruptible_timeout() are bigger than anticipated.
> >
> > The conversion I did for drm_vblank.c is bogus thus I expect
> > the conversion done for via is also bogus.
>
> What exactly is the problem though? Can you share information about the
> failures you're seeing?
>
> There was some discussion about DRM_WAIT_ON() "polling" on IRC. I assume
> that refers to it only sleeping for up to 0.01s before checking the
> condition again. In contrast, wait_event_interruptible_timeout() checks
> the condition once, then sleeps up to the full timeout before checking
> it again.
Correct - it was based on the feedback on irc from airlied and ickle
that made me conclude that the via part may not be good.
I cannot say if the polling versus timeout is properly dealt with in the
via driver and I am inclided to just move DRM_WAIT_ON() to via_drv.h and
name it VIA_WAIT_ON().
Then the changes to this legacy driver is minimal and it will not
prevent us from gettting rid of drm_os_linux.h
>
> If that makes a difference for drm_wait_vblank_ioctl, it indicates that
> some other code which updates the vblank count or clears vblank->enabled
> doesn't wake up the vblank->queue.
Let me analyse a little...
In drm_handle_vblank() there is a call to wake_up(&vblank->queue);
And this is called from an interrupt - OK.
drm_vblank_enable() is called outside an interrupt - no need for
wake_up()
drm_crtc_accurate_vblank_count() is called outside interrupt - no need
for wake_up()
drm_vblank_disable_and_save() is called outside interrupt - no need for
wake_up()'
That is all functions I could dig up that updates the vblank counter.
So based on this short analysis I actually start to think that
I can use the variant that uses wait_event_interruptible_timeout()
anyway.
I will post a v3 and await feedback on that version.
As for via - introducing VIA_WAIT_ON() is the simple solution.
So I will post a v2 of this series using VIA_WAIT_ON().
Sam
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-07-19 11:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-18 15:37 [PATCH/RFT v1 0/6] drm/via: drop use of deprecated headers drmP.h and drm_os_linux.h Sam Ravnborg
2019-07-18 15:37 ` [PATCH v1 1/6] drm/via: drop use of DRM(READ|WRITE) macros Sam Ravnborg
2019-07-18 15:37 ` [PATCH v1 2/6] drm/via: make via_drv.h self-contained Sam Ravnborg
2019-07-18 15:37 ` [PATCH v1 3/6] drm/via: drop use of drmP.h Sam Ravnborg
2019-07-18 15:37 ` [PATCH v1 4/6] drm/via: drop DRM_WAIT_ON() in via_dmablit.c Sam Ravnborg
2019-07-18 15:37 ` [PATCH v1 5/6] drm/via: drop DRM_WAIT_ON() in via_irq Sam Ravnborg
2019-07-18 15:37 ` [PATCH v1 6/6] drm/via: drop DRM_WAIT_ON() in via_video Sam Ravnborg
2019-07-19 6:07 ` [PATCH/RFT v1 0/6] drm/via: drop use of deprecated headers drmP.h and drm_os_linux.h Sam Ravnborg
2019-07-19 9:05 ` Michel Dänzer
2019-07-19 9:36 ` Daniel Vetter
2019-07-19 11:32 ` Sam Ravnborg [this message]
2019-07-19 12:37 ` Daniel Vetter
2019-07-19 15:44 ` Michel Dänzer
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=20190719113212.GC3247@ravnborg.org \
--to=sam@ravnborg.org \
--cc=airlied@linux.ie \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=emil.velikov@collabora.com \
--cc=gustavo@embeddedor.com \
--cc=hubcap@omnibond.com \
--cc=ira.weiny@intel.com \
--cc=kevinbrace@gmx.com \
--cc=michel@daenzer.net \
--cc=openchrome-devel@lists.freedesktop.org \
--cc=thellstrom@vmware.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 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.