Skip to content
Browse files

xv: only use bicubic filtering when scaling >=2x

  • Loading branch information...
1 parent e2146d3 commit 2462b417fc550b71f021ca9736808f8f2d1cb6f0 Ben Skeggs committed with Ben Skeggs May 4, 2009
Showing with 11 additions and 4 deletions.
  1. +5 −2 src/nv30_xv_tex.c
  2. +6 −2 src/nv40_xv_tex.c
View
7 src/nv30_xv_tex.c
@@ -258,7 +258,7 @@ NV30PutTextureImage(ScrnInfoPtr pScrn, struct nouveau_bo *src, int src_offset,
struct nouveau_channel *chan = pNv->chan;
struct nouveau_grobj *rankine = pNv->Nv3D;
struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
- Bool redirected = FALSE;
+ Bool redirected = FALSE, bicubic = pPriv->bicubic;
float X1, X2, Y1, Y2;
BoxPtr pbox;
int nbox;
@@ -342,7 +342,10 @@ NV30PutTextureImage(ScrnInfoPtr pScrn, struct nouveau_bo *src, int src_offset,
BEGIN_RING(chan, rankine, NV34TCL_TX_ENABLE(3), 1);
OUT_RING (chan, 0x0);
- if (!NV30_LoadFragProg(pScrn, pPriv->bicubic ?
+ if (drw_w / 2 < src_w || drw_h / 2 < src_h)
+ bicubic = FALSE;
+
+ if (!NV30_LoadFragProg(pScrn, bicubic ?
&nv30_fp_yv12_bicubic :
&nv30_fp_yv12_bilinear)) {
MARK_UNDO(chan);
View
8 src/nv40_xv_tex.c
@@ -262,7 +262,7 @@ NV40PutTextureImage(ScrnInfoPtr pScrn,
struct nouveau_channel *chan = pNv->chan;
struct nouveau_grobj *curie = pNv->Nv3D;
struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
- Bool redirected = FALSE;
+ Bool redirected = FALSE, bicubic = pPriv->bicubic;
float X1, X2, Y1, Y2;
BoxPtr pbox;
int nbox;
@@ -322,7 +322,11 @@ NV40PutTextureImage(ScrnInfoPtr pScrn,
}
NV40_LoadVtxProg(pScrn, &nv40_vp_video);
- if (!NV40_LoadFragProg(pScrn, pPriv->bicubic ?
+
+ if (drw_w / 2 < src_w || drw_h / 2 < src_h)
+ bicubic = FALSE;
+
+ if (!NV40_LoadFragProg(pScrn, bicubic ?
&nv40_fp_yv12_bicubic :
&nv30_fp_yv12_bilinear)) {
MARK_UNDO(chan);

0 comments on commit 2462b41

Please sign in to comment.
Something went wrong with that request. Please try again.