Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2506159rdg; Mon, 16 Oct 2023 06:41:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2g8uPgWfya1jOB+0rOi9p236Z5QWf6Tq1k3UsWboYfH7hG+/e+VDQEYfYvRvfl2mxpa7i X-Received: by 2002:a05:6a00:a92:b0:690:422f:4f17 with SMTP id b18-20020a056a000a9200b00690422f4f17mr35509460pfl.4.1697463668188; Mon, 16 Oct 2023 06:41:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697463668; cv=none; d=google.com; s=arc-20160816; b=p+tOXiwe9dxyqOpzHep79YTGfFKBXqlID1f09ztFHue3L6ck6PPpWUp4xJ/Gw2Zsm7 2a8r5wDUzcxbg5+dxH8T+EhO8cYHdJEJAZ6H76nYf8MyZKVs69amKI1VkTOMSYld2gDV 4oNLTrnFusKeB8aIoPUH0r5CNhc6fu8Z4aUjfWTMJ05vIinFPmnj31HgerE6ATRk1YO3 XHrd3sUh7TbBxgZReX56Rmd61k8FtGm+q49ZT/3CruyLBYOt7sXz3sAHTu2f8O6vp1/+ qU09CcVPMGElFMlDNLGYMox+Pdv3foXk2XW2/6uaIsGynfApvi7MLD4w4lgSKRACdSLw uTOw== 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=DxoGfEz0O0Ft2ujGuW3GgH4mAQ87Rzn33Rn+zodvlRw=; fh=uwFa0Mg8BIxayyd3wc/CZh7uqRqT/yK0pk4POsNj9DA=; b=fOcgX5c+CmN944FcfEMVDnfJ1B41pR0uK529oGQUVI0EytnqlJarTDdy3yqJsxPW9u 1bun4OOksXrNalbLqPAlfYXDM3LtoFgTCSVUIs0hJUZP6+jz0TQFztQTBLN+peFGAZvK uXVF6/f9N72H7KG3VSldCK1VkKDJPCIdliixwFigk7/5UiCMtx4T/+3NG5wcQtcedWr8 iHfBBcH/BoZJe75UryS3yYojc8D/s1EKzJrgMiUWQzcSqZAjIy3+1JoLmOBy8sj+/LKk MGZ/jGotr/G6XQGNuS/72iSOvxzh8kitrHh/Kf/UUos/O95z8LwccdF+HwR1eiVuWRIy XQJw== 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:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id z10-20020a056a00240a00b0068a6f6d9f7dsi24004313pfh.57.2023.10.16.06.41.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 06:41:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id D236E8087244; Mon, 16 Oct 2023 06:40:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234006AbjJPNkI (ORCPT + 99 others); Mon, 16 Oct 2023 09:40:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234018AbjJPNjx (ORCPT ); Mon, 16 Oct 2023 09:39:53 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B24410E5; Mon, 16 Oct 2023 06:39:50 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26E39C433C8; Mon, 16 Oct 2023 13:39:45 +0000 (UTC) Message-ID: <1c6c0c10-8d00-4a52-ae2f-f481c87faf54@xs4all.nl> Date: Mon, 16 Oct 2023 15:39:44 +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 Cc: 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 , 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> <20231016133539.m3i5crlsknoidim3@basti-XPS-13-9310> From: Hans Verkuil Autocrypt: addr=hverkuil@xs4all.nl; keydata= xsFNBFQ84W0BEAC7EF1iL4s3tY8cRTVkJT/297h0Hz0ypA+ByVM4CdU9sN6ua/YoFlr9k0K4 BFUlg7JzJoUuRbKxkYb8mmqOe722j7N3HO8+ofnio5cAP5W0WwDpM0kM84BeHU0aPSTsWiGR yw55SOK2JBSq7hueotWLfJLobMWhQii0Zd83hGT9SIt9uHaHjgwmtTH7MSTIiaY6N14nw2Ud C6Uykc1va0Wqqc2ov5ihgk/2k2SKa02ookQI3e79laOrbZl5BOXNKR9LguuOZdX4XYR3Zi6/ BsJ7pVCK9xkiVf8svlEl94IHb+sa1KrlgG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FugTMOhq1BG62vUm/F6V91+unyp4dRlyryAeqEuISykhvjZCVHk/woaMZv c1Dm4Uvkv0Ilelt3Pb9J7zhcx6sm5T7v16VceF96jG61bnJ2GFS+QZerZp3PY27XgtPxRxYj AmFUeF486PHx/2Yi4u1rQpIpC5inPxIgR1+ZFvQrAV36SvLFfuMhyCAxV6WBlQc85ArOiQZB Wm7L0repwr7zEJFEkdy8C81WRhMdPvHkAIh3RoY1SGcdB7rB3wCzfYkAuCBqaF7Zgfw8xkad KEiQTexRbM1sc/I8ACpla3N26SfQwrfg6V7TIoweP0RwDrcf5PVvwSWsRQp2LxFCkwnCXOra gYmkrmv0duG1FStpY+IIQn1TOkuXrciTVfZY1cZD0aVxwlxXBnUNZZNslldvXFtndxR0SFat sflovhDxKyhFwXOP0Rv8H378/+14TaykknRBIKEc0+lcr+EMOSUR5eg4aURb8Gc3Uc7fgQ6q UssTXzHPyj1hAyDpfu8DzAwlh4kKFTodxSsKAjI45SLjadSc94/5Gy8645Y1KgBzBPTH7Q== In-Reply-To: <20231016133539.m3i5crlsknoidim3@basti-XPS-13-9310> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 16 Oct 2023 06:40:24 -0700 (PDT) On 16/10/2023 15:35, Sebastian Fricke wrote: > Hey Hans, > > On 16.10.2023 13:57, Hans Verkuil wrote: >> 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,'. > > So, besides this issue would you judge the v4l2 layer of the driver to > be ready? Do you want a reviewed by tag for it or would you take it like > this as well? No, it looks good. Please note though that patch 6/8 (dt-bindings) still needs an Acked/Reviewed-by from the device tree maintainers. There was a comment on it from Krzysztof. Regards, Hans > >> >> Regards, >> >>     Hans > > Sincerly, > Sebastian >> _______________________________________________ >> Kernel mailing list -- kernel@mailman.collabora.com >> To unsubscribe send an email to kernel-leave@mailman.collabora.com