From patchwork Wed Jul 1 09:35:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunfei Dong X-Patchwork-Id: 11635927 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 07592739 for ; Wed, 1 Jul 2020 09:36:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E3190206C3 for ; Wed, 1 Jul 2020 09:36:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="pBU+7Id1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729525AbgGAJgE (ORCPT ); Wed, 1 Jul 2020 05:36:04 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:33687 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729156AbgGAJgD (ORCPT ); Wed, 1 Jul 2020 05:36:03 -0400 X-UUID: 334d10a69c5e4b4db150b328e848eb6a-20200701 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=JmH2i1K1LVRfQ5H7fZWEmVhisTSm9PDFTAU2k91Y8VA=; b=pBU+7Id1echOHiDolArMMpizj6NcCPxHmoFQD7NiBDIZU9z67XfET3R9dBG8YMLVr2E9HR0k5fdlcI2VuJfXLTlZYo7h4Tj6eTXnsoIzq02s2Fj14zSHeGmxVWuaap+P+6RiaMciZLU7ivj3nJmKpykGTD9Q+FU0iYa5z05o9vQ=; X-UUID: 334d10a69c5e4b4db150b328e848eb6a-20200701 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1774990996; Wed, 01 Jul 2020 17:36:00 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 1 Jul 2020 17:35:50 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 1 Jul 2020 17:35:50 +0800 From: Yunfei Dong To: Hans Verkuil , Tiffany Lin , Rob Herring CC: Yunfei Dong , Mauro Carvalho Chehab , Mark Rutland , Matthias Brugger , , , , , , Tomasz Figa , Alexandre Courbot Subject: [PATCH v3, 0/2] This patchset add read-only(Ro) request for capture queue Date: Wed, 1 Jul 2020 17:35:20 +0800 Message-ID: <20200701093522.8521-1-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-TM-SNTS-SMTP: 098F809224606EF2751969BA6E6369678673A6DDE0F23228BF1043BDAABBF46B2000:8 X-MTK: N Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hello, User driver need to get HDR10+ information for each capture buffer; For some encoder cases, user driver need to get encoded message for each frame. So add support read-only(Ro) request for capture queue. There is no upstream driver to use this feature at now, but we are developing internal driver to use it. If it is ready, we will try to upstream vdec/venc driver based on this feature. ============== Introduction ============== Ro request mean that user driver just can get ext ctrls, set ext ctrls is not not allowed. Ro Request also can be used in output queue. Add param ro_requests in struct v4l2_ctrl_handler mean that all CID ctrls belong to this ctrl handler is read only. Add param ro_ctrl_handler in struct v4l2_fh used for Ro request. Add param supports_ro_requests in struct vb2_queue present that capture or output queue use Ro request. When set/get ext ctrls, will check whether current CID ctrls is ro ctrls or not using function v4l2_check_ro_ext_ctrls(). ================ Changes in v3 ================ -change cover-letter message -change commit message for patch 02/02 -add sanity check in vb2_core_queue_init() Yunfei Dong (2): media: v4l UAPI: add V4L2_BUF_CAP_SUPPORTS_RO_REQUESTS media: v4l: Add Ro request api for capture queue .../media/v4l/vidioc-reqbufs.rst | 4 + .../media/common/videobuf2/videobuf2-core.c | 3 + .../media/common/videobuf2/videobuf2-v4l2.c | 7 ++ drivers/media/mc/mc-request.c | 10 +- drivers/media/v4l2-core/v4l2-ctrls.c | 107 +++++++++++++++--- drivers/media/v4l2-core/v4l2-ioctl.c | 22 ++++ drivers/media/v4l2-core/v4l2-mem2mem.c | 19 ++-- include/media/v4l2-ctrls.h | 22 +++- include/media/v4l2-fh.h | 2 + include/media/videobuf2-core.h | 2 + include/uapi/linux/videodev2.h | 1 + 11 files changed, 161 insertions(+), 38 deletions(-)