All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Stéphane Marchesin" <stephane.marchesin@gmail.com>
To: Pekka Paalanen <ppaalanen@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 6/8] drm/bochs: phase 3: provide a custom ->atomic_commit implementation
Date: Sun, 19 Jul 2015 17:20:32 -0700	[thread overview]
Message-ID: <CACP_E+LDGE7uE0nRJEd3TfxSfF5chHU83_2DRr98k+mYW7ehyw@mail.gmail.com> (raw)
In-Reply-To: <20150717090809.6c9d7d02@gmail.com>

On Thu, Jul 16, 2015 at 11:08 PM, Pekka Paalanen <ppaalanen@gmail.com> wrote:
>
> On Thu, 16 Jul 2015 20:20:39 +0800
> John Hunter <zhjwpku@gmail.com> wrote:
>
> > From: Zhao Junwang <zhjwpku@gmail.com>
> >
> > This supports the asynchronous commits, required for page-flipping
> > Since it's virtual hw it's ok to commit async stuff right away, we
> > never have to wait for vblank.
>
> Hi,
>
> in theory, yes. This is what a patch to bochs implemented not too long
> ago, so AFAIK you are only replicating the existing behaviour.
>
> However, if userspace doing an async commit (or sync, I suppose) does
> not incur any waits in the kernel in e.g. sending the page flip event,
> then flip driven programs (e.g. a Wayland compositor, say, Weston)
> will be running its rendering loop as a busy-loop, because the kernel
> does not throttle it to the (virtual) display refresh rate.
>
> This will cause maximal CPU usage and poor user experience as
> everything else needs to fight for CPU time and event dispatch to get
> through, like input.
>
> I would hope someone could do a follow-up to implement a refresh cycle
> emulation based on a clock. Userspace expects page flips to happen at
> most at refresh rate when asking for vblank-synced flips. It's only
> natural for userspace to drive its rendering loop based on the vblank
> cycle.


I've been asking myself the same question (for the UDL driver) and I'm
not sure if this policy should go in the kernel. After all, there
could be legitimate reasons for user space to render lots of frames
per second. It seems to me that if user space doesn't want too many
fps, it should just throttle itself.

Stéphane


>
>
>
> Thanks,
> pq
>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Signed-off-by: Zhao Junwang <zhjwpku@gmail.com>
> > ---
> >  drivers/gpu/drm/bochs/bochs_mm.c |    9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c
> > index c1d819c..37ac2ca 100644
> > --- a/drivers/gpu/drm/bochs/bochs_mm.c
> > +++ b/drivers/gpu/drm/bochs/bochs_mm.c
> > @@ -545,8 +545,15 @@ bochs_user_framebuffer_create(struct drm_device *dev,
> >       return &bochs_fb->base;
> >  }
> >
> > +static int bochs_atomic_commit(struct drm_device *dev,
> > +                          struct drm_atomic_state *a,
> > +                          bool async)
> > +{
> > +     return drm_atomic_helper_commit(dev, a, false);
> > +}
> > +
> >  const struct drm_mode_config_funcs bochs_mode_funcs = {
> >       .fb_create = bochs_user_framebuffer_create,
> >       .atomic_check = drm_atomic_helper_check,
> > -     .atomic_commit = drm_atomic_helper_commit,
> > +     .atomic_commit = bochs_atomic_commit,
> >  };
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2015-07-20  0:21 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-16 12:20 [PATCH 0/8] drm/bochs: convert bochs to atomic mode-setting John Hunter
2015-07-16 12:20 ` [PATCH 1/8] drm/bochs: phase 1 - use the transitional helpers John Hunter
2015-07-16 15:49   ` Gerd Hoffmann
2015-07-16 18:22     ` Daniel Vetter
2015-07-16 12:20 ` [PATCH 2/8] drm/bochs: phase 2: wire up state reset(), duplicate() and destroy John Hunter
2015-07-16 12:20 ` [PATCH 3/8] drm/bochs: stop looking at legacy state John Hunter
2015-07-16 12:20 ` [PATCH 4/8] drm/bochs: phase 3: for plane updates: switch to atomic helper internally John Hunter
2015-07-16 12:20 ` [PATCH 5/8] drm/bochs: phase 3: use atomic .set_config helper John Hunter
2015-07-16 12:20 ` [PATCH 6/8] drm/bochs: phase 3: provide a custom ->atomic_commit implementation John Hunter
2015-07-17  6:08   ` Pekka Paalanen
2015-07-19 23:56     ` John Hunter
2015-07-20  0:20     ` Stéphane Marchesin [this message]
2015-07-20  7:46       ` Pekka Paalanen
2015-07-20  8:58         ` Stéphane Marchesin
2015-07-20  9:35           ` KMS timings (Re: [PATCH 6/8] drm/bochs: phase 3: provide a custom ->atomic_commit implementation) Pekka Paalanen
2015-07-20 14:21             ` Daniel Vetter
2015-07-20 17:32               ` Stéphane Marchesin
2015-07-21  7:06                 ` Pekka Paalanen
2015-07-21  9:02                   ` Daniel Vetter
2015-07-21 11:22                     ` Pekka Paalanen
2015-07-21 13:47                       ` Daniel Vetter
2015-07-16 12:20 ` [PATCH 7/8] drm/bochs: phase 3: switch to drm_atomic_helper_page_flip John Hunter
2015-07-16 12:20 ` [PATCH 8/8] drm/bochs: atomic dpms support John Hunter
2016-03-02 10:13 ` [PATCH 0/8] drm/bochs: convert bochs to atomic mode-setting Emil Velikov
2016-03-02 15:38   ` Gerd Hoffmann
2016-03-02 18:02     ` Emil Velikov
2016-03-03  9:28       ` Gerd Hoffmann
2016-03-04  8:31         ` John Hunter
2016-03-04 14:05         ` Emil Velikov
2016-03-07  9:34           ` Gerd Hoffmann

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=CACP_E+LDGE7uE0nRJEd3TfxSfF5chHU83_2DRr98k+mYW7ehyw@mail.gmail.com \
    --to=stephane.marchesin@gmail.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ppaalanen@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 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.