Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6803983ybi; Wed, 5 Jun 2019 06:41:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMSlIgM4e1G/HFbEIz3s/3dhZZSvCukQMt5dc6ze3LZvZHLZd50aCMnmHPQ+DBlVXERh2N X-Received: by 2002:a63:161b:: with SMTP id w27mr4473688pgl.338.1559742070515; Wed, 05 Jun 2019 06:41:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559742070; cv=none; d=google.com; s=arc-20160816; b=HzdieIFQeOZWiVDXmF7//x+iYghaimP1oJnklW9MJG5xTkUlZOW42N+yZ8GekWG6iy 21XjqubGh3MJCCk3a4ii3JKMo5eE+Vz4TjszisGZRGrzOoSLnixTXtLT15WGHvM3gqM7 wORlLLfn3bwS7l0vvG8NyzlvcWNDWtVpV3cXKf6PGDyunMV3E7q9lBYtl6UIlVFh8rYC h0fSSWsXHp1w2yCyYV7yTL90c1HESeGAzw3cCE9w5aTbNYdMhgPZbUO6hZti3fnCB4xW 7KdoMZsxt+/GxfLxK2tyAVmthjX0MUGfyGyu7Gd11JjFAm6Hz6uzSfZxMCvEVsx/Bfv2 Z1qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=/XyngchFf/DlN9FSEKs5t0QGDhmYsn7SLJMCCB8PYS8=; b=HACREGv9mIddcD+t3zXvs+plUI7TksImtdSLPiNPB0dyuWpTo082TMa0JBt6hpgrWz z86tpgUqw1PBQdHR2VbA+CyozEfkZqTxkZYB1aZmcisooMlW16O/ObF5bOwc/76//6B3 BmwlyVCQB606XPJ4zergEVQN2tP3M0Bb6fOZbSeebqPUjSI6yJdo22Gd/qZjj7khsCrD CXiaBvWAtYX27FBVnss6lz6ObZ9ybzJUe0g8WvP0ZRjw8xmG3tC22Rwt0e54wDO1w6Uf uzo2M7OH6ohhYYgKlBrEbNJ4pf1mzYvRoSZrLYozpi6KNbJvd1RORVt4Eyr0RMDByuQc 2jKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7si26914379pgi.408.2019.06.05.06.40.53; Wed, 05 Jun 2019 06:41:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728042AbfFENjr (ORCPT + 99 others); Wed, 5 Jun 2019 09:39:47 -0400 Received: from lb1-smtp-cloud7.xs4all.net ([194.109.24.24]:45351 "EHLO lb1-smtp-cloud7.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727966AbfFENjr (ORCPT ); Wed, 5 Jun 2019 09:39:47 -0400 Received: from [IPv6:2001:420:44c1:2579:c806:4d76:5b3c:eea9] ([IPv6:2001:420:44c1:2579:c806:4d76:5b3c:eea9]) by smtp-cloud7.xs4all.net with ESMTPA id YW8ihmUzN3qlsYW8mhgRsz; Wed, 05 Jun 2019 15:39:44 +0200 Subject: Re: [PATCH v7 2/4] media: videodev2: add V4L2_FMT_FLAG_FIXED_RESOLUTION To: Maxime Jourdan , Mauro Carvalho Chehab , Hans Verkuil Cc: Kevin Hilman , Jerome Brunet , Neil Armstrong , Martin Blumenstingl , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, Philipp Zabel References: <20190531093126.26956-1-mjourdan@baylibre.com> <20190531093126.26956-3-mjourdan@baylibre.com> From: Hans Verkuil Message-ID: <9731b2db-efd4-87d0-c48d-87adec433747@xs4all.nl> Date: Wed, 5 Jun 2019 15:39:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190531093126.26956-3-mjourdan@baylibre.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfL/7ZtmqqJer1hsK60jgZcgv+ioTMnBw2zhprc8Tz/bSylE8VX716nESUCWjidOuDf++DgPrGp2TlmKV5m4/D8Uig0rBNJDhyiYnBcNPYN0uSWQYEbqc iGPqk330/IS2JJurKbAu7zb5CiKZnIF0mh86cRmofiHBhEJpBAvfw+b2ZhBs0791Ti17gyoh1Kb1p+cj8jTcxar9xMevoSncdv+OcQj7vqP9QX3QDu1/V0fw Cjr+Ss9igdPPnCorYJa7CRHkI6LmnZ26jdOuCy2C6GkXKAf6SVG242m4NBWVYP0O4wS3q/QhCD+1UWVihM8BdbN/2RhSH4G9kgp/0oZGV2jvYX76BzgVgyQM 1q1rGgIaYu252pObFB0QHBhd2nxcVRaflTFhSv6QNXOwWqdAiETXCVJ/B0HTr9Zb3/OltbHHB5mo7rrQFCdu4xf/8mCX8/0vgOTTUdDKpLfpCU08YO4blDdv NPpTQMBErTJOwzpD4/R0i6O6lfR0ZIdtbTcCA/VXx8Y+UVRAB9QwVtn9tGLSYyVWjHd7l+TzvFNZ1fbTVjPTIO5NewY9QQCybH3da4oeZ0GBkwCazm3iLiJB guYMTtfR7IUQGlSU2YYVcJJwj/gLClyKMlV6r5DU4Dhs+Kd2kVHTL950rjCC6IKKR7yKnEsKMoShErTrTGGsWxPZPexQf2CbHAjql8hY9QJT1rTSoMwjdDPD c0iwon8trQ0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Maxime, I am wondering if this flag shouldn't be inverted: you set V4L2_FMT_FLAG_DYN_RESOLUTION if dynamic resolution is supported, otherwise it isn't. Can all the existing mainlined codec drivers handle midstream resolution changes? s5p-mfc, venus and mediatek can, but I see no SOURCE_CHANGE event in the coda drivers, so I suspect that that can't handle this. Philipp, what is the status of the coda driver for dynamic resolution changes? Another reason is that AFAIK all encoders are of the fixed resolution type. And a final reason is that usually flags should indicate the presence of a feature, not the absence. Regards, Hans On 5/31/19 11:31 AM, Maxime Jourdan wrote: > When a v4l2 driver exposes V4L2_EVENT_SOURCE_CHANGE, some (usually > OUTPUT) formats may not be able to trigger this event. > > For instance, MPEG2 on Amlogic hardware does not support resolution > switching on the fly, and a decode session must operate at a set > resolution defined before the decoding start. > > Add a enum_fmt format flag to tag those specific formats. > > Signed-off-by: Maxime Jourdan > --- > Documentation/media/uapi/v4l/vidioc-enum-fmt.rst | 6 ++++++ > include/uapi/linux/videodev2.h | 5 +++-- > 2 files changed, 9 insertions(+), 2 deletions(-) > > diff --git a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst > index 822d6730e7d2..b11448a1848b 100644 > --- a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst > +++ b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst > @@ -127,6 +127,12 @@ one until ``EINVAL`` is returned. > - This format is not native to the device but emulated through > software (usually libv4l2), where possible try to use a native > format instead for better performance. > + * - ``V4L2_FMT_FLAG_FIXED_RESOLUTION`` > + - 0x0004 > + - Dynamic resolution switching is not supported for this format, > + even if the event ``V4L2_EVENT_SOURCE_CHANGE`` is supported by > + the device. > + > > > Return Value > diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h > index 1050a75fb7ef..9b0a7f82dd92 100644 > --- a/include/uapi/linux/videodev2.h > +++ b/include/uapi/linux/videodev2.h > @@ -768,8 +768,9 @@ struct v4l2_fmtdesc { > __u32 reserved[4]; > }; > > -#define V4L2_FMT_FLAG_COMPRESSED 0x0001 > -#define V4L2_FMT_FLAG_EMULATED 0x0002 > +#define V4L2_FMT_FLAG_COMPRESSED 0x0001 > +#define V4L2_FMT_FLAG_EMULATED 0x0002 > +#define V4L2_FMT_FLAG_FIXED_RESOLUTION 0x0004 > > /* Frame Size and frame rate enumeration */ > /* >