From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans Verkuil Subject: Re: [PATCH v4 5/8] [Media] vcodec: mediatek: Add Mediatek V4L2 Video Encoder Driver Date: Sat, 20 Feb 2016 10:18:24 +0100 Message-ID: <56C82F60.4060304@xs4all.nl> References: <1454585703-42428-1-git-send-email-tiffany.lin@mediatek.com> <1454585703-42428-2-git-send-email-tiffany.lin@mediatek.com> <1454585703-42428-3-git-send-email-tiffany.lin@mediatek.com> <1454585703-42428-4-git-send-email-tiffany.lin@mediatek.com> <1454585703-42428-5-git-send-email-tiffany.lin@mediatek.com> <1454585703-42428-6-git-send-email-tiffany.lin@mediatek.com> <56C1B4AF.1030207@xs4all.nl> <1455604653.19396.68.camel@mtksdaap41> <56C2D371.9090805@xs4all.nl> <1455959480.12533.11.camel@mtksdaap41> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1455959480.12533.11.camel@mtksdaap41> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: tiffany lin Cc: Hans Verkuil , daniel.thompson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, Rob Herring , Mauro Carvalho Chehab , Matthias Brugger , Daniel Kurtz , Pawel Osciak , Eddie Huang , Yingjoe Chen , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, PoChun.Lin-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org, Andrew-CT Chen List-Id: linux-mediatek@lists.infradead.org On 02/20/2016 10:11 AM, tiffany lin wrote: > Hi Hans, > > On Tue, 2016-02-16 at 08:44 +0100, Hans Verkuil wrote: >> On 02/16/2016 07:37 AM, tiffany lin wrote: >>>>> + >>>>> +const struct v4l2_ioctl_ops mtk_venc_ioctl_ops = { >>>>> + .vidioc_streamon = v4l2_m2m_ioctl_streamon, >>>>> + .vidioc_streamoff = v4l2_m2m_ioctl_streamoff, >>>>> + >>>>> + .vidioc_reqbufs = v4l2_m2m_ioctl_reqbufs, >>>>> + .vidioc_querybuf = v4l2_m2m_ioctl_querybuf, >>>>> + .vidioc_qbuf = vidioc_venc_qbuf, >>>>> + .vidioc_dqbuf = vidioc_venc_dqbuf, >>>>> + >>>>> + .vidioc_querycap = vidioc_venc_querycap, >>>>> + .vidioc_enum_fmt_vid_cap_mplane = vidioc_enum_fmt_vid_cap_mplane, >>>>> + .vidioc_enum_fmt_vid_out_mplane = vidioc_enum_fmt_vid_out_mplane, >>>>> + .vidioc_enum_framesizes = vidioc_enum_framesizes, >>>>> + >>>>> + .vidioc_try_fmt_vid_cap_mplane = vidioc_try_fmt_vid_cap_mplane, >>>>> + .vidioc_try_fmt_vid_out_mplane = vidioc_try_fmt_vid_out_mplane, >>>>> + .vidioc_expbuf = v4l2_m2m_ioctl_expbuf, >>>> >>>> Please add vidioc_create_bufs and vidioc_prepare_buf as well. >>>> >>> >>> Currently we do not support these use cases, do we need to add >>> vidioc_create_bufs and vidioc_prepare_buf now? >> >> I would suggest you do. The vb2 framework gives it (almost) for free. >> prepare_buf is completely free (just add the helper) and create_bufs >> needs a few small changes in the queue_setup function, that's all. >> > After try to add vidioc_create_bufs directly using > vb2_ioctl_create_bufs, it will have problem in This is a m2m device, so you should use the m2m variant of this: v4l2_m2m_ioctl_create_bufs That should solve this problem. Ditto for prepare_buf: you need to use v4l2_m2m_ioctl_prepare_buf. Regards, Hans -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: hverkuil@xs4all.nl (Hans Verkuil) Date: Sat, 20 Feb 2016 10:18:24 +0100 Subject: [PATCH v4 5/8] [Media] vcodec: mediatek: Add Mediatek V4L2 Video Encoder Driver In-Reply-To: <1455959480.12533.11.camel@mtksdaap41> References: <1454585703-42428-1-git-send-email-tiffany.lin@mediatek.com> <1454585703-42428-2-git-send-email-tiffany.lin@mediatek.com> <1454585703-42428-3-git-send-email-tiffany.lin@mediatek.com> <1454585703-42428-4-git-send-email-tiffany.lin@mediatek.com> <1454585703-42428-5-git-send-email-tiffany.lin@mediatek.com> <1454585703-42428-6-git-send-email-tiffany.lin@mediatek.com> <56C1B4AF.1030207@xs4all.nl> <1455604653.19396.68.camel@mtksdaap41> <56C2D371.9090805@xs4all.nl> <1455959480.12533.11.camel@mtksdaap41> Message-ID: <56C82F60.4060304@xs4all.nl> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 02/20/2016 10:11 AM, tiffany lin wrote: > Hi Hans, > > On Tue, 2016-02-16 at 08:44 +0100, Hans Verkuil wrote: >> On 02/16/2016 07:37 AM, tiffany lin wrote: >>>>> + >>>>> +const struct v4l2_ioctl_ops mtk_venc_ioctl_ops = { >>>>> + .vidioc_streamon = v4l2_m2m_ioctl_streamon, >>>>> + .vidioc_streamoff = v4l2_m2m_ioctl_streamoff, >>>>> + >>>>> + .vidioc_reqbufs = v4l2_m2m_ioctl_reqbufs, >>>>> + .vidioc_querybuf = v4l2_m2m_ioctl_querybuf, >>>>> + .vidioc_qbuf = vidioc_venc_qbuf, >>>>> + .vidioc_dqbuf = vidioc_venc_dqbuf, >>>>> + >>>>> + .vidioc_querycap = vidioc_venc_querycap, >>>>> + .vidioc_enum_fmt_vid_cap_mplane = vidioc_enum_fmt_vid_cap_mplane, >>>>> + .vidioc_enum_fmt_vid_out_mplane = vidioc_enum_fmt_vid_out_mplane, >>>>> + .vidioc_enum_framesizes = vidioc_enum_framesizes, >>>>> + >>>>> + .vidioc_try_fmt_vid_cap_mplane = vidioc_try_fmt_vid_cap_mplane, >>>>> + .vidioc_try_fmt_vid_out_mplane = vidioc_try_fmt_vid_out_mplane, >>>>> + .vidioc_expbuf = v4l2_m2m_ioctl_expbuf, >>>> >>>> Please add vidioc_create_bufs and vidioc_prepare_buf as well. >>>> >>> >>> Currently we do not support these use cases, do we need to add >>> vidioc_create_bufs and vidioc_prepare_buf now? >> >> I would suggest you do. The vb2 framework gives it (almost) for free. >> prepare_buf is completely free (just add the helper) and create_bufs >> needs a few small changes in the queue_setup function, that's all. >> > After try to add vidioc_create_bufs directly using > vb2_ioctl_create_bufs, it will have problem in This is a m2m device, so you should use the m2m variant of this: v4l2_m2m_ioctl_create_bufs That should solve this problem. Ditto for prepare_buf: you need to use v4l2_m2m_ioctl_prepare_buf. Regards, Hans From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from lb2-smtp-cloud2.xs4all.net ([194.109.24.25]:54383 "EHLO lb2-smtp-cloud2.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2993453AbcBTJSd (ORCPT ); Sat, 20 Feb 2016 04:18:33 -0500 Subject: Re: [PATCH v4 5/8] [Media] vcodec: mediatek: Add Mediatek V4L2 Video Encoder Driver To: tiffany lin References: <1454585703-42428-1-git-send-email-tiffany.lin@mediatek.com> <1454585703-42428-2-git-send-email-tiffany.lin@mediatek.com> <1454585703-42428-3-git-send-email-tiffany.lin@mediatek.com> <1454585703-42428-4-git-send-email-tiffany.lin@mediatek.com> <1454585703-42428-5-git-send-email-tiffany.lin@mediatek.com> <1454585703-42428-6-git-send-email-tiffany.lin@mediatek.com> <56C1B4AF.1030207@xs4all.nl> <1455604653.19396.68.camel@mtksdaap41> <56C2D371.9090805@xs4all.nl> <1455959480.12533.11.camel@mtksdaap41> Cc: Hans Verkuil , daniel.thompson@linaro.org, Rob Herring , Mauro Carvalho Chehab , Matthias Brugger , Daniel Kurtz , Pawel Osciak , Eddie Huang , Yingjoe Chen , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org, PoChun.Lin@mediatek.com, Andrew-CT Chen From: Hans Verkuil Message-ID: <56C82F60.4060304@xs4all.nl> Date: Sat, 20 Feb 2016 10:18:24 +0100 MIME-Version: 1.0 In-Reply-To: <1455959480.12533.11.camel@mtksdaap41> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-media-owner@vger.kernel.org List-ID: On 02/20/2016 10:11 AM, tiffany lin wrote: > Hi Hans, > > On Tue, 2016-02-16 at 08:44 +0100, Hans Verkuil wrote: >> On 02/16/2016 07:37 AM, tiffany lin wrote: >>>>> + >>>>> +const struct v4l2_ioctl_ops mtk_venc_ioctl_ops = { >>>>> + .vidioc_streamon = v4l2_m2m_ioctl_streamon, >>>>> + .vidioc_streamoff = v4l2_m2m_ioctl_streamoff, >>>>> + >>>>> + .vidioc_reqbufs = v4l2_m2m_ioctl_reqbufs, >>>>> + .vidioc_querybuf = v4l2_m2m_ioctl_querybuf, >>>>> + .vidioc_qbuf = vidioc_venc_qbuf, >>>>> + .vidioc_dqbuf = vidioc_venc_dqbuf, >>>>> + >>>>> + .vidioc_querycap = vidioc_venc_querycap, >>>>> + .vidioc_enum_fmt_vid_cap_mplane = vidioc_enum_fmt_vid_cap_mplane, >>>>> + .vidioc_enum_fmt_vid_out_mplane = vidioc_enum_fmt_vid_out_mplane, >>>>> + .vidioc_enum_framesizes = vidioc_enum_framesizes, >>>>> + >>>>> + .vidioc_try_fmt_vid_cap_mplane = vidioc_try_fmt_vid_cap_mplane, >>>>> + .vidioc_try_fmt_vid_out_mplane = vidioc_try_fmt_vid_out_mplane, >>>>> + .vidioc_expbuf = v4l2_m2m_ioctl_expbuf, >>>> >>>> Please add vidioc_create_bufs and vidioc_prepare_buf as well. >>>> >>> >>> Currently we do not support these use cases, do we need to add >>> vidioc_create_bufs and vidioc_prepare_buf now? >> >> I would suggest you do. The vb2 framework gives it (almost) for free. >> prepare_buf is completely free (just add the helper) and create_bufs >> needs a few small changes in the queue_setup function, that's all. >> > After try to add vidioc_create_bufs directly using > vb2_ioctl_create_bufs, it will have problem in This is a m2m device, so you should use the m2m variant of this: v4l2_m2m_ioctl_create_bufs That should solve this problem. Ditto for prepare_buf: you need to use v4l2_m2m_ioctl_prepare_buf. Regards, Hans