Message ID | 1357333186-8466-11-git-send-email-dheitmueller@kernellabs.com (mailing list archive) |
---|---|
State | Rejected, archived |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from <linux-media-owner@vger.kernel.org>) id 1TrEN8-0007jZ-QM; Fri, 04 Jan 2013 22:00:10 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-2) with esmtp id 1TrEN8-0001gW-Gi; Fri, 04 Jan 2013 22:00:10 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755110Ab3ADVAI (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Fri, 4 Jan 2013 16:00:08 -0500 Received: from mail-vb0-f46.google.com ([209.85.212.46]:61742 "EHLO mail-vb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754944Ab3ADVAD (ORCPT <rfc822; linux-media@vger.kernel.org>); Fri, 4 Jan 2013 16:00:03 -0500 Received: by mail-vb0-f46.google.com with SMTP id b13so16727205vby.5 for <linux-media@vger.kernel.org>; Fri, 04 Jan 2013 13:00:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=y24+Nw1ecGh6nU49RK1EQR3ca06hARFjtCgeKspgkvQ=; b=i0U1QxDFTQ3nm6tjz+rnjS8lXU5gZwdGKsMxYhb4JVjXzqS76pSJkGw5DVymHiZ2ZA lcSYxoTkYhIDxCv9DlxEvIAskP/i/j4WpglIEwqI3eaUv+J8Zqt6BB6aaS9tm691DA4e Kj9tbN4N82QmZR2IMHxHTARsPE4KPQz2VcXFWsCNBAuT3nRmLWXEH9FOFlkAqAT0yYIH 45ma9v9xD9QRfgRYs77AASSeg4Eg/ZYEEpYprVTQhgUCwMGAtuh5a3/spPblAjo2boAG inHCY6Ph/tisKFolJ5L50UEQjVYId2F1d2o3OJAtrwNvxrMn0hhH8lmRdpGKjJhe8cWp RNjA== X-Received: by 10.220.209.74 with SMTP id gf10mr76509739vcb.10.1357333202177; Fri, 04 Jan 2013 13:00:02 -0800 (PST) Received: from devin-ubuntu2.home (pool-108-54-72-165.nycmny.fios.verizon.net. [108.54.72.165]) by mx.google.com with ESMTPS id z20sm47278440vds.12.2013.01.04.13.00.01 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Jan 2013 13:00:01 -0800 (PST) From: Devin Heitmueller <dheitmueller@kernellabs.com> To: linux-media@vger.kernel.org Cc: Devin Heitmueller <dheitmueller@kernellabs.com>, Hans Verkuil <hans.verkuil@cisco.com> Subject: [PATCH 10/15] em28xx: fix broken TRY_FMT. Date: Fri, 4 Jan 2013 15:59:40 -0500 Message-Id: <1357333186-8466-11-git-send-email-dheitmueller@kernellabs.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1357333186-8466-1-git-send-email-dheitmueller@kernellabs.com> References: <1357333186-8466-1-git-send-email-dheitmueller@kernellabs.com> X-Gm-Message-State: ALoCoQlx2F1Tbwb5v4dVE5TC+L6mGqjP/9+5oNI1DAWDZFq84erqgcnMJ+qlFXw+zaCh7rk3AiRR Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.1.4.204815 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1600_1699 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DATE_TZ_NA 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __STOCK_PHRASE_7 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __YOUTUBE_RCVD 0' |
Commit Message
Devin Heitmueller
Jan. 4, 2013, 8:59 p.m. UTC
TRY_FMT should not return an error if a pixelformat is unsupported. Instead just pick a common pixelformat. Also the bytesperline calculation was incorrect: it used the old width instead of the provided with, and it miscalculated the bytesperline value for the depth == 12 case. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> --- drivers/media/usb/em28xx/em28xx-video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Hans/Devin, Em Fri, 4 Jan 2013 15:59:40 -0500 Devin Heitmueller <dheitmueller@kernellabs.com> escreveu: > TRY_FMT should not return an error if a pixelformat is unsupported. Instead just > pick a common pixelformat. > > Also the bytesperline calculation was incorrect: it used the old width instead of > the provided with, and it miscalculated the bytesperline value for the depth == 12 > case. > > Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> > Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> > --- > drivers/media/usb/em28xx/em28xx-video.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c > index a91a248..7c09b55 100644 > --- a/drivers/media/usb/em28xx/em28xx-video.c > +++ b/drivers/media/usb/em28xx/em28xx-video.c > @@ -821,7 +821,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, > if (!fmt) { > em28xx_videodbg("Fourcc format (%08x) invalid.\n", > f->fmt.pix.pixelformat); > - return -EINVAL; > + fmt = format_by_fourcc(V4L2_PIX_FMT_YUYV); This change has the potential of causing userspace regressions, so, for now, I won't apply such change. We need to discuss it better, before risk breaking things, and likely fix applications first. Regards, Mauro -- 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
On Sat January 5 2013 03:54:44 Mauro Carvalho Chehab wrote: > Hans/Devin, > > Em Fri, 4 Jan 2013 15:59:40 -0500 > Devin Heitmueller <dheitmueller@kernellabs.com> escreveu: > > > TRY_FMT should not return an error if a pixelformat is unsupported. Instead just > > pick a common pixelformat. > > > > Also the bytesperline calculation was incorrect: it used the old width instead of > > the provided with, and it miscalculated the bytesperline value for the depth == 12 > > case. > > > > Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> > > Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> > > --- > > drivers/media/usb/em28xx/em28xx-video.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c > > index a91a248..7c09b55 100644 > > --- a/drivers/media/usb/em28xx/em28xx-video.c > > +++ b/drivers/media/usb/em28xx/em28xx-video.c > > @@ -821,7 +821,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, > > if (!fmt) { > > em28xx_videodbg("Fourcc format (%08x) invalid.\n", > > f->fmt.pix.pixelformat); > > - return -EINVAL; > > + fmt = format_by_fourcc(V4L2_PIX_FMT_YUYV); > > This change has the potential of causing userspace regressions, so, > for now, I won't apply such change. Good! > We need to discuss it better, before risk breaking things, and likely fix > applications first. Absolutely. I also want to change this test in v4l2-compliance from 'failure' to 'warning' for the time being. Regards, Hans -- 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
Em Sat, 5 Jan 2013 14:34:04 +0100 Hans Verkuil <hverkuil@xs4all.nl> escreveu: > On Sat January 5 2013 03:54:44 Mauro Carvalho Chehab wrote: > > Hans/Devin, > > > > Em Fri, 4 Jan 2013 15:59:40 -0500 > > Devin Heitmueller <dheitmueller@kernellabs.com> escreveu: > > > > > TRY_FMT should not return an error if a pixelformat is unsupported. Instead just > > > pick a common pixelformat. > > > > > > Also the bytesperline calculation was incorrect: it used the old width instead of > > > the provided with, and it miscalculated the bytesperline value for the depth == 12 > > > case. > > > > > > Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> > > > Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> > > > --- > > > drivers/media/usb/em28xx/em28xx-video.c | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c > > > index a91a248..7c09b55 100644 > > > --- a/drivers/media/usb/em28xx/em28xx-video.c > > > +++ b/drivers/media/usb/em28xx/em28xx-video.c > > > @@ -821,7 +821,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, > > > if (!fmt) { > > > em28xx_videodbg("Fourcc format (%08x) invalid.\n", > > > f->fmt.pix.pixelformat); > > > - return -EINVAL; > > > + fmt = format_by_fourcc(V4L2_PIX_FMT_YUYV); > > > > This change has the potential of causing userspace regressions, so, > > for now, I won't apply such change. > > Good! > > > We need to discuss it better, before risk breaking things, and likely fix > > applications first. > > Absolutely. I also want to change this test in v4l2-compliance from 'failure' > to 'warning' for the time being. Sounds reasonable for me. Regards, Mauro -- 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 --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index a91a248..7c09b55 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -821,7 +821,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, if (!fmt) { em28xx_videodbg("Fourcc format (%08x) invalid.\n", f->fmt.pix.pixelformat); - return -EINVAL; + fmt = format_by_fourcc(V4L2_PIX_FMT_YUYV); } if (dev->board.is_em2800) { @@ -847,7 +847,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, f->fmt.pix.width = width; f->fmt.pix.height = height; f->fmt.pix.pixelformat = fmt->fourcc; - f->fmt.pix.bytesperline = (dev->width * fmt->depth + 7) >> 3; + f->fmt.pix.bytesperline = width * ((fmt->depth + 7) >> 3); f->fmt.pix.sizeimage = f->fmt.pix.bytesperline * height; f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; if (dev->progressive)