From 9af8121508d81fa7c7979ee74c624cfa5f6fa227 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 30 Aug 2006 19:52:14 -0300 Subject: Fix scaling calculus From: Mauro Carvalho Chehab Thanks-to: Hans Verkuil for testing it on ivtv. Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/saa7115.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'linux') diff --git a/linux/drivers/media/video/saa7115.c b/linux/drivers/media/video/saa7115.c index 2259d318a..54336578a 100644 --- a/linux/drivers/media/video/saa7115.c +++ b/linux/drivers/media/video/saa7115.c @@ -1093,22 +1093,22 @@ static int saa711x_set_size(struct i2c_client *client, int width, int height) saa711x_write(client, R_CD_B_HORIZ_OUTPUT_WINDOW_LENGTH_MSB, (u8) ((width >> 8) & 0xff)); + /* Vertical Scaling uses height/2 */ + res=height/2; + + /*FIXME: This code seems weird, however, this is how it is + * working right now. + */ if (height == Vsrc) { - /*FIXME: This code seems weird, however, this is how it is - working right now. - */ - res=height/2; if (!is_50hz) res+=8; - } else - res=height; + } /* height */ saa711x_write(client, R_CE_B_VERT_OUTPUT_WINDOW_LENGTH, (u8) (res & 0xff)); saa711x_write(client, R_CF_B_VERT_OUTPUT_WINDOW_LENGTH_MSB, - (u8) (res & 0xff)); - + (u8) ((res >> 8) & 0xff)); /* Scaling settings */ /* Hprescaler is floor(inres/outres) */ -- cgit v1.2.3