From patchwork Sun Jun 9 14:38:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Jourdan X-Patchwork-Id: 10983711 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D35C1850 for ; Sun, 9 Jun 2019 14:38:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69F8B28870 for ; Sun, 9 Jun 2019 14:38:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E0F028901; Sun, 9 Jun 2019 14:38:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BC3528870 for ; Sun, 9 Jun 2019 14:38:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728838AbfFIOi0 (ORCPT ); Sun, 9 Jun 2019 10:38:26 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:56130 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728609AbfFIOi0 (ORCPT ); Sun, 9 Jun 2019 10:38:26 -0400 Received: by mail-wm1-f68.google.com with SMTP id a15so6169460wmj.5 for ; Sun, 09 Jun 2019 07:38:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CE1rzNxQnjE+caruaG8A/jvqyGBc4r1TmXQ6RF+W7r8=; b=OZGpNkuY28eTyFO+q6PIXrKFPCtobyAO7hNR6Or7mW2syFjmAhOrxbJnX6jbRyFt5h 820TN+hqeqLwfrU/K8I5V1xrKeAGMY22CngaIdVAbkhmtMK6kb4fgJNruicHvhb+FGBK BaJVevsB0JnvCag6G3BeaEYhQEtdR5URbzXXz5HFEujzmRgVcAz8Fk1ksbQPY4BB9UR1 BMHAv3Hq+R6UtRPQXhdCD4bS6qdaxkfU3ZTzegnfaw1jLexZM5/lNjiFknfMdh++lf49 Fily4NF6PC1cTDU+EHcm7fV1B+6pMiE/tLEGPepyOmrHOP6OMKv2I/ZiN0HZ1YWffKNj Q1Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CE1rzNxQnjE+caruaG8A/jvqyGBc4r1TmXQ6RF+W7r8=; b=obzE9KuZBbHPsECxF3XtxFJkK8OZnj6vts3PjzdegrqIX8O5Q+H6pfvwcqQlURPoVd GM/ajrf6CTAQU4UACdhGr6lY6dp+9rbFTFKjiF5Cicq4V57oRHb9CtDGNH9h53qRYLdn QUHu7HI9GIcDljTvsmC+Qqo6vvxbS3S5BGxv4PAEn4+qhmx0qyioISUJl+xiiXMBh0PC QCyXbRjrKC8p16vMjiN2BHaOcBQmhHktP68NmpmCxkuX8bu+LPBl5i+r5LPv6eKRoHHt ZMq/29TEfcdZYl3He6+OXTx9T+LNrIj982gGS1EQbZ0PFK9EAUes9G/fJOv05UOJ2wih hmOw== X-Gm-Message-State: APjAAAWifgZlKc22/QIwvclJ9Oa/IrkEtVPw6xBryo5fBasIJNCd7/Ld NXxWN8s/2VpjOoERGkWZBSZUpQ== X-Google-Smtp-Source: APXvYqy+zfvEtsLMh96gQYo+Pb7hhNdiyMNv8bfwtVaWYX7tX/V9mj8B0+cEXWzbK6zSuEWjOQeg+A== X-Received: by 2002:a1c:cc02:: with SMTP id h2mr10084349wmb.13.1560091104528; Sun, 09 Jun 2019 07:38:24 -0700 (PDT) Received: from mjourdan-pc.numericable.fr (abo-99-183-68.mtp.modulonet.fr. [85.68.183.99]) by smtp.gmail.com with ESMTPSA id c17sm6047713wrv.82.2019.06.09.07.38.23 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 09 Jun 2019 07:38:24 -0700 (PDT) From: Maxime Jourdan To: Hans Verkuil , Mauro Carvalho Chehab , Tomasz Figa , linux-media@vger.kernel.org Cc: Laurent Pinchart , Stanimir Varbanov , Tiffany Lin , Andrew-CT Chen , Kyungmin Park , Kamil Debski , Jeongtae Park , Andrzej Hajda Subject: [RFC PATCH 1/5] media: videodev2: add V4L2_FMT_FLAG_DYN_RESOLUTION Date: Sun, 9 Jun 2019 16:38:16 +0200 Message-Id: <20190609143820.4662-2-mjourdan@baylibre.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190609143820.4662-1-mjourdan@baylibre.com> References: <20190609143820.4662-1-mjourdan@baylibre.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a enum_fmt format flag to specifically tag coded formats where dynamic resolution switching is supported by the device. This is useful for some codec drivers that can't support dynamic resolution switching for all their listed coded formats. It allows userspace to know whether it should extract the video parameters itself, or if it can rely on the device to send V4L2_EVENT_SOURCE_CHANGE when such changes are detected. Signed-off-by: Maxime Jourdan --- Documentation/media/uapi/v4l/vidioc-enum-fmt.rst | 7 +++++++ include/uapi/linux/videodev2.h | 5 +++-- 2 files changed, 10 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..92ddd4ddbce2 100644 --- a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst +++ b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst @@ -127,6 +127,13 @@ 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_DYN_RESOLUTION`` + - 0x0004 + - Dynamic resolution switching is supported by the device for this + coded format. It will notify the user via the event + ``V4L2_EVENT_SOURCE_CHANGE`` when changes in the video parameters + are detected. + Return Value diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 1050a75fb7ef..834550e20ee7 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_DYN_RESOLUTION 0x0004 /* Frame Size and frame rate enumeration */ /*