From patchwork Sat Jan 10 19:16:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 1712 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n0AJUjaA017717 for ; Sat, 10 Jan 2009 11:30:46 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753459AbZAJTe1 (ORCPT ); Sat, 10 Jan 2009 14:34:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753430AbZAJTe0 (ORCPT ); Sat, 10 Jan 2009 14:34:26 -0500 Received: from cinke.fazekas.hu ([195.199.244.225]:34971 "EHLO cinke.fazekas.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753345AbZAJTeZ (ORCPT ); Sat, 10 Jan 2009 14:34:25 -0500 X-Greylist: delayed 949 seconds by postgrey-1.27 at vger.kernel.org; Sat, 10 Jan 2009 14:34:24 EST Received: from localhost (localhost [127.0.0.1]) by cinke.fazekas.hu (Postfix) with ESMTP id 9E34A33CC7; Sat, 10 Jan 2009 20:18:33 +0100 (CET) X-Virus-Scanned: amavisd-new at fazekas.hu Received: from cinke.fazekas.hu ([127.0.0.1]) by localhost (cinke.fazekas.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id s6HjLSNbnnrh; Sat, 10 Jan 2009 20:18:30 +0100 (CET) Received: from roadrunner.athome (localhost [127.0.0.1]) by cinke.fazekas.hu (Postfix) with ESMTP id 2760C33CC3; Sat, 10 Jan 2009 20:18:30 +0100 (CET) MIME-Version: 1.0 Subject: [PATCH] cx88: fix unexpected video resize when setting tv norm X-Mercurial-Node: 571b3176dc82a7206ade1274b9e1dcd4d8bbe4f1 Message-Id: <571b3176dc82a7206ade.1231614963@roadrunner.athome> Date: Sat, 10 Jan 2009 20:16:03 +0100 From: Marton Balint To: linux-media@vger.kernel.org Cc: mchehab@infradead.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org # HG changeset patch # User Marton Balint # Date 1231614067 -3600 # Node ID 571b3176dc82a7206ade1274b9e1dcd4d8bbe4f1 # Parent 985ecd81d993b4473cb644a4c1f9e36b840cef0b cx88: fix unexpected video resize when setting tv norm From: Marton Balint Cx88_set_tvnorm sets the size of the video to fixed 320x240. This is ugly at least, but also can cause problems, if it happens during an active video transfer. With this patch, cx88_set_scale will save the last requested video size, and cx88_set_tvnorm will scale the video to this size. Priority: normal Signed-off-by: Marton Balint --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -r 985ecd81d993 -r 571b3176dc82 linux/drivers/media/video/cx88/cx88-cards.c --- a/linux/drivers/media/video/cx88/cx88-cards.c Fri Jan 09 10:07:07 2009 -0200 +++ b/linux/drivers/media/video/cx88/cx88-cards.c Sat Jan 10 20:01:07 2009 +0100 @@ -3176,6 +3176,10 @@ info_printk(core, "TV tuner type %d, Radio tuner type %d\n", core->board.tuner_type, core->board.radio_type); + core->last_width = 320; + core->last_height = 240; + core->last_field = V4L2_FIELD_INTERLACED; + /* init hardware */ cx88_reset(core); cx88_card_setup_pre_i2c(core); diff -r 985ecd81d993 -r 571b3176dc82 linux/drivers/media/video/cx88/cx88-core.c --- a/linux/drivers/media/video/cx88/cx88-core.c Fri Jan 09 10:07:07 2009 -0200 +++ b/linux/drivers/media/video/cx88/cx88-core.c Sat Jan 10 20:01:07 2009 +0100 @@ -715,6 +715,10 @@ unsigned int sheight = norm_maxh(core->tvnorm); u32 value; + core->last_width = width; + core->last_height = height; + core->last_field = field; + dprintk(1,"set_scale: %dx%d [%s%s,%s]\n", width, height, V4L2_FIELD_HAS_TOP(field) ? "T" : "", V4L2_FIELD_HAS_BOTTOM(field) ? "B" : "", @@ -1014,7 +1018,7 @@ cx_write(MO_VBI_PACKET, (10<<11) | norm_vbipack(norm)); // this is needed as well to set all tvnorm parameter - cx88_set_scale(core, 320, 240, V4L2_FIELD_INTERLACED); + cx88_set_scale(core, core->last_width, core->last_height, core->last_field); // audio set_tvaudio(core); diff -r 985ecd81d993 -r 571b3176dc82 linux/drivers/media/video/cx88/cx88.h --- a/linux/drivers/media/video/cx88/cx88.h Fri Jan 09 10:07:07 2009 -0200 +++ b/linux/drivers/media/video/cx88/cx88.h Sat Jan 10 20:01:07 2009 +0100 @@ -352,6 +352,9 @@ u32 input; u32 astat; u32 use_nicam; + unsigned int last_width; + unsigned int last_height; + enum v4l2_field last_field; /* IR remote control state */ struct cx88_IR *ir;