diff options
-rw-r--r-- | src/radeon_exa.c | 15 | ||||
-rw-r--r-- | src/radeon_exa_render.c | 15 | ||||
-rw-r--r-- | src/radeon_textured_video.c | 15 |
3 files changed, 9 insertions, 36 deletions
diff --git a/src/radeon_exa.c b/src/radeon_exa.c index 4ea451d..4da4841 100644 --- a/src/radeon_exa.c +++ b/src/radeon_exa.c @@ -105,21 +105,6 @@ RADEONLog2(int val) return bits - 1; } -static __inline__ int -RADEONPow2(int num) -{ - int pot = 2; - - if (num <= 2) - return num; - - while (pot < num) { - pot *= 2; - } - - return pot; -} - static __inline__ CARD32 F_TO_DW(float val) { union { diff --git a/src/radeon_exa_render.c b/src/radeon_exa_render.c index 30e3329..9bbccb5 100644 --- a/src/radeon_exa_render.c +++ b/src/radeon_exa_render.c @@ -809,8 +809,8 @@ static Bool FUNC_NAME(R300TextureSetup)(PicturePtr pPict, PixmapPtr pPix, txformat1 = R300TexFormats[i].card_fmt; - txformat0 = (((RADEONPow2(w) - 1) << R300_TXWIDTH_SHIFT) | - ((RADEONPow2(h) - 1) << R300_TXHEIGHT_SHIFT)); + txformat0 = (((w - 1) << R300_TXWIDTH_SHIFT) | + ((h - 1) << R300_TXHEIGHT_SHIFT)); if (pPict->repeat) { ErrorF("repeat\n"); @@ -822,15 +822,18 @@ static Bool FUNC_NAME(R300TextureSetup)(PicturePtr pPict, PixmapPtr pPix, txformat0 |= R300_TXPITCH_EN; - info->texW[unit] = RADEONPow2(w); - info->texH[unit] = RADEONPow2(h); + info->texW[unit] = w; + info->texH[unit] = h; + + txfilter = (R300_TX_CLAMP_S(R300_TX_CLAMP_CLAMP_LAST) | + R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_LAST)); switch (pPict->filter) { case PictFilterNearest: - txfilter = (R300_TX_MAG_FILTER_NEAREST | R300_TX_MIN_FILTER_NEAREST); + txfilter |= (R300_TX_MAG_FILTER_NEAREST | R300_TX_MIN_FILTER_NEAREST); break; case PictFilterBilinear: - txfilter = (R300_TX_MAG_FILTER_LINEAR | R300_TX_MIN_FILTER_LINEAR); + txfilter |= (R300_TX_MAG_FILTER_LINEAR | R300_TX_MIN_FILTER_LINEAR); break; default: RADEON_FALLBACK(("Bad filter 0x%x\n", pPict->filter)); diff --git a/src/radeon_textured_video.c b/src/radeon_textured_video.c index 8a14024..b3d689d 100644 --- a/src/radeon_textured_video.c +++ b/src/radeon_textured_video.c @@ -67,21 +67,6 @@ RADEONTilingEnabled(ScrnInfoPtr pScrn, PixmapPtr pPix) } } -static __inline__ int -RADEONPow2(int num) -{ - int pot = 2; - - if (num <= 2) - return num; - - while (pot < num) { - pot *= 2; - } - - return pot; -} - static __inline__ CARD32 F_TO_DW(float val) { union { |