From patchwork Tue May 14 13:56:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Jourdan X-Patchwork-Id: 10943035 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 3EF33924 for ; Tue, 14 May 2019 13:56:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C51428715 for ; Tue, 14 May 2019 13:56:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FDBB28718; Tue, 14 May 2019 13:56:55 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B340C28715 for ; Tue, 14 May 2019 13:56:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dERYFpNqF2Z8mHMXRV6pmyQ4LkDePfysAuuS2lmi9bY=; b=NIp0FH87NxUcyK 0P3XzceP/nRJTmgn2ee0HnyV1fBBR7ak1wda4dRXbCiicowNDn6e4TrVR9TujQ77E8ovm12FPb4yC 8Q1eeX+8wkzqfiFgAONhYJ5Qke7v5y0RzYu1cn+Pq3QQLWaLuyBJORPXji1RaShba+yqmK08L3bFA Mu4/O5YmJ9M2yGqtTsyOiH09J5AclZl8PGYEyYAOl9vy48tC+Pxk16X0Q8NPPRtWUlVsV+xc4wVcA UQfPk9scmQYulAog3LqCoQWyR30+O+nrkwq/EpJrTr8b5pbxr+/oYbSNqGoMzDHKfrM2/RFgW6bCL BAoXZ+bNSGMQ8+B+sYYg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hQXvC-0001Nw-PI; Tue, 14 May 2019 13:56:46 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hQXun-0000rn-Ao for linux-arm-kernel@lists.infradead.org; Tue, 14 May 2019 13:56:22 +0000 Received: by mail-wm1-x342.google.com with SMTP id c66so2435714wme.0 for ; Tue, 14 May 2019 06:56:20 -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=oDHxGsrXeJidj701untt/R6ogKG8h4nrtZU+2E4/fDA=; b=Lac0zP3MgQDHm22bQE4nSrkyNe8uukQesol88+EA7fgTIY6grTc10fcGmsh3CQo5NT SQDJGdzVXFupyQ8yU+5K4a9W2KYoCjvoMj1wbCM0yMPAgwMAELJFEZAoTLYJaOiHzc4t HLolkemGtcdytaw3wngI2rM+VY2A1xnWlyBCifi85baEtTOzFqndDgdxcZiCSaYi8n5z ZF+Nz+A05FvWbfUlEwKqXt4cgZ8DppFR33frFEoFlniGFd4qPz8bBPYED51Se9BeC+zl p5TeAv5AL/GTHRweqp2FwNWdHSWWfHWShipgGGZ8PnBtQCGQUm4V5SPH8eS1DRt+/v96 8b8g== 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=oDHxGsrXeJidj701untt/R6ogKG8h4nrtZU+2E4/fDA=; b=r4KGzhRH7Lsq8RYr+4FRLH4WV7DRXETOwJUz7q4ejfdUBZpm8iwjYs6RM7Y7nt2qTE uV519XEoF4rA2eIPNFhrvCwbDT4xc4avYEMEcnM6fUDnl2Vxi41pYi/Ajs3OFcxoneEA tDmzDj/4AK6XY8GBJcCTCRLIYdXGNFbGDyMvX2GtzozEHv+6Xni7GMRWAAXod8/1n7u1 4siBfO1HU/re/VDet8sRZJsr25mtHraNeRBLNwT2NjF/TAjojh4z+ghyxkc5cg9HGERu tyQD18N3rbnY/e07ve4c+NSCmCWZWxukqZeHgx/QfRpoH6W+p0Ep/NK6OeY04d77Xzxz Axmg== X-Gm-Message-State: APjAAAVq7rb79KF2vD8a4BtJyuo+g0sChRELaX4lN4YjlqxfFSA3b2wD HOhiz24fr2jUsg9h4GxDYyEY4WQI0Fw= X-Google-Smtp-Source: APXvYqysQhF099GYmS3TpeXdPijkIZtr1HbM/ak442MCB8g0sFSjtVD5TgYPOjSACa7qTnYfThZICw== X-Received: by 2002:a1c:701a:: with SMTP id l26mr19416389wmc.50.1557842178935; Tue, 14 May 2019 06:56:18 -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 d72sm1375764wmd.12.2019.05.14.06.56.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 May 2019 06:56:18 -0700 (PDT) From: Maxime Jourdan To: Mauro Carvalho Chehab Subject: [PATCH v6 2/4] media: videodev2: add V4L2_FMT_FLAG_FIXED_RESOLUTION Date: Tue, 14 May 2019 15:56:10 +0200 Message-Id: <20190514135612.30822-3-mjourdan@baylibre.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190514135612.30822-1-mjourdan@baylibre.com> References: <20190514135612.30822-1-mjourdan@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190514_065621_378798_E7BCF0D3 X-CRM114-Status: GOOD ( 13.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Jourdan , Neil Armstrong , Martin Blumenstingl , Kevin Hilman , linux-kernel@vger.kernel.org, Hans Verkuil , linux-amlogic@lists.infradead.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jerome Brunet Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 */ /*