aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2011-10-03 06:56:15 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-11-03 16:33:51 -0400
commit059dc1d9841f061e5767b95822fb4035ad7559fc (patch)
tree4893fda001ff5d6a165c9bd86ae90da93052af18 /drivers/media
parente4bc6272ab3f7cb0b56705f78320e361880411e1 (diff)
[media] omap3isp: preview: Rename min/max input/output sizes defines
The macros that define the minimum/maximum input and output sizes are defined in seperate files and have no consistent naming. In preparation for preview engine cropping support, move them all to isppreview.c and rename them to PREV_{MIN|MAX}_{IN|OUT}_{WIDTH|HEIGHT}*. Remove unused and/or unneeded local variables that store the maximum output width. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/omap3isp/isppreview.c33
-rw-r--r--drivers/media/video/omap3isp/ispreg.h3
2 files changed, 17 insertions, 19 deletions
diff --git a/drivers/media/video/omap3isp/isppreview.c b/drivers/media/video/omap3isp/isppreview.c
index c920c1e17ae9..d5cce423283c 100644
--- a/drivers/media/video/omap3isp/isppreview.c
+++ b/drivers/media/video/omap3isp/isppreview.c
@@ -76,9 +76,15 @@ static struct omap3isp_prev_csc flr_prev_csc = {
76 76
77#define DEF_DETECT_CORRECT_VAL 0xe 77#define DEF_DETECT_CORRECT_VAL 0xe
78 78
79#define PREV_MIN_WIDTH 64 79#define PREV_MIN_IN_WIDTH 64
80#define PREV_MIN_HEIGHT 8 80#define PREV_MIN_IN_HEIGHT 8
81#define PREV_MAX_HEIGHT 16384 81#define PREV_MAX_IN_HEIGHT 16384
82
83#define PREV_MIN_OUT_WIDTH 0
84#define PREV_MIN_OUT_HEIGHT 0
85#define PREV_MAX_OUT_WIDTH 1280
86#define PREV_MAX_OUT_WIDTH_ES2 3300
87#define PREV_MAX_OUT_WIDTH_3630 4096
82 88
83/* 89/*
84 * Coeficient Tables for the submodules in Preview. 90 * Coeficient Tables for the submodules in Preview.
@@ -1280,14 +1286,14 @@ static unsigned int preview_max_out_width(struct isp_prev_device *prev)
1280 1286
1281 switch (isp->revision) { 1287 switch (isp->revision) {
1282 case ISP_REVISION_1_0: 1288 case ISP_REVISION_1_0:
1283 return ISPPRV_MAXOUTPUT_WIDTH; 1289 return PREV_MAX_OUT_WIDTH;
1284 1290
1285 case ISP_REVISION_2_0: 1291 case ISP_REVISION_2_0:
1286 default: 1292 default:
1287 return ISPPRV_MAXOUTPUT_WIDTH_ES2; 1293 return PREV_MAX_OUT_WIDTH_ES2;
1288 1294
1289 case ISP_REVISION_15_0: 1295 case ISP_REVISION_15_0:
1290 return ISPPRV_MAXOUTPUT_WIDTH_3630; 1296 return PREV_MAX_OUT_WIDTH_3630;
1291 } 1297 }
1292} 1298}
1293 1299
@@ -1295,7 +1301,6 @@ static void preview_configure(struct isp_prev_device *prev)
1295{ 1301{
1296 struct isp_device *isp = to_isp_device(prev); 1302 struct isp_device *isp = to_isp_device(prev);
1297 struct v4l2_mbus_framefmt *format; 1303 struct v4l2_mbus_framefmt *format;
1298 unsigned int max_out_width;
1299 1304
1300 preview_setup_hw(prev); 1305 preview_setup_hw(prev);
1301 1306
@@ -1333,8 +1338,6 @@ static void preview_configure(struct isp_prev_device *prev)
1333 preview_config_outlineoffset(prev, 1338 preview_config_outlineoffset(prev,
1334 ALIGN(format->width, 0x10) * 2); 1339 ALIGN(format->width, 0x10) * 2);
1335 1340
1336 max_out_width = preview_max_out_width(prev);
1337
1338 preview_config_averager(prev, 0); 1341 preview_config_averager(prev, 0);
1339 preview_config_ycpos(prev, format->code); 1342 preview_config_ycpos(prev, format->code);
1340} 1343}
@@ -1620,12 +1623,9 @@ static void preview_try_format(struct isp_prev_device *prev,
1620 enum v4l2_subdev_format_whence which) 1623 enum v4l2_subdev_format_whence which)
1621{ 1624{
1622 struct v4l2_mbus_framefmt *format; 1625 struct v4l2_mbus_framefmt *format;
1623 unsigned int max_out_width;
1624 enum v4l2_mbus_pixelcode pixelcode; 1626 enum v4l2_mbus_pixelcode pixelcode;
1625 unsigned int i; 1627 unsigned int i;
1626 1628
1627 max_out_width = preview_max_out_width(prev);
1628
1629 switch (pad) { 1629 switch (pad) {
1630 case PREV_PAD_SINK: 1630 case PREV_PAD_SINK:
1631 /* When reading data from the CCDC, the input size has already 1631 /* When reading data from the CCDC, the input size has already
@@ -1638,10 +1638,11 @@ static void preview_try_format(struct isp_prev_device *prev,
1638 * filter array interpolation. 1638 * filter array interpolation.
1639 */ 1639 */
1640 if (prev->input == PREVIEW_INPUT_MEMORY) { 1640 if (prev->input == PREVIEW_INPUT_MEMORY) {
1641 fmt->width = clamp_t(u32, fmt->width, PREV_MIN_WIDTH, 1641 fmt->width = clamp_t(u32, fmt->width, PREV_MIN_IN_WIDTH,
1642 max_out_width); 1642 preview_max_out_width(prev));
1643 fmt->height = clamp_t(u32, fmt->height, PREV_MIN_HEIGHT, 1643 fmt->height = clamp_t(u32, fmt->height,
1644 PREV_MAX_HEIGHT); 1644 PREV_MIN_IN_HEIGHT,
1645 PREV_MAX_IN_HEIGHT);
1645 } 1646 }
1646 1647
1647 fmt->colorspace = V4L2_COLORSPACE_SRGB; 1648 fmt->colorspace = V4L2_COLORSPACE_SRGB;
diff --git a/drivers/media/video/omap3isp/ispreg.h b/drivers/media/video/omap3isp/ispreg.h
index 69f6af6f6b9c..084ea77d65a7 100644
--- a/drivers/media/video/omap3isp/ispreg.h
+++ b/drivers/media/video/omap3isp/ispreg.h
@@ -402,9 +402,6 @@
402#define ISPPRV_YENH_TABLE_ADDR 0x1000 402#define ISPPRV_YENH_TABLE_ADDR 0x1000
403#define ISPPRV_CFA_TABLE_ADDR 0x1400 403#define ISPPRV_CFA_TABLE_ADDR 0x1400
404 404
405#define ISPPRV_MAXOUTPUT_WIDTH 1280
406#define ISPPRV_MAXOUTPUT_WIDTH_ES2 3300
407#define ISPPRV_MAXOUTPUT_WIDTH_3630 4096
408#define ISPRSZ_MIN_OUTPUT 64 405#define ISPRSZ_MIN_OUTPUT 64
409#define ISPRSZ_MAX_OUTPUT 3312 406#define ISPRSZ_MAX_OUTPUT 3312
410 407