aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common/saa7146_hlp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/common/saa7146_hlp.c')
-rw-r--r--drivers/media/common/saa7146_hlp.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/media/common/saa7146_hlp.c b/drivers/media/common/saa7146_hlp.c
index bc1f545c95cb..be746d1aee9a 100644
--- a/drivers/media/common/saa7146_hlp.c
+++ b/drivers/media/common/saa7146_hlp.c
@@ -343,9 +343,9 @@ static void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct sa
343 struct saa7146_vv *vv = dev->vv_data; 343 struct saa7146_vv *vv = dev->vv_data;
344 __le32 *clipping = vv->d_clipping.cpu_addr; 344 __le32 *clipping = vv->d_clipping.cpu_addr;
345 345
346 int width = fh->ov.win.w.width; 346 int width = vv->ov.win.w.width;
347 int height = fh->ov.win.w.height; 347 int height = vv->ov.win.w.height;
348 int clipcount = fh->ov.nclips; 348 int clipcount = vv->ov.nclips;
349 349
350 u32 line_list[32]; 350 u32 line_list[32];
351 u32 pixel_list[32]; 351 u32 pixel_list[32];
@@ -365,10 +365,10 @@ static void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct sa
365 for(i = 0; i < clipcount; i++) { 365 for(i = 0; i < clipcount; i++) {
366 int l = 0, r = 0, t = 0, b = 0; 366 int l = 0, r = 0, t = 0, b = 0;
367 367
368 x[i] = fh->ov.clips[i].c.left; 368 x[i] = vv->ov.clips[i].c.left;
369 y[i] = fh->ov.clips[i].c.top; 369 y[i] = vv->ov.clips[i].c.top;
370 w[i] = fh->ov.clips[i].c.width; 370 w[i] = vv->ov.clips[i].c.width;
371 h[i] = fh->ov.clips[i].c.height; 371 h[i] = vv->ov.clips[i].c.height;
372 372
373 if( w[i] < 0) { 373 if( w[i] < 0) {
374 x[i] += w[i]; w[i] = -w[i]; 374 x[i] += w[i]; w[i] = -w[i];
@@ -485,13 +485,14 @@ static void saa7146_disable_clipping(struct saa7146_dev *dev)
485static void saa7146_set_clipping_rect(struct saa7146_fh *fh) 485static void saa7146_set_clipping_rect(struct saa7146_fh *fh)
486{ 486{
487 struct saa7146_dev *dev = fh->dev; 487 struct saa7146_dev *dev = fh->dev;
488 enum v4l2_field field = fh->ov.win.field; 488 struct saa7146_vv *vv = dev->vv_data;
489 enum v4l2_field field = vv->ov.win.field;
489 struct saa7146_video_dma vdma2; 490 struct saa7146_video_dma vdma2;
490 u32 clip_format; 491 u32 clip_format;
491 u32 arbtr_ctrl; 492 u32 arbtr_ctrl;
492 493
493 /* check clipcount, disable clipping if clipcount == 0*/ 494 /* check clipcount, disable clipping if clipcount == 0*/
494 if( fh->ov.nclips == 0 ) { 495 if (vv->ov.nclips == 0) {
495 saa7146_disable_clipping(dev); 496 saa7146_disable_clipping(dev);
496 return; 497 return;
497 } 498 }
@@ -651,8 +652,8 @@ int saa7146_enable_overlay(struct saa7146_fh *fh)
651 struct saa7146_dev *dev = fh->dev; 652 struct saa7146_dev *dev = fh->dev;
652 struct saa7146_vv *vv = dev->vv_data; 653 struct saa7146_vv *vv = dev->vv_data;
653 654
654 saa7146_set_window(dev, fh->ov.win.w.width, fh->ov.win.w.height, fh->ov.win.field); 655 saa7146_set_window(dev, vv->ov.win.w.width, vv->ov.win.w.height, vv->ov.win.field);
655 saa7146_set_position(dev, fh->ov.win.w.left, fh->ov.win.w.top, fh->ov.win.w.height, fh->ov.win.field, vv->ov_fmt->pixelformat); 656 saa7146_set_position(dev, vv->ov.win.w.left, vv->ov.win.w.top, vv->ov.win.w.height, vv->ov.win.field, vv->ov_fmt->pixelformat);
656 saa7146_set_output_format(dev, vv->ov_fmt->trans); 657 saa7146_set_output_format(dev, vv->ov_fmt->trans);
657 saa7146_set_clipping_rect(fh); 658 saa7146_set_clipping_rect(fh);
658 659