From: Akash Goel <akash.goel@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org, sourab.gupta@intel.com
Subject: Re: [RFC] drm/i915: Scratch page optimization for blanking buffer
Date: Mon, 05 May 2014 18:23:52 +0530 [thread overview]
Message-ID: <1399294432.4745.32.camel@akashgoe-desktop> (raw)
In-Reply-To: <20140505123922.GB5519@nuc-i3427.alporthouse.com>
On Mon, 2014-05-05 at 13:39 +0100, Chris Wilson wrote:
> On Mon, May 05, 2014 at 06:03:17PM +0530, Akash Goel wrote:
> > On Mon, 2014-05-05 at 12:47 +0100, Chris Wilson wrote:
> > > On Mon, May 05, 2014 at 05:13:18PM +0530, akash.goel@intel.com wrote:
> > > > From: Akash Goel <akash.goel@intel.com>
> > > >
> > > > There is a use case, when user space (display compositor) tries
> > > > to directly flip a fb (without any prior rendering) on primary
> > > > plane. So the backing pages of the object are allocated at page
> > > > flip time only, which takes time. Since, this buffer is supposed to
> > > > serve as a blanking buffer (black colored), we can setup all the GTT entries
> > > > of that blanking buffer with scratch page (which is already zeroed out).
> > > > This saves the time in allocation of real backing physical space for the
> > > > blanking buffer and flushing of CPU cache.
> > >
> > > So what happens with concurrent rendering via the GPU or GTT? And who
> > > said that scratch was blank?
> > >
> > > I wonder if there is a trivial operation in which you could grab the
> > > pages and pull it into the mappable area prior to flipping.
> > > -Chris
> > >
> >
> > Actually we are trying to address a special case here.
> > Sometimes the primary plane has to be kept enabled forcefully, even
> > though there is no real update required on it, whereas the actual update
> > is happening on the sprite plane. In that case a fb (coined as a
> > 'blanking' buffer) is allocated on the fly and page-flipped on primary
> > plane. So the case of concurrent rendering is not applicable here
> >
> > As the blanking buffer is supposed to be black colored and shmem
> > allocated buffer is by default zeroed out, so this buffer is flipped
> > directly.
> >
> > Since in driver we already allocate a scratch page(already zeroed out),
> > which is mapped by all unused GTT entries, we can use this scratch page
> > itself as a backing store for the blanking buffer, instead of allocating
> > real pages for it from shmem.
>
> However, it is a scratch page, not a zero page. You can rely on it
> containing garbage at some point.
Actually the scratch page has been allocated through the alloc_page call
with __GFP_ZERO flag.
page = alloc_page(GFP_KERNEL | GFP_DMA32 | __GFP_ZERO);
So that's why are banking on scratch page to be zeroed out.
> "Kept enabled" so you have a buffer already allocated?
> -Chris
>
Yes the primary plane has to be enabled, even though the updates are
happening only on Sprite plane.
Sorry I am not able to recall the exact use case. I will check with the
Display compositor folks and get back on this.
One reason could be because the 'flip done' notifications are available
only with primary plane.
Best regards
Akash
next prev parent reply other threads:[~2014-05-05 12:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-05 11:43 [RFC] drm/i915: Scratch page optimization for blanking buffer akash.goel
2014-05-05 11:47 ` Chris Wilson
2014-05-05 12:33 ` Akash Goel
2014-05-05 12:39 ` Chris Wilson
2014-05-05 12:53 ` Akash Goel [this message]
2014-05-05 14:07 ` Daniel Vetter
2014-05-07 5:49 ` Akash Goel
2014-05-07 7:39 ` Daniel Vetter
2014-05-07 10:54 ` Daniel Vetter
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=1399294432.4745.32.camel@akashgoe-desktop \
--to=akash.goel@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=sourab.gupta@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox