summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2005-02-21 03:05:55 +0000
committerEric Anholt <anholt@freebsd.org>2005-02-21 03:05:55 +0000
commitde34b0eefc9f8a29147659454398cabb187c7cb6 (patch)
tree50722d32713351122c19729da9d733b34b8c13d0 /hw
parent535c178286f94cc593b6cda753bbeb9b7cf6df4c (diff)
Extend the filter support to R200, and do the check for filter settings in
Check rather than Prepare, to avoid migration of things we won't be able to accelerate.
Diffstat (limited to 'hw')
-rw-r--r--hw/kdrive/ati/radeon_composite.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/hw/kdrive/ati/radeon_composite.c b/hw/kdrive/ati/radeon_composite.c
index cec1d8c96..d9c018143 100644
--- a/hw/kdrive/ati/radeon_composite.c
+++ b/hw/kdrive/ati/radeon_composite.c
@@ -156,6 +156,10 @@ R100CheckCompositeTexture(PicturePtr pPict, int unit)
if (pPict->repeat && ((w & (w - 1)) != 0 || (h & (h - 1)) != 0))
ATI_FALLBACK(("NPOT repeat unsupported (%dx%d)\n", w, h));
+ if (pPict->filter != PictFilterNearest &&
+ pPict->filter != PictFilterBilinear)
+ ATI_FALLBACK(("Unsupported filter 0x%x\n", pPict->filter));
+
return TRUE;
}
@@ -206,8 +210,7 @@ R100TextureSetup(PicturePtr pPict, PixmapPtr pPix, int unit)
RADEON_MIN_FILTER_LINEAR);
break;
default:
- ATI_FALLBACK (("Bad filter 0x%x\n", pPict->filter));
- break;
+ ATI_FALLBACK(("Bad filter 0x%x\n", pPict->filter));
}
BEGIN_DMA(7);
@@ -403,6 +406,10 @@ R200CheckCompositeTexture(PicturePtr pPict, int unit)
if (pPict->repeat && ((w & (w - 1)) != 0 || (h & (h - 1)) != 0))
ATI_FALLBACK(("NPOT repeat unsupported (%dx%d)\n", w, h));
+ if (pPict->filter != PictFilterNearest &&
+ pPict->filter != PictFilterBilinear)
+ ATI_FALLBACK(("Unsupported filter 0x%x\n", pPict->filter));
+
return TRUE;
}
@@ -411,7 +418,7 @@ R200TextureSetup(PicturePtr pPict, PixmapPtr pPix, int unit)
{
ATIScreenInfo *atis = accel_atis;
KdScreenPriv(pPix->drawable.pScreen);
- CARD32 txformat, txoffset, txpitch;
+ CARD32 txfilter, txformat, txoffset, txpitch;
int w = pPict->pDrawable->width;
int h = pPict->pDrawable->height;
int i;
@@ -442,10 +449,23 @@ R200TextureSetup(PicturePtr pPict, PixmapPtr pPix, int unit)
if ((txpitch & 0x1f) != 0)
ATI_FALLBACK(("Bad texture pitch 0x%x\n", txpitch));
+ switch (pPict->filter) {
+ case PictFilterNearest:
+ txfilter = (R200_MAG_FILTER_NEAREST |
+ R200_MIN_FILTER_NEAREST);
+ break;
+ case PictFilterBilinear:
+ txfilter = (R200_MAG_FILTER_LINEAR |
+ R200_MIN_FILTER_LINEAR);
+ break;
+ default:
+ ATI_FALLBACK(("Bad filter 0x%x\n", pPict->filter));
+ }
+
if (unit == 0) {
BEGIN_DMA(6);
OUT_RING(DMA_PACKET0(R200_REG_PP_TXFILTER_0 + 0x20 * unit, 5));
- OUT_RING_REG(R200_REG_PP_TXFILTER_0, 0);
+ OUT_RING_REG(R200_REG_PP_TXFILTER_0, txfilter);
OUT_RING_REG(R200_REG_PP_TXFORMAT_0, txformat);
OUT_RING_REG(R200_REG_PP_TXFORMAT_X_0, 0);
OUT_RING_REG(R200_REG_PP_TXSIZE_0,
@@ -456,7 +476,7 @@ R200TextureSetup(PicturePtr pPict, PixmapPtr pPix, int unit)
} else {
BEGIN_DMA(6);
OUT_RING(DMA_PACKET0(R200_REG_PP_TXFILTER_1, 5));
- OUT_RING_REG(R200_REG_PP_TXFILTER_1, 0);
+ OUT_RING_REG(R200_REG_PP_TXFILTER_1, txfilter);
OUT_RING_REG(R200_REG_PP_TXFORMAT_1, txformat);
OUT_RING_REG(R200_REG_PP_TXFORMAT_X_1, 0);
OUT_RING_REG(R200_REG_PP_TXSIZE_1,