aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-07-29 07:40:59 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-08-18 07:19:03 -0400
commiteacf8f9aa80e2231af43b589cfc18c054e417220 (patch)
tree0d746bcb9aa54d2f602205119c7887963afe6014
parent7f68127fa11f08c5468537eb28ca6b8b95d70f08 (diff)
[media] v4l2: use new V4L2_DV_BT_BLANKING/FRAME defines
Use the new defines to calculate the full blanking and frame sizes. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Scott Jiang <scott.jiang.linux@gmail.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/media/i2c/ad9389b.c6
-rw-r--r--drivers/media/i2c/adv7604.c8
-rw-r--r--drivers/media/i2c/ths7303.c6
-rw-r--r--drivers/media/i2c/ths8200.c8
-rw-r--r--drivers/media/platform/blackfin/bfin_capture.c9
-rw-r--r--drivers/media/usb/hdpvr/hdpvr-video.c6
6 files changed, 16 insertions, 27 deletions
diff --git a/drivers/media/i2c/ad9389b.c b/drivers/media/i2c/ad9389b.c
index 2fa8d7286cea..5295234deb51 100644
--- a/drivers/media/i2c/ad9389b.c
+++ b/drivers/media/i2c/ad9389b.c
@@ -445,10 +445,8 @@ static int ad9389b_log_status(struct v4l2_subdev *sd)
445 } 445 }
446 if (state->dv_timings.type == V4L2_DV_BT_656_1120) { 446 if (state->dv_timings.type == V4L2_DV_BT_656_1120) {
447 struct v4l2_bt_timings *bt = bt = &state->dv_timings.bt; 447 struct v4l2_bt_timings *bt = bt = &state->dv_timings.bt;
448 u32 frame_width = bt->width + bt->hfrontporch + 448 u32 frame_width = V4L2_DV_BT_FRAME_WIDTH(bt);
449 bt->hsync + bt->hbackporch; 449 u32 frame_height = V4L2_DV_BT_FRAME_HEIGHT(bt);
450 u32 frame_height = bt->height + bt->vfrontporch +
451 bt->vsync + bt->vbackporch;
452 u32 frame_size = frame_width * frame_height; 450 u32 frame_size = frame_width * frame_height;
453 451
454 v4l2_info(sd, "timings: %ux%u%s%u (%ux%u). Pix freq. = %u Hz. Polarities = 0x%x\n", 452 v4l2_info(sd, "timings: %ux%u%s%u (%ux%u). Pix freq. = %u Hz. Polarities = 0x%x\n",
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index 181a6c359335..3ec7ec0911ca 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -261,22 +261,22 @@ static inline struct v4l2_subdev *to_sd(struct v4l2_ctrl *ctrl)
261 261
262static inline unsigned hblanking(const struct v4l2_bt_timings *t) 262static inline unsigned hblanking(const struct v4l2_bt_timings *t)
263{ 263{
264 return t->hfrontporch + t->hsync + t->hbackporch; 264 return V4L2_DV_BT_BLANKING_WIDTH(t);
265} 265}
266 266
267static inline unsigned htotal(const struct v4l2_bt_timings *t) 267static inline unsigned htotal(const struct v4l2_bt_timings *t)
268{ 268{
269 return t->width + t->hfrontporch + t->hsync + t->hbackporch; 269 return V4L2_DV_BT_FRAME_WIDTH(t);
270} 270}
271 271
272static inline unsigned vblanking(const struct v4l2_bt_timings *t) 272static inline unsigned vblanking(const struct v4l2_bt_timings *t)
273{ 273{
274 return t->vfrontporch + t->vsync + t->vbackporch; 274 return V4L2_DV_BT_BLANKING_HEIGHT(t);
275} 275}
276 276
277static inline unsigned vtotal(const struct v4l2_bt_timings *t) 277static inline unsigned vtotal(const struct v4l2_bt_timings *t)
278{ 278{
279 return t->height + t->vfrontporch + t->vsync + t->vbackporch; 279 return V4L2_DV_BT_FRAME_HEIGHT(t);
280} 280}
281 281
282/* ----------------------------------------------------------------------- */ 282/* ----------------------------------------------------------------------- */
diff --git a/drivers/media/i2c/ths7303.c b/drivers/media/i2c/ths7303.c
index 0a2dacbd7a63..42276d93624c 100644
--- a/drivers/media/i2c/ths7303.c
+++ b/drivers/media/i2c/ths7303.c
@@ -291,10 +291,8 @@ static int ths7303_log_status(struct v4l2_subdev *sd)
291 struct v4l2_bt_timings *bt = bt = &state->bt; 291 struct v4l2_bt_timings *bt = bt = &state->bt;
292 u32 frame_width, frame_height; 292 u32 frame_width, frame_height;
293 293
294 frame_width = bt->width + bt->hfrontporch + 294 frame_width = V4L2_DV_BT_FRAME_WIDTH(bt);
295 bt->hsync + bt->hbackporch; 295 frame_height = V4L2_DV_BT_FRAME_HEIGHT(bt);
296 frame_height = bt->height + bt->vfrontporch +
297 bt->vsync + bt->vbackporch;
298 v4l2_info(sd, 296 v4l2_info(sd,
299 "timings: %dx%d%s%d (%dx%d). Pix freq. = %d Hz. Polarities = 0x%x\n", 297 "timings: %dx%d%s%d (%dx%d). Pix freq. = %d Hz. Polarities = 0x%x\n",
300 bt->width, bt->height, bt->interlaced ? "i" : "p", 298 bt->width, bt->height, bt->interlaced ? "i" : "p",
diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c
index aef7c0e7cd67..28932e9c1f08 100644
--- a/drivers/media/i2c/ths8200.c
+++ b/drivers/media/i2c/ths8200.c
@@ -65,22 +65,22 @@ static inline struct ths8200_state *to_state(struct v4l2_subdev *sd)
65 65
66static inline unsigned hblanking(const struct v4l2_bt_timings *t) 66static inline unsigned hblanking(const struct v4l2_bt_timings *t)
67{ 67{
68 return t->hfrontporch + t->hsync + t->hbackporch; 68 return V4L2_DV_BT_BLANKING_WIDTH(t);
69} 69}
70 70
71static inline unsigned htotal(const struct v4l2_bt_timings *t) 71static inline unsigned htotal(const struct v4l2_bt_timings *t)
72{ 72{
73 return t->width + t->hfrontporch + t->hsync + t->hbackporch; 73 return V4L2_DV_BT_FRAME_WIDTH(t);
74} 74}
75 75
76static inline unsigned vblanking(const struct v4l2_bt_timings *t) 76static inline unsigned vblanking(const struct v4l2_bt_timings *t)
77{ 77{
78 return t->vfrontporch + t->vsync + t->vbackporch; 78 return V4L2_DV_BT_BLANKING_HEIGHT(t);
79} 79}
80 80
81static inline unsigned vtotal(const struct v4l2_bt_timings *t) 81static inline unsigned vtotal(const struct v4l2_bt_timings *t)
82{ 82{
83 return t->height + t->vfrontporch + t->vsync + t->vbackporch; 83 return V4L2_DV_BT_FRAME_HEIGHT(t);
84} 84}
85 85
86static int ths8200_read(struct v4l2_subdev *sd, u8 reg) 86static int ths8200_read(struct v4l2_subdev *sd, u8 reg)
diff --git a/drivers/media/platform/blackfin/bfin_capture.c b/drivers/media/platform/blackfin/bfin_capture.c
index 7f838c681cea..4c1105977090 100644
--- a/drivers/media/platform/blackfin/bfin_capture.c
+++ b/drivers/media/platform/blackfin/bfin_capture.c
@@ -388,13 +388,8 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
388 388
389 params.hdelay = bt->hsync + bt->hbackporch; 389 params.hdelay = bt->hsync + bt->hbackporch;
390 params.vdelay = bt->vsync + bt->vbackporch; 390 params.vdelay = bt->vsync + bt->vbackporch;
391 params.line = bt->hfrontporch + bt->hsync 391 params.line = V4L2_DV_BT_FRAME_WIDTH(bt);
392 + bt->hbackporch + bt->width; 392 params.frame = V4L2_DV_BT_FRAME_HEIGHT(bt);
393 params.frame = bt->vfrontporch + bt->vsync
394 + bt->vbackporch + bt->height;
395 if (bt->interlaced)
396 params.frame += bt->il_vfrontporch + bt->il_vsync
397 + bt->il_vbackporch;
398 } else if (bcap_dev->cfg->inputs[bcap_dev->cur_input].capabilities 393 } else if (bcap_dev->cfg->inputs[bcap_dev->cur_input].capabilities
399 & V4L2_IN_CAP_STD) { 394 & V4L2_IN_CAP_STD) {
400 params.hdelay = 0; 395 params.hdelay = 0;
diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c
index 9c67b6e127e3..e68245a7f3a7 100644
--- a/drivers/media/usb/hdpvr/hdpvr-video.c
+++ b/drivers/media/usb/hdpvr/hdpvr-video.c
@@ -690,10 +690,8 @@ static int vidioc_query_dv_timings(struct file *file, void *_fh,
690 unsigned vsize; 690 unsigned vsize;
691 unsigned fps; 691 unsigned fps;
692 692
693 hsize = bt->hfrontporch + bt->hsync + bt->hbackporch + bt->width; 693 hsize = V4L2_DV_BT_FRAME_WIDTH(bt);
694 vsize = bt->vfrontporch + bt->vsync + bt->vbackporch + 694 vsize = V4L2_DV_BT_FRAME_HEIGHT(bt);
695 bt->il_vfrontporch + bt->il_vsync + bt->il_vbackporch +
696 bt->height;
697 fps = (unsigned)bt->pixelclock / (hsize * vsize); 695 fps = (unsigned)bt->pixelclock / (hsize * vsize);
698 if (bt->width != vid_info.width || 696 if (bt->width != vid_info.width ||
699 bt->height != vid_info.height || 697 bt->height != vid_info.height ||