aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-yuv.c
diff options
context:
space:
mode:
authorIan Armstrong <ian@iarmst.demon.co.uk>2008-04-22 13:42:14 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:07:44 -0400
commit88ab075aee974f70b7b0273a964810698c8a5b95 (patch)
tree7ef505be831d742b59fb8ed6f5d84a2894dc5ce9 /drivers/media/video/ivtv/ivtv-yuv.c
parent520ebe5f72ff450d7a73e8f669190254a5836093 (diff)
V4L/DVB (7243): ivtv: yuv framebuffer tracking
The existing yuv code limits output to the display area occupied by the framebuffer. This patch allows the yuv output to be 'detached' via V4L2_FBUF_FLAG_OVERLAY. By default, the yuv output window will be restricted to the framebuffer dimensions and the output position is relative to the top left corner of the framebuffer. This matches the behaviour of previous versions. If V4L2_FBUF_FLAG_OVERLAY is cleared, the yuv output will no longer be linked to the framebuffer. The maximum dimensions are either 720x576 or 720x480 depending on the current broadcast standard, with the output position relative to the top left corner of the display. The framebuffer itself can be resized, moved and panned without affecting the yuv output. Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-yuv.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-yuv.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/drivers/media/video/ivtv/ivtv-yuv.c b/drivers/media/video/ivtv/ivtv-yuv.c
index 8fdd67cef74c..393d917cd672 100644
--- a/drivers/media/video/ivtv/ivtv-yuv.c
+++ b/drivers/media/video/ivtv/ivtv-yuv.c
@@ -718,9 +718,11 @@ static u32 ivtv_yuv_window_setup(struct ivtv *itv, struct yuv_frame_info *f)
718 f->src_w -= (osd_scale * osd_crop) >> 16; 718 f->src_w -= (osd_scale * osd_crop) >> 16;
719 } 719 }
720 720
721 /* The OSD can be moved. Track to it */ 721 if (itv->yuv_info.track_osd) {
722 f->dst_x += itv->yuv_info.osd_x_offset; 722 /* The OSD can be moved. Track to it */
723 f->dst_y += itv->yuv_info.osd_y_offset; 723 f->dst_x += itv->yuv_info.osd_x_offset;
724 f->dst_y += itv->yuv_info.osd_y_offset;
725 }
724 726
725 /* Width & height for both src & dst must be even. 727 /* Width & height for both src & dst must be even.
726 Same for coordinates. */ 728 Same for coordinates. */
@@ -792,11 +794,19 @@ void ivtv_yuv_work_handler(struct ivtv *itv)
792 IVTV_DEBUG_YUV("Update yuv registers for frame %d\n", frame); 794 IVTV_DEBUG_YUV("Update yuv registers for frame %d\n", frame);
793 f = yi->new_frame_info[frame]; 795 f = yi->new_frame_info[frame];
794 796
795 /* Update the osd pan info */ 797 if (yi->track_osd) {
796 f.pan_x = yi->osd_x_pan; 798 /* Snapshot the osd pan info */
797 f.pan_y = yi->osd_y_pan; 799 f.pan_x = yi->osd_x_pan;
798 f.vis_w = yi->osd_vis_w; 800 f.pan_y = yi->osd_y_pan;
799 f.vis_h = yi->osd_vis_h; 801 f.vis_w = yi->osd_vis_w;
802 f.vis_h = yi->osd_vis_h;
803 } else {
804 /* Not tracking the osd, so assume full screen */
805 f.pan_x = 0;
806 f.pan_y = 0;
807 f.vis_w = 720;
808 f.vis_h = yi->decode_height;
809 }
800 810
801 /* Calculate the display window coordinates. Exit if nothing left */ 811 /* Calculate the display window coordinates. Exit if nothing left */
802 if (!(yuv_update = ivtv_yuv_window_setup(itv, &f))) 812 if (!(yuv_update = ivtv_yuv_window_setup(itv, &f)))
@@ -965,12 +975,6 @@ static void ivtv_yuv_setup_frame(struct ivtv *itv, struct ivtv_dma_frame *args)
965 /* Are we going to offset the Y plane */ 975 /* Are we going to offset the Y plane */
966 nf->offset_y = (nf->tru_h + nf->src_x < 512 - 16) ? 1 : 0; 976 nf->offset_y = (nf->tru_h + nf->src_x < 512 - 16) ? 1 : 0;
967 977
968 /* Snapshot the osd pan info */
969 nf->pan_x = yi->osd_x_pan;
970 nf->pan_y = yi->osd_y_pan;
971 nf->vis_w = yi->osd_vis_w;
972 nf->vis_h = yi->osd_vis_h;
973
974 nf->update = 0; 978 nf->update = 0;
975 nf->interlaced_y = 0; 979 nf->interlaced_y = 0;
976 nf->interlaced_uv = 0; 980 nf->interlaced_uv = 0;