[PATCH 27/29] dri2: add initial prime support. (v1.2)

Chris Wilson chris at chris-wilson.co.uk
Thu Sep 6 05:17:50 PDT 2012


On Thu,  5 Jul 2012 21:30:34 +0100, Dave Airlie <airlied at gmail.com> wrote:
> +static void dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion,
> +                             DRI2BufferPtr pDest, DRI2BufferPtr pSrc)
> +{
> +    DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw);
> +    DRI2ScreenPtr ds;
> +    ScreenPtr primeScreen;
> +
> +    primeScreen = GetScreenPrime(pDraw->pScreen, pPriv->prime_id);
> +    ds = DRI2GetScreen(primeScreen);
> +
> +    if (ds->CopyRegion2)
> +        (*ds->CopyRegion2)(primeScreen, pDraw, pRegion, pDest, pSrc);
> +    else
> +        (*ds->CopyRegion) (pDraw, pRegion, pDest, pSrc);
> +
> +    /* cause damage to the box */
> +    if (pPriv->prime_id) {
> +       BoxRec box;
> +       RegionRec region;
> +       box.x1 = 0;
> +       box.x2 = box.x1 + pDraw->width;
> +       box.y1 = 0;
> +       box.y2 = box.y1 + pDraw->height;
> +       RegionInit(&region, &box, 1);
> +       RegionTranslate(&region, pDraw->x, pDraw->y);

Double translation here and this bug has been copied into the other
drivers as well.

> +       DamageRegionAppend(pDraw, &region);
> +       DamageRegionProcessPending(pDraw);
> +       RegionUninit(&region);
> +    }
> +}

Anyway I thought the drivers were going to be responsible for applying
the damage as we agreed that was an existing bug?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the xorg-devel mailing list