[PATCH 2/2] exa/mixed: avoid copying back pixmap data when no migration took place

Michel Dänzer michel at daenzer.net
Fri Nov 6 01:26:52 PST 2009


On Sun, 2009-11-01 at 23:16 +0100, Maarten Maathuis wrote: 
> On Sun, Nov 1, 2009 at 10:08 PM, Maarten Maathuis <madman2003 at gmail.com> wrote:
> > - This fixes strange corruption i have been dealing it.
> > - When the driver handles the prepare access no copying is needed.
> > - Delayed pixmap creation should be fine, because it's handled by the
> >  first prepare access, but the exaPixmapIsOffscreen check in finish access
> >  will return FALSE without a driver pixmap.
> >
> > Signed-off-by: Maarten Maathuis <madman2003 at gmail.com>
> > ---
> >  exa/exa_migration_mixed.c |    5 ++++-
> >  1 files changed, 4 insertions(+), 1 deletions(-)
> >
> > diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
> > index 6065d75..0fbf1b2 100644
> > --- a/exa/exa_migration_mixed.c
> > +++ b/exa/exa_migration_mixed.c
> > @@ -210,7 +210,8 @@ void exaFinishAccess_mixed(PixmapPtr pPixmap, int index)
> >  {
> >     ExaPixmapPriv(pPixmap);
> >
> > -    if (pExaPixmap->pDamage && exaPixmapIsOffscreen(pPixmap)) {
> > +    if (pExaPixmap->pDamage && exaPixmapIsOffscreen(pPixmap) &&
> > +           !pExaPixmap->offscreen) {
> >        DamageRegionProcessPending(&pPixmap->drawable);
> >
> >        if (index == EXA_PREPARE_DEST || index == EXA_PREPARE_AUX_DEST) {
> > @@ -223,5 +224,7 @@ void exaFinishAccess_mixed(PixmapPtr pPixmap, int index)
> >            pPixmap->devKind = pExaPixmap->fb_pitch;
> >        } else
> >            exaMoveInPixmap_mixed(pPixmap);
> > +
> > +       pExaPixmap->offscreen = TRUE;
> >     }
> >  }
> > --
> > 1.6.5.1
> >
> >
> 
> Longer testing seems to reveal minor corruption still, so i guess i
> need to look into this deeper.

Does it work better without the second hunk? It shouldn't be necessary
and I think it might even hurt at least in the case where moving back
the pixmap is deferred.


-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the xorg-devel mailing list