Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2442275rdg; Mon, 16 Oct 2023 04:58:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPVMw8GWlfE7TbqbPLsv03lJyoLLrMjmt0NXEJNxAU8ObudMMpbMRkns6jPpYyymtVwX4D X-Received: by 2002:a05:6e02:ecc:b0:34f:c9b4:5f9c with SMTP id i12-20020a056e020ecc00b0034fc9b45f9cmr29722908ilk.31.1697457483965; Mon, 16 Oct 2023 04:58:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697457483; cv=none; d=google.com; s=arc-20160816; b=Sf25Um4spRX4XE7sAsDg+1jJ3QtVZOVedpKJw4AC1pp6mKtC58q+RKtEMyEoUq7dfR aOdCytPy4C7Fwl52PtrIEPx7pFIo5J1ZGxOhqeoTMcdl94MAVYZng8KfnpeJzmF3Wnh7 dZcfpxljV8/lm5VNBrA1+CMGBmJysxjdJbvCWSSZiSd5Sjl2giakfmY5eWGTHcLSqIfh drmjYMrcfx0bcumdcCe9IgY0jNIqUWLk9NZFVAqztYfp2gTOOzqtnLv5jC1CdRe7cpJD WJkAZrXgegmPLBzjp3kw2bgWv50e1f8k7xaCp0AZVb1q9JTEV2L7eqoo5WvJFxfpiVTr fOOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id; bh=iWs6ek2Q8THIGH5eSk9XvRiBYS0Gk1gzIuDJrO4BI04=; fh=XXEKpqVcty3qr3mTf845ky5rnW5jr1kw5oCU3bnqc9c=; b=XWcdXl82fJF0PoBFCapuG1DSW620YWcm33bR1nk1xtgppefQqhIs0pVb1O4dajf8zS D0HT+8a2znYSN4bTUemGLNbrhsFJQJJxdv5ph7HkSX1F9hWjNzFV0arjXfeI00fjyN4U lR4iHKuMDBveyr4C1j7YjDGO+eg14AKb3fN4iSENKx4SfDL9vAEf5+ygA5I1ZgCYjz03 PHA/a3Wb/jXWNvRlFazZrTdBjs4PGc/sm7yGh96a/mz3qwzwZdrqV37P+TSdqRK7LsdJ bQbUmLyXf1bo9cuEUh9Vkz2d7zSXcAT/5bx2dr/yiq5VqNjMSnr6yjih6tQUVS93sScv 6i0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id y30-20020a63495e000000b005774aba519asi10372394pgk.118.2023.10.16.04.58.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 04:58:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 39F048048C1E; Mon, 16 Oct 2023 04:58:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232836AbjJPL5r (ORCPT + 99 others); Mon, 16 Oct 2023 07:57:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232268AbjJPL5p (ORCPT ); Mon, 16 Oct 2023 07:57:45 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACA4CF1; Mon, 16 Oct 2023 04:57:42 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 954E8C433C7; Mon, 16 Oct 2023 11:57:38 +0000 (UTC) Message-ID: Date: Mon, 16 Oct 2023 13:57:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v13 5/8] media: chips-media: wave5: Add the v4l2 layer Content-Language: en-US, nl To: Sebastian Fricke , Krzysztof Kozlowski , NXP Linux Team , Conor Dooley , Mauro Carvalho Chehab , Jackson Lee , Sascha Hauer , Rob Herring , Pengutronix Kernel Team , Shawn Guo , Philipp Zabel , Nas Chung , Fabio Estevam Cc: linux-media@vger.kernel.org, Tomasz Figa , linux-kernel@vger.kernel.org, Nicolas Dufresne , kernel@collabora.com, Robert Beckett , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Darren Etheridge References: <20230929-wave5_v13_media_master-v13-0-5ac60ccbf2ce@collabora.com> <20230929-wave5_v13_media_master-v13-5-5ac60ccbf2ce@collabora.com> From: Hans Verkuil Autocrypt: addr=hverkuil@xs4all.nl; keydata= xsFNBFQ84W0BEAC7EF1iL4s3tY8cRTVkJT/297h0Hz0ypA+ByVM4CdU9sN6ua/YoFlr9k0K4 BFUlg7JzJoUuRbKxkYb8mmqOe722j7N3HO8+ofnio5cAP5W0WwDpM0kM84BeHU0aPSTsWiGR yw55SOK2JBSq7hueotWLfJLobMWhQii0Zd83hGT9SIt9uHaHjgwmtTH7MSTIiaY6N14nw2Ud C6Uykc1va0Wqqc2ov5ihgk/2k2SKa02ookQI3e79laOrbZl5BOXNKR9LguuOZdX4XYR3Zi6/ BsJ7pVCK9xkiVf8svlEl94IHb+sa1KrlgGv3fn5xgzDw8Z222TfFceDL/2EzUyTdWc4GaPMC E/c1B4UOle6ZHg02+I8tZicj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vkv0Ilelt3Pb9J7zhcx6sm5T7v16VceF96jG61bnJ2GFS+QZerZp3PY27XgtPxRxYj AmFUeF486PHx/2Yi4u1rQpIpC5inPxIgR1+ZFvQrAV36SvLFfuMhyCAxV6WBlQc85ArOiQZB Wm7L0repwr7zEJFEkdy8C81WRhMdPvHkAIh3RoY1SGcdB7rB3wCzfYkAuCBqaF7Zgfw8xkad KEiQTexRbM1sc/I8ACpla3N26SfQwrfg6V7TIoweP0RwDrcf5PVvwSWsRQp2LxFCkwnCXOra gYmkrmv0duG1FStpY+IIQn1TOkuXrciTVfZY1cZD0aVxwlxXBnUNZZNslldvXFtndxR0SFat sflovhDxKyhFwXOP0Rv8H378/+14TaykknRBIKEc0+lcr+EMOSUR5eg4aURb8Gc3Uc7fgQ6q UssTXzHPyj1hAyDpfu8DzAwlh4kKFTodxSsKAjI45SLjadSc94/5Gy8645Y1KgBzBPTH7Q== In-Reply-To: <20230929-wave5_v13_media_master-v13-5-5ac60ccbf2ce@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 16 Oct 2023 04:58:01 -0700 (PDT) Hi Sebastian, On 12/10/2023 13:01, Sebastian Fricke wrote: > Add the decoder and encoder implementing the v4l2 > API. This patch also adds the Makefile and the VIDEO_WAVE_VPU config > > Signed-off-by: Sebastian Fricke > Signed-off-by: Nicolas Dufresne > Signed-off-by: Deborah Brouwer > Signed-off-by: Robert Beckett > Signed-off-by: Dafna Hirschfeld > Signed-off-by: Nas Chung > --- > drivers/media/platform/chips-media/Kconfig | 1 + > drivers/media/platform/chips-media/Makefile | 1 + > drivers/media/platform/chips-media/wave5/Kconfig | 12 + > drivers/media/platform/chips-media/wave5/Makefile | 10 + > .../platform/chips-media/wave5/wave5-helper.c | 213 +++ > .../platform/chips-media/wave5/wave5-helper.h | 31 + > .../platform/chips-media/wave5/wave5-vpu-dec.c | 1953 ++++++++++++++++++++ > .../platform/chips-media/wave5/wave5-vpu-enc.c | 1794 ++++++++++++++++++ > .../media/platform/chips-media/wave5/wave5-vpu.c | 291 +++ > .../media/platform/chips-media/wave5/wave5-vpu.h | 83 + > .../platform/chips-media/wave5/wave5-vpuapi.h | 2 - > 11 files changed, 4389 insertions(+), 2 deletions(-) > > +static int wave5_vpu_dec_create_bufs(struct file *file, void *priv, > + struct v4l2_create_buffers *create) > +{ > + struct vpu_instance *inst = wave5_to_vpu_inst(priv); > + struct v4l2_format *f = &create->format; > + > + /* Firmware does not support CREATE_BUFS for CAPTURE queues. */ > + if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { > + dev_dbg(inst->dev->dev, > + "%s: VIDIOC_CREATE_BUFS not supported on CAPTURE queues.\n", > + __func__); > + return -EOPNOTSUPP; > + } > + > + return v4l2_m2m_ioctl_create_bufs(file, priv, create); > +} Regarding the EOPNOTSUPP discussion: I discussed this some more with Nicolas on irc, and we wonder if it isn't better to just drop create_bufs support for the wave5 decoder altogether. Is there any point in supporting it for OUTPUT but not CAPTURE? > +static const struct v4l2_ioctl_ops wave5_vpu_dec_ioctl_ops = { > + .vidioc_querycap = wave5_vpu_dec_querycap, > + .vidioc_enum_framesizes = wave5_vpu_dec_enum_framesizes, > + > + .vidioc_enum_fmt_vid_cap = wave5_vpu_dec_enum_fmt_cap, > + .vidioc_s_fmt_vid_cap_mplane = wave5_vpu_dec_s_fmt_cap, > + .vidioc_g_fmt_vid_cap_mplane = wave5_vpu_dec_g_fmt_cap, > + .vidioc_try_fmt_vid_cap_mplane = wave5_vpu_dec_try_fmt_cap, > + > + .vidioc_enum_fmt_vid_out = wave5_vpu_dec_enum_fmt_out, > + .vidioc_s_fmt_vid_out_mplane = wave5_vpu_dec_s_fmt_out, > + .vidioc_g_fmt_vid_out_mplane = wave5_vpu_g_fmt_out, > + .vidioc_try_fmt_vid_out_mplane = wave5_vpu_dec_try_fmt_out, > + > + .vidioc_g_selection = wave5_vpu_dec_g_selection, > + .vidioc_s_selection = wave5_vpu_dec_s_selection, > + > + .vidioc_reqbufs = v4l2_m2m_ioctl_reqbufs, > + .vidioc_querybuf = v4l2_m2m_ioctl_querybuf, > + .vidioc_create_bufs = wave5_vpu_dec_create_bufs, So this would just be dropped. > + .vidioc_prepare_buf = v4l2_m2m_ioctl_prepare_buf, > + .vidioc_qbuf = v4l2_m2m_ioctl_qbuf, > + .vidioc_expbuf = v4l2_m2m_ioctl_expbuf, > + .vidioc_dqbuf = v4l2_m2m_ioctl_dqbuf, > + .vidioc_streamon = v4l2_m2m_ioctl_streamon, > + .vidioc_streamoff = v4l2_m2m_ioctl_streamoff, > + > + .vidioc_try_decoder_cmd = v4l2_m2m_ioctl_try_decoder_cmd, > + .vidioc_decoder_cmd = wave5_vpu_dec_decoder_cmd, > + > + .vidioc_subscribe_event = wave5_vpu_subscribe_event, > + .vidioc_unsubscribe_event = v4l2_event_unsubscribe, > +}; This also means there is no need to document the new EOPNOTSUPP error code in VIDIOC_CREATE_BUFS, or to modify v4l2-compliance. You *do* need to add a comment somewhere explaining why you don't support this ioctl. I think it would be best to do that right after '.vidioc_reqbufs = v4l2_m2m_ioctl_reqbufs,'. Regards, Hans