[PATCH 2/2] exa/mixed: devKind doesn't have to be set before calling ExaCopyDirty*

Michel Dänzer michel at daenzer.net
Tue Dec 1 23:56:14 PST 2009


On Wed, 2009-12-02 at 08:42 +0100, Michel Dänzer wrote: 
> On Wed, 2009-12-02 at 00:16 +0100, Maarten Maathuis wrote: 
> > Signed-off-by: Maarten Maathuis <madman2003 at gmail.com>
> > ---
> >  exa/exa_migration_mixed.c |    6 +-----
> >  1 files changed, 1 insertions(+), 5 deletions(-)
> > 
> > diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
> > index a7fdf63..36afc86 100644
> > --- a/exa/exa_migration_mixed.c
> > +++ b/exa/exa_migration_mixed.c
> > @@ -101,7 +101,6 @@ exaDoMigration_mixed(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel)
> >  	if (pExaPixmap->pDamage && exaPixmapHasGpuCopy(pPixmap)) {
> >  	    ExaScreenPriv(pPixmap->drawable.pScreen);
> >  
> > -	    pPixmap->devKind = pExaPixmap->fb_pitch;
> >  	    exaCopyDirtyToFb(pixmaps + i);
> >  
> >  	    if (pExaScr->deferred_mixed_pixmap == pPixmap)
> > @@ -183,17 +182,14 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
> >  		    pixmaps[0].as_src = TRUE;
> >  		    pixmaps[0].pReg = NULL;
> >  		}
> > -		pPixmap->devKind = pExaPixmap->fb_pitch;
> >  		exaCopyDirtyToSys(pixmaps);
> >  	    }
> >  
> >  	    if (as_dst)
> >  		exaPixmapDirty(pPixmap, 0, 0, pPixmap->drawable.width,
> >  			       pPixmap->drawable.height);
> > -	} else if (has_gpu_copy) {
> > -	    pPixmap->devKind = pExaPixmap->fb_pitch;
> > +	} else if (has_gpu_copy)
> >  	    exaCopyDirtyToSys(pixmaps);
> > -	}
> >  
> >  	pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
> >  	pPixmap->devKind = pExaPixmap->sys_pitch;
> 
> NACK. Driver UploadTo/DownloadFromScreen hooks need to know the GPU copy
> pitch, and they typically use exaGetPixmapPitch() or just the pixmap
> devKind field directly for this.

On second thought, exaCopyDirty() does set devKind to the GPU copy pitch
temporarily, so the second hunk should be okay. However, the first hunk
doesn't leave anything to ensure devKind keeps the GPU copy pitch, does
it?


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


More information about the xorg-devel mailing list