summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2014-08-21 20:36:41 -0400
committerIlia Mirkin <imirkin@alum.mit.edu>2015-09-13 15:25:28 -0400
commit3bb943b33bbe8e593afc00d13fe867dd7a708c3c (patch)
tree805e8e91ea89bd8d1b84eda0fc8c60d240f296f3
parent3e2e0faa2ee1cce9c1bb5c7ad80d0592460f3edc (diff)
xv: use correct max width/height settings
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70931 Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
-rw-r--r--src/nouveau_xv.c11
-rw-r--r--src/nv50_xv.c1
-rw-r--r--src/nv_type.h1
3 files changed, 8 insertions, 5 deletions
diff --git a/src/nouveau_xv.c b/src/nouveau_xv.c
index a82ef2c..d514dbf 100644
--- a/src/nouveau_xv.c
+++ b/src/nouveau_xv.c
@@ -1068,6 +1068,8 @@ NVPutImage(ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x,
if (pPriv->grabbedByV4L)
return Success;
+ if (width > pPriv->max_image_dim || height > pPriv->max_image_dim)
+ return BadMatch;
NV_set_action_flags(pScrn, pDraw, pPriv, id, drw_x, drw_y, drw_w,
drw_h, &action_flags);
@@ -1441,11 +1443,6 @@ NVQueryImageAttributes(ScrnInfoPtr pScrn, int id,
{
int size, tmp;
- if (*w > IMAGE_MAX_W)
- *w = IMAGE_MAX_W;
- if (*h > IMAGE_MAX_H)
- *h = IMAGE_MAX_H;
-
*w = (*w + 1) & ~1; // width rounded up to an even number
if (offsets)
offsets[0] = 0;
@@ -1706,6 +1703,7 @@ NVSetupBlitVideo (ScreenPtr pScreen)
pPriv->bicubic = FALSE;
pPriv->doubleBuffer = FALSE;
pPriv->SyncToVBlank = (pNv->dev->chipset >= 0x11);
+ pPriv->max_image_dim = 2048;
pNv->blitAdaptor = adapt;
@@ -1766,6 +1764,7 @@ NVSetupOverlayVideoAdapter(ScreenPtr pScreen)
pPriv->blitter = FALSE;
pPriv->texture = FALSE;
pPriv->bicubic = FALSE;
+ pPriv->max_image_dim = 2048;
NVSetPortDefaults (pScrn, pPriv);
@@ -1967,6 +1966,7 @@ NV30SetupTexturedVideo (ScreenPtr pScreen, Bool bicubic)
pPriv->bicubic = bicubic;
pPriv->doubleBuffer = FALSE;
pPriv->SyncToVBlank = TRUE;
+ pPriv->max_image_dim = 4096;
if (bicubic)
pNv->textureAdaptor[1] = adapt;
@@ -2048,6 +2048,7 @@ NV40SetupTexturedVideo (ScreenPtr pScreen, Bool bicubic)
pPriv->bicubic = bicubic;
pPriv->doubleBuffer = FALSE;
pPriv->SyncToVBlank = TRUE;
+ pPriv->max_image_dim = 4096;
if (bicubic)
pNv->textureAdaptor[1] = adapt;
diff --git a/src/nv50_xv.c b/src/nv50_xv.c
index 1c467f4..b2541b9 100644
--- a/src/nv50_xv.c
+++ b/src/nv50_xv.c
@@ -364,6 +364,7 @@ nv50_xv_set_port_defaults(ScrnInfoPtr pScrn, NVPortPrivPtr pPriv)
pPriv->saturation = 0;
pPriv->hue = 0;
pPriv->iturbt_709 = 0;
+ pPriv->max_image_dim = 8192;
}
int
diff --git a/src/nv_type.h b/src/nv_type.h
index d903e75..d7bb4f4 100644
--- a/src/nv_type.h
+++ b/src/nv_type.h
@@ -165,6 +165,7 @@ typedef struct _NVPortPrivRec {
Bool texture;
Bool bicubic; /* only for texture adapter */
Bool SyncToVBlank;
+ int max_image_dim;
struct nouveau_bo *video_mem;
int pitch;
int offset;