[patch 26/37] V4L: saa7146: Fix allocation of clipping memory

From: Greg KH
Date: Fri Mar 30 2007 - 17:12:34 EST


-stable review patch. If anyone has any objections, please let us know.

------------------
From: Oliver Endriss <o.endriss@xxxxxx>

V4L: saa7146: Fix allocation of clipping memory

Olaf Hering pointed out that SAA7146_CLIPPING_MEM would become
very large for PAGE_SIZE > 4K.

In fact, the number of clipping windows is limited to 16,
and calculate_clipping_registers_rect() does not use more
than 256 bytes. SAA7146_CLIPPING_MEM adjusted accordingly.

(cherry picked from commit 7a7cd1920969dd9da4e0d99aab573b3eba24c799)

Thanks-to: Olaf Hering <olaf@xxxxxxxxx>
Acked-by: Michael Hunold <hunold@xxxxxxxxxxx>
Signed-off-by: Oliver Endriss <o.endriss@xxxxxx>
Signed-off-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxx>
Signed-off-by: Michael Krufky <mkrufky@xxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
include/media/saa7146_vv.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- a/include/media/saa7146_vv.h
+++ b/include/media/saa7146_vv.h
@@ -239,7 +239,8 @@ void saa7146_res_free(struct saa7146_fh
#define SAA7146_HPS_SYNC_PORT_B 0x01

/* some memory sizes */
-#define SAA7146_CLIPPING_MEM (14*PAGE_SIZE)
+/* max. 16 clipping rectangles */
+#define SAA7146_CLIPPING_MEM (16 * 4 * sizeof(u32))

/* some defines for the various clipping-modes */
#define SAA7146_CLIPPING_RECT 0x4

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/