From patchwork Mon Feb 11 10:13:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 10805459 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 306A913A4 for ; Mon, 11 Feb 2019 10:14:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F49C283B2 for ; Mon, 11 Feb 2019 10:14:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1029F28712; Mon, 11 Feb 2019 10:14:05 +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,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 11DB4283B2 for ; Mon, 11 Feb 2019 10:14:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726208AbfBKKOC (ORCPT ); Mon, 11 Feb 2019 05:14:02 -0500 Received: from lb1-smtp-cloud9.xs4all.net ([194.109.24.22]:44868 "EHLO lb1-smtp-cloud9.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725931AbfBKKOC (ORCPT ); Mon, 11 Feb 2019 05:14:02 -0500 Received: from tschai.fritz.box ([212.251.195.8]) by smtp-cloud9.xs4all.net with ESMTPA id t8b7gs8zWRO5Zt8bAg3Gn7; Mon, 11 Feb 2019 11:14:00 +0100 From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Dafna Hirschfeld , Paul Kocialkowski , Ezequiel Garcia Subject: [PATCHv2 0/6] vb2/v4l2-ctrls: check if requests are required Date: Mon, 11 Feb 2019 11:13:51 +0100 Message-Id: <20190211101357.48754-1-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CMAE-Envelope: MS4wfNRGBHM9Ix86ag92NrY8IVmxjtldnYwJqdalxYQhwBA7/ZqPaGeQT15a6m5Bdd8UQ5KZbjRVm3r/kigJ2jw0iO2vJPQvRrHwLalX22qjz4Llo22z4hdl dobOQrkoPrtBoVY4u8UVQMh+nqRmAgaktp/WWAshjqp9Gq3eXzXtaYEjypEUk8pGZaOzEId9iPVfc1mrvu7ytvBPvXZOrxBwXVCk0MXUK8qLtU3gWsE3aZhI 2Bub7vhZk/pC8i2t4Ga5s+hz1YCFq6elqNlqfj55JmlXb4SmCTL/BOhFN5rWdhhu 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 Currently the vb2 supports_requests bitfield only indicates if the Request API is supported by the vb2_queue. But for stateless codecs the use of the Request API is actually a requirement. So add a requires_requests bitfield and corresponding capability to indicate that userspace has to use requests. And of course reject direct VIDIOC_QBUF calls (i.e. V4L2_BUF_FLAG_REQUEST_FD isn't set) if requires_requests is set. Finally set this bitfield in the cedrus driver. Do the same for controls: it makes no sense to set state controls for stateless codecs directly without going through a request. Add a new flag to indicate this and check it. Regards, Hans Hans Verkuil (6): vb2: add requires_requests bit for stateless codecs videodev2.h: add V4L2_BUF_CAP_REQUIRES_REQUESTS cedrus: set requires_requests videodev2.h: add V4L2_CTRL_FLAG_REQUIRES_REQUESTS v4l2-ctrls: check for REQUIRES_REQUESTS flag v4l2-ctrls: mark MPEG2 stateless controls as REQUIRES_REQUESTS .../media/uapi/v4l/vidioc-queryctrl.rst | 4 ++++ .../media/uapi/v4l/vidioc-reqbufs.rst | 4 ++++ .../media/videodev2.h.rst.exceptions | 1 + .../media/common/videobuf2/videobuf2-core.c | 5 +++- .../media/common/videobuf2/videobuf2-v4l2.c | 6 +++++ drivers/media/v4l2-core/v4l2-ctrls.c | 5 ++++ .../staging/media/sunxi/cedrus/cedrus_video.c | 1 + include/media/videobuf2-core.h | 3 +++ include/uapi/linux/videodev2.h | 24 ++++++++++--------- 9 files changed, 41 insertions(+), 12 deletions(-)