From 4ffde8a6b3299f002c10b1abd881e4c6849767ea Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 10 Jun 2004 19:22:58 +0000 Subject: [PATCH] - Pass the right pixel mask (all ones) in to PrepareSolid in the solid-fill-based composite acceleration. - Use a real pixmap when doing an UploadToScratch (For pDrawable->type == DRAWABLE_WINDOW, you need to get the backing pixmap). - Pass back the x/y offsets from kaaGetOffscreenPixmap unconditionally, because they'll be used in the scratch case. - Turn on the Render acceleration for Rage 128 and Radeon 100-series at last! --- hw/kdrive/ati/ati_draw.c | 4 ++-- hw/kdrive/src/kaa.c | 9 ++++----- hw/kdrive/src/kaapict.c | 19 +++++++++++++------ 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/hw/kdrive/ati/ati_draw.c b/hw/kdrive/ati/ati_draw.c index 4a9967275..d22b8685a 100644 --- a/hw/kdrive/ati/ati_draw.c +++ b/hw/kdrive/ati/ati_draw.c @@ -753,12 +753,12 @@ ATIDrawEnable(ScreenPtr pScreen) /* We can't dispatch 3d commands in PIO mode. */ if (!atis->using_pio) { - if (0 && !atic->is_radeon) { /* XXX */ + if (!atic->is_radeon) { atis->kaa.CheckComposite = R128CheckComposite; atis->kaa.PrepareComposite = R128PrepareComposite; atis->kaa.Composite = R128Composite; atis->kaa.DoneComposite = R128DoneComposite; - } else if (0 && atic->is_r100) { /* XXX */ + } else if (atic->is_r100) { atis->kaa.CheckComposite = R100CheckComposite; atis->kaa.PrepareComposite = R100PrepareComposite; atis->kaa.Composite = RadeonComposite; diff --git a/hw/kdrive/src/kaa.c b/hw/kdrive/src/kaa.c index 4a3350089..51d62c3d7 100644 --- a/hw/kdrive/src/kaa.c +++ b/hw/kdrive/src/kaa.c @@ -336,13 +336,12 @@ kaaGetOffscreenPixmap (DrawablePtr pDrawable, int *xp, int *yp) x = 0; y = 0; } + *xp = x; + *yp = y; if (kaaPixmapIsOffscreen (pPixmap)) - { - *xp = x; - *yp = y; return pPixmap; - } - return NULL; + else + return NULL; } Bool diff --git a/hw/kdrive/src/kaapict.c b/hw/kdrive/src/kaapict.c index 5c4696dec..34647a91f 100644 --- a/hw/kdrive/src/kaapict.c +++ b/hw/kdrive/src/kaapict.c @@ -277,8 +277,7 @@ kaaTryDriverSolidFill(PicturePtr pSrc, kaaGetPixelFromRGBA(&pixel, red, green, blue, alpha, pDst->format); - if (!(*pKaaScr->info->PrepareSolid) (pDstPix, GXcopy, 0xffffff, - pixel)) + if (!(*pKaaScr->info->PrepareSolid) (pDstPix, GXcopy, 0xffffffff, pixel)) { REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); return -1; @@ -451,12 +450,20 @@ kaaTryDriverComposite(CARD8 op, } if (!pSrcPix && (!pMask || pMaskPix) && pKaaScr->info->UploadToScratch) { - if ((*pKaaScr->info->UploadToScratch) ((PixmapPtr) pSrc->pDrawable, - &scratch)) + if (pSrc->pDrawable->type == DRAWABLE_WINDOW) + pSrcPix = (*pSrc->pDrawable->pScreen->GetWindowPixmap) ( + (WindowPtr) pSrc->pDrawable); + else + pSrcPix = (PixmapPtr) pSrc->pDrawable; + if ((*pKaaScr->info->UploadToScratch) (pSrcPix, &scratch)) pSrcPix = &scratch; } else if (pSrcPix && pMask && !pMaskPix && pKaaScr->info->UploadToScratch) { - if ((*pKaaScr->info->UploadToScratch) ((PixmapPtr) pMask->pDrawable, - &scratch)) + if (pMask->pDrawable->type == DRAWABLE_WINDOW) + pMaskPix = (*pMask->pDrawable->pScreen->GetWindowPixmap) ( + (WindowPtr) pMask->pDrawable); + else + pMaskPix = (PixmapPtr) pMask->pDrawable; + if ((*pKaaScr->info->UploadToScratch) (pMaskPix, &scratch)) pMaskPix = &scratch; }