[PATCH 2/4] Remove the cacheing of the last scratch PixmapRec

Chris Wilson chris at chris-wilson.co.uk
Mon Jun 6 06:29:55 PDT 2011


On Sun, 05 Jun 2011 22:48:59 -0700, Keith Packard <keithp at keithp.com> wrote:
> On Mon,  6 Jun 2011 06:36:07 +0100, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> 
> > In order for the driver to be notified of when the resource backing the
> > scratch pixmap becomes no longer accessible, it needs to be called on
> > every FreeScratchPixmapHeader(). As we instead maybe cached the
> > PixmapRec (to avoid the free and malloc overhead), this notification
> > went astray, and the driver would fail to insert the correct barriers on
> > the backing resource. That resource would then be reused by the Xserver,
> > leading to rampant memory corruption as the GPU flushed it write caches
> > at some point in the future and overwriting random structures.
> 
> This looks like a good thing to fix, and I'd like to get something into
> 1.11 if possible, but I'd rather not change this much code post RC1. Is
> there a simpler fix you can think of for 1.11 while we pend the more
> invasive change for 1.12?

The critical notification that is missing is the one from
FreeScratchPixmapHeader(). Adding a call to screen->ModifyPixmapHeader
and listening for that in the ddx is sufficient for us to insert the
appropriate barriers.

I think using CreatePixmap(usage_hint=SCRATCH_HEADER) is a better
solution, both from the perspective of the ddx and the core server. As
there are no released drivers that depend upon that notification yet
(otherwise this issue would have been raised earlier), let's fix it in
a single step, at the beginning of the next cycle.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the xorg-devel mailing list