From patchwork Sat Jan 16 21:45:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Ospite X-Patchwork-Id: 2472 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Sat, 16 Jan 2010 21:46:13 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.6) for (single-drop); Sat, 16 Jan 2010 19:57:50 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NWGTF-0004IW-50; Sat, 16 Jan 2010 21:46:13 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752346Ab0APVqL (ORCPT + 1 other); Sat, 16 Jan 2010 16:46:11 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752505Ab0APVqK (ORCPT ); Sat, 16 Jan 2010 16:46:10 -0500 Received: from smtp-out112.alice.it ([85.37.17.112]:3523 "EHLO smtp-out112.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750948Ab0APVqJ (ORCPT ); Sat, 16 Jan 2010 16:46:09 -0500 Received: from FBCMMO03.fbc.local ([192.168.68.197]) by smtp-out112.alice.it with Microsoft SMTPSVC(6.0.3790.3959); Sat, 16 Jan 2010 22:46:03 +0100 Received: from FBCMCL01B01.fbc.local ([192.168.69.82]) by FBCMMO03.fbc.local with Microsoft SMTPSVC(6.0.3790.3959); Sat, 16 Jan 2010 22:46:04 +0100 Received: from badebec ([82.57.107.64]) by FBCMCL01B01.fbc.local with Microsoft SMTPSVC(6.0.3790.3959); Sat, 16 Jan 2010 22:46:03 +0100 Received: by badebec with local (Exim 4.71) (envelope-from ) id 1NWGSZ-0005I8-UQ; Sat, 16 Jan 2010 22:45:31 +0100 From: Antonio Ospite To: linux-media@vger.kernel.org Cc: Antonio Ospite , Jean-Francois Moine , Jim Paris , Max Thrun Subject: [PATCH] ov534: fix end of frame handling, make the camera work again. Date: Sat, 16 Jan 2010 22:45:00 +0100 Message-Id: <1263678300-20313-1-git-send-email-ospite@studenti.unina.it> X-Mailer: git-send-email 1.6.6 X-Face: z*RaLf`X<@C75u6Ig9}{oW$H; 1_\2t5)({*|jhM/Vb; ]yA5\I~93>J<_`<4)A{':UrE X-OriginalArrivalTime: 16 Jan 2010 21:46:03.0319 (UTC) FILETIME=[4CCDCC70:01CA96F5] Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Fix a regression, probably introduced in the driver split, which made the ov534 driver unusable: every last packet was discarded because we were mis-calculating the frame size before actually adding the packet. Plus, the debug message should reflect that we discard also packets beyond the expected frame size. Signed-off-by: Antonio Ospite Cc: Max Thrun Acked-by: Jim Paris --- Max, can you test this as well? This should be better than removing all the discard logic at once. After this is in I'll keep working on your changes. Jean-Francois, if this is proven to be the right thing to do, it should go mainline along with the driver split. Thanks, Antonio Ospite -- 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 Index: gspca/linux/drivers/media/video/gspca/ov534.c =================================================================== --- gspca.orig/linux/drivers/media/video/gspca/ov534.c +++ gspca/linux/drivers/media/video/gspca/ov534.c @@ -992,9 +992,9 @@ frame = gspca_get_i_frame(gspca_dev); if (frame == NULL) goto discard; - if (frame->data_end - frame->data != + if (frame->data_end - frame->data + (len - 12) != gspca_dev->width * gspca_dev->height * 2) { - PDEBUG(D_PACK, "short frame"); + PDEBUG(D_PACK, "wrong sized frame"); goto discard; } gspca_frame_add(gspca_dev, LAST_PACKET,