exa, kdrive, and segfault
Michel Dänzer
michel at daenzer.net
Thu Dec 3 01:38:39 PST 2009
On Thu, 2009-12-03 at 09:48 +0100, Arnaud Mouiche wrote:
> Hi,
>
> I start to play with EXA and tried to implement it under kdrive, for a
> Davinci implementation
> (http://focus.ti.com/docs/prod/folders/print/tms320dm6446.html)
>
> - staring with version 1.7.1 of xserver (getting from xorg 7.5)
> - as davinci can be consider as a slow platform, so target kdrive for
> that job
> - copy/paste hw/kdrive/fbdev as a starting point (working fine) and
> looks at what hw/kdrive/ephyr is doing for EXA init, and with a EXA
> implementation that does nothing first.
>
> there is a segfault when using "ExaMigrationSmart" and/or when
> "checkDirtyCorrectness" is true.
> not happened with "ExaMigrationGreedy",
Note that the default in Xorg is ExaMigrationAlways, and the other
heuristics haven't been actively maintained since that's been the case.
> and the segfault is due to a use of
> REGION_NOTEMPTY (pScreen, DamageRegion(pExaPixmap->pDamage)
> with pExaPixmap->pDamage == NULL
> (see background informations for the whole details)
Does the patch below fix the crash?
diff --git a/exa/exa_migration_classic.c b/exa/exa_migration_classic.c
index 95189be..871679f 100644
--- a/exa/exa_migration_classic.c
+++ b/exa/exa_migration_classic.c
@@ -75,6 +75,9 @@ exaPixmapIsDirty (PixmapPtr pPix)
if (pExaPixmap == NULL)
EXA_FatalErrorDebugWithRet(("EXA bug: exaPixmapIsDirty was called on a non-exa pixmap.\n"), TRUE);
+ if (!pExaPixmap->pDamage)
+ return FALSE;
+
return REGION_NOTEMPTY (pScreen, DamageRegion(pExaPixmap->pDamage)) ||
!REGION_EQUAL(pScreen, &pExaPixmap->validSys, &pExaPixmap->validFB);
}
--
Earthling Michel Dänzer | http://www.vmware.com
Libre software enthusiast | Debian, X and DRI developer
More information about the xorg-devel
mailing list