Commit 0f5f12e4 authored by Deborah Brouwer's avatar Deborah Brouwer Committed by Mauro Carvalho Chehab
Browse files

media: bttv: remove crop info from bttv_buffer



Instead of storing the cropping parameters in each bttv buffer separately,
just use the global bttv crop because it won't change per buffer.

Signed-off-by: default avatarDeborah Brouwer <deborah.brouwer@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 87df33be
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1554,15 +1554,15 @@ static int bttv_prepare_buffer(struct videobuf_queue *q,struct bttv *btv,
	if (buf->vb.width != width || buf->vb.height != height ||
	    buf->vb.field != field ||
	    btv->tvnorm != norm || btv->fmt != fmt ||
	    buf->crop.top != c.rect.top ||
	    buf->crop.left != c.rect.left ||
	    buf->crop.width != c.rect.width ||
	    buf->crop.height != c.rect.height) {
	    btv->crop[!!btv->do_crop].rect.top != c.rect.top ||
	    btv->crop[!!btv->do_crop].rect.left != c.rect.left ||
	    btv->crop[!!btv->do_crop].rect.width != c.rect.width ||
	    btv->crop[!!btv->do_crop].rect.height != c.rect.height) {
		buf->vb.width  = width;
		buf->vb.height = height;
		buf->vb.field  = field;
		btv->tvnorm    = norm;
		buf->crop      = c.rect;
		btv->crop[!!btv->do_crop].rect = c.rect;
		redo_dma_risc = 1;
	}

+6 −6
Original line number Diff line number Diff line
@@ -620,7 +620,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)

		bttv_calc_geo(btv,&buf->geo,buf->vb.width,buf->vb.height,
			      V4L2_FIELD_HAS_BOTH(buf->vb.field),
			      tvnorm,&buf->crop);
			      tvnorm, &btv->crop[!!btv->do_crop].rect);

		switch (buf->vb.field) {
		case V4L2_FIELD_TOP:
@@ -674,7 +674,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
		case V4L2_FIELD_TOP:
			bttv_calc_geo(btv,&buf->geo,buf->vb.width,
				      buf->vb.height,/* both_fields */ 0,
				      tvnorm,&buf->crop);
				      tvnorm, &btv->crop[!!btv->do_crop].rect);
			bttv_risc_planar(btv, &buf->top, dma->sglist,
					 0,buf->vb.width,0,buf->vb.height,
					 uoffset, voffset, btv->fmt->hshift,
@@ -683,7 +683,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
		case V4L2_FIELD_BOTTOM:
			bttv_calc_geo(btv,&buf->geo,buf->vb.width,
				      buf->vb.height,0,
				      tvnorm,&buf->crop);
				      tvnorm, &btv->crop[!!btv->do_crop].rect);
			bttv_risc_planar(btv, &buf->bottom, dma->sglist,
					 0,buf->vb.width,0,buf->vb.height,
					 uoffset, voffset, btv->fmt->hshift,
@@ -692,7 +692,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
		case V4L2_FIELD_INTERLACED:
			bttv_calc_geo(btv,&buf->geo,buf->vb.width,
				      buf->vb.height,1,
				      tvnorm,&buf->crop);
				      tvnorm, &btv->crop[!!btv->do_crop].rect);
			lines    = buf->vb.height >> 1;
			ypadding = buf->vb.width;
			cpadding = buf->vb.width >> btv->fmt->hshift;
@@ -715,7 +715,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
		case V4L2_FIELD_SEQ_TB:
			bttv_calc_geo(btv,&buf->geo,buf->vb.width,
				      buf->vb.height,1,
				      tvnorm,&buf->crop);
				      tvnorm, &btv->crop[!!btv->do_crop].rect);
			lines    = buf->vb.height >> 1;
			ypadding = buf->vb.width;
			cpadding = buf->vb.width >> btv->fmt->hshift;
@@ -746,7 +746,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
		/* build risc code */
		buf->vb.field = V4L2_FIELD_SEQ_TB;
		bttv_calc_geo(btv,&buf->geo,tvnorm->swidth,tvnorm->sheight,
			      1,tvnorm,&buf->crop);
			      1, tvnorm, &btv->crop[!!btv->do_crop].rect);
		bttv_risc_packed(btv, &buf->top,  dma->sglist,
				 /* offset */ 0, RAW_BPL, /* padding */ 0,
				 /* skip_lines */ 0, RAW_LINES);
+0 −1
Original line number Diff line number Diff line
@@ -150,7 +150,6 @@ struct bttv_buffer {
	struct bttv_geometry       geo;
	struct btcx_riscmem        top;
	struct btcx_riscmem        bottom;
	struct v4l2_rect           crop;
	unsigned int               vbi_skip[2];
	unsigned int               vbi_count[2];
};