All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Hans de Goede <hdegoede@redhat.com>
Cc: devel@driverdev.osuosl.org,
	Michael Thayer <michael.thayer@oracle.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/4] staging: vboxvideo: Fix modeset / page_flip error handling
Date: Wed, 12 Sep 2018 10:20:38 +0200	[thread overview]
Message-ID: <20180912082038.GA23569@kroah.com> (raw)
In-Reply-To: <91870c2f-4a09-f942-6717-37527f0519c3@redhat.com>

On Wed, Sep 12, 2018 at 09:54:51AM +0200, Hans de Goede wrote:
> Hi,
> 
> On 11-09-18 20:46, Greg Kroah-Hartman wrote:
> > On Tue, Sep 11, 2018 at 09:15:41AM +0200, Hans de Goede wrote:
> > > The default settings for Linux vms created in VirtualBox allocate only
> > > 16M of videomem. When running fullscreen on a 1920x1080 (or bigger) monitor
> > > this is not a lot.
> > > 
> > > When using GNOME3 on Wayland we have already been seeing out of video
> > > memory errors for a while now. After commit 2408898e3b6c ("staging:
> > > vboxvideo: Add page-flip support") this has become much worse as now
> > > multiple buffers are used.
> > > 
> > > There is nothing we can do about there not being enough video-mem, but
> > > we should handle running out of video-mem properly, currently there are
> > > 2 problems with this:
> > > 
> > > 1) vbox_crtc_mode_set() does not check if vbox_crtc_mode_set_base() fails
> > > at all and does not properly propagate the oom error.
> > > 
> > > 2) vbox_crtc_do_set_base() unpins the old fb too soon:
> > > 
> > > 2.1) It unpins it before pinning the new fb, so if the pinning of the new
> > > fb fails (which it will when we run out of video-mem), then we also cannot
> > > fall back to the old-fb as it has been already unpinned. We could try to
> > > re-pin it but there is no guarantee that will succeed.
> > > 
> > > 2.2) It unpins it before reprogramming the hardware to scan out from the
> > > new-fb, which could lead to some ugliness where the hw is scanning out the
> > > oldfb while it is being replaced with something else.
> > > 
> > > Fixing this requires to do things in this order:
> > > 1) Pin the new fb
> > > 2) Program the hw
> > > 3) Unpin the oldfb
> > > 
> > > This needs to be done for both a mode_set and for a page_flip so this
> > > commit re-writes vbox_crtc_do_set_base() into vbox_crtc_set_base_and_mode()
> > > which does this in the correct order, putting the hardware programming
> > > which was duplicated between the mode_set and page_flip code inside the
> > > new function.
> > > 
> > > Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> > > ---
> > >   drivers/staging/vboxvideo/vbox_mode.c | 121 +++++++++++++-------------
> > >   1 file changed, 62 insertions(+), 59 deletions(-)
> > 
> > This doesn't apply to my tree.  Does it need to go on top of the
> > previous patches you sent for 4.19-final?
> 
> Yes this goes on top of the fixes for 4.19-final.

Ok, thanks for confirming.

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

      reply	other threads:[~2018-09-12  8:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-11  7:15 [PATCH 1/4] staging: vboxvideo: Fix modeset / page_flip error handling Hans de Goede
2018-09-11  7:15 ` [PATCH 2/4] staging: vboxvideo: Skip currrent crtc when updating crtcs Hans de Goede
2018-09-11  7:15 ` [PATCH 3/4] staging: vboxvideo: Remove vboxfb_create_object() wrapper Hans de Goede
2018-09-11  7:15 ` [PATCH 4/4] staging: vboxvideo: Drop vbox_bo_unref() helper Hans de Goede
2018-09-11 18:46 ` [PATCH 1/4] staging: vboxvideo: Fix modeset / page_flip error handling Greg Kroah-Hartman
2018-09-12  7:54   ` Hans de Goede
2018-09-12  8:20     ` Greg Kroah-Hartman [this message]

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=20180912082038.GA23569@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=michael.thayer@oracle.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.