From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91775C433E1 for ; Wed, 15 Jul 2020 11:59:19 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 60DDA20658 for ; Wed, 15 Jul 2020 11:59:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="0Z0SQ0vg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 60DDA20658 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Date:To:From: Subject:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LFyJfuxF4fujzC3LZF0inbkVK2+j9cRIZAGoza0aDbs=; b=0Z0SQ0vgF22BAk8ecTa5ODsba uImzE+WEZDCK3GpV8gaafyPEgWG3XNTWNVQ03ONt3lQBtd6GIPgKozJKK9BVJL5GqEFAZNvVpLmoS 60NvVtgbuDBPge3jkaAqUFW4yBePl/i3StMTRI3BgdoLHw7MvlEmUmIOECZRrEBh7jcUwRv/W17Z1 RSl26PDf4SVWH9PMxu8EoA6iiqOYKZTNoyH0cBVGIxD36EHYwPRjSsCu/KkZUs/VbCJs8CWIxf7Rd pdr6KCOeK+mHFafT04Fy5C8xwsZ1f4wwzsuSAlmgvvs8iW/r2/y+VSpxnQ41tip5GF5nxKBMbtHFW niLIgFvZw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvg33-0004f5-6J; Wed, 15 Jul 2020 11:58:05 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvg30-0004dg-0i for linux-arm-kernel@lists.infradead.org; Wed, 15 Jul 2020 11:58:03 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id 206512A06C6 Message-ID: <3c8a235ebb0bf76bcffeb8c6b983cd4c95d77459.camel@collabora.com> Subject: Re: [PATCH] media: cedrus: Propagate OUTPUT resolution to CAPTURE From: Ezequiel Garcia To: Nicolas Dufresne , Hans Verkuil Date: Wed, 15 Jul 2020 08:57:50 -0300 In-Reply-To: <20200514153903.341287-1-nicolas.dufresne@collabora.com> References: <20200514153903.341287-1-nicolas.dufresne@collabora.com> Organization: Collabora User-Agent: Evolution 3.36.3-1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200715_075802_172056_AD2D5FDD X-CRM114-Status: GOOD ( 17.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, kernel@collabora.com, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Maxime Ripard , Paul Kocialkowski , Chen-Yu Tsai , stable@vger.kernel.org, Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org It seems this one felt thru the cracks. Sorry for the delay. On Thu, 2020-05-14 at 11:39 -0400, Nicolas Dufresne wrote: > As per spec, the CAPTURE resolution should be automatically set based on > the OTUPUT resolution. This patch properly propagate width/height to the > capture when the OUTPUT format is set and override the user provided > width/height with configured OUTPUT resolution when the CAPTURE fmt is > updated. > > This also prevents userspace from selecting a CAPTURE resolution that is > too small, avoiding unwanted page faults. > > Signed-off-by: Nicolas Dufresne This looks correct. Reviewed-by: Ezequiel Garcia Thanks, Ezequiel > --- > drivers/staging/media/sunxi/cedrus/cedrus_video.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c > index 16d82309e7b6..a6d6b15adc2e 100644 > --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c > @@ -247,6 +247,8 @@ static int cedrus_try_fmt_vid_cap(struct file *file, void *priv, > return -EINVAL; > > pix_fmt->pixelformat = fmt->pixelformat; > + pix_fmt->width = ctx->src_fmt.width; > + pix_fmt->height = ctx->src_fmt.height; > cedrus_prepare_format(pix_fmt); > > return 0; > @@ -319,11 +321,14 @@ static int cedrus_s_fmt_vid_out(struct file *file, void *priv, > break; > } > > - /* Propagate colorspace information to capture. */ > + /* Propagate format information to capture. */ > ctx->dst_fmt.colorspace = f->fmt.pix.colorspace; > ctx->dst_fmt.xfer_func = f->fmt.pix.xfer_func; > ctx->dst_fmt.ycbcr_enc = f->fmt.pix.ycbcr_enc; > ctx->dst_fmt.quantization = f->fmt.pix.quantization; > + ctx->dst_fmt.width = ctx->src_fmt.width; > + ctx->dst_fmt.height = ctx->src_fmt.height; > + cedrus_prepare_format(&ctx->dst_fmt); > > return 0; > } > -- > 2.26.2 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel