diff options
author | Eric Anholt <anholt@FreeBSD.org> | 2005-10-25 21:10:28 +0000 |
---|---|---|
committer | Eric Anholt <anholt@FreeBSD.org> | 2005-10-25 21:10:28 +0000 |
commit | a09d002bb5b9610681e10e3e3b09e5da5b971eaa (patch) | |
tree | f51cacc14a9af0cf2192cf85a84c87cc4ed52a31 /src/mesa/drivers | |
parent | f1113fa99d8767e58d223b5bbdd7e19e9e89613f (diff) |
Move the front.offset setting above a check to shortcut reallocating buffers if
width and height stayed the same. Rely on front.offset pointing at the origin
in the window (rather than the origin of the front buffer), and fix the coords
in swapbuffers, which were wrong. This is different from other drivers because
we've got a back buffer with a 0,0 origin at the window's origin, which makes it
more convenient to have the front buffer match it.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/sis/sis_dd.c | 9 | ||||
-rw-r--r-- | src/mesa/drivers/dri/sis/sis_screen.c | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/sis/sis_dd.c b/src/mesa/drivers/dri/sis/sis_dd.c index 6cabe5c383..4e73f562b0 100644 --- a/src/mesa/drivers/dri/sis/sis_dd.c +++ b/src/mesa/drivers/dri/sis/sis_dd.c @@ -215,6 +215,11 @@ sisUpdateBufferSize(sisContextPtr smesa) assert(smesa->depth.Base.AllocStorage); } + /* XXX Should get the base offset of the frontbuffer from the X Server */ + smesa->front.offset = smesa->driDrawable->x * smesa->bytesPerPixel + + smesa->driDrawable->y * smesa->front.pitch; + smesa->front.map = (char *) smesa->driScreen->pFB + smesa->front.offset; + if ( smesa->width == smesa->driDrawable->w && smesa->height == smesa->driDrawable->h ) { @@ -224,10 +229,6 @@ sisUpdateBufferSize(sisContextPtr smesa) smesa->front.bpp = smesa->bytesPerPixel * 8; /* Front pitch set on context create */ smesa->front.size = smesa->front.pitch * smesa->driDrawable->h; - /* XXX Should get the base offset of the frontbuffer from the X Server */ - smesa->front.offset = smesa->driDrawable->x * smesa->bytesPerPixel + - smesa->driDrawable->y * smesa->front.pitch; - smesa->front.map = (char *) smesa->driScreen->pFB + smesa->front.offset; smesa->width = smesa->driDrawable->w; smesa->height = smesa->driDrawable->h; diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c index d1ceb68d0c..d4395a9cdd 100644 --- a/src/mesa/drivers/dri/sis/sis_screen.c +++ b/src/mesa/drivers/dri/sis/sis_screen.c @@ -253,7 +253,7 @@ static void sisCopyBuffer( __DRIdrawablePrivate *dPriv ) MMIO(REG_SRC_PITCH, smesa->back.pitch | ((smesa->bytesPerPixel == 4) ? BLIT_DEPTH_32 : BLIT_DEPTH_16)); MMIO(REG_SRC_X_Y, ((box->x1 - dPriv->x) << 16) | (box->y1 - dPriv->y)); - MMIO(REG_DST_X_Y, (box->x1 << 16) | box->y1); + MMIO(REG_DST_X_Y, ((box->x1 - dPriv->x) << 16) | (box->y1 - dPriv->y)); MMIO(REG_DST_ADDR, smesa->front.offset); MMIO(REG_DST_PITCH_HEIGHT, (smesa->virtualY << 16) | smesa->front.pitch); MMIO(REG_WIDTH_HEIGHT, ((box->y2 - box->y1) << 16) | (box->x2 - box->x1)); |