]> git.baikalelectronics.ru Git - kernel.git/commitdiff
media: Add a Kconfig option for the Request API
authorSakari Ailus <sakari.ailus@linux.intel.com>
Wed, 5 Dec 2018 17:23:54 +0000 (12:23 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 5 Dec 2018 18:07:43 +0000 (13:07 -0500)
The Request API is now merged to the kernel but the confidence on the
stability of that API is not great, especially regarding the interaction
with V4L2.

Add a Kconfig option for the API, with a scary-looking warning.

The patch itself disables request creation as well as does not advertise
them as buffer flags. The driver requiring requests (cedrus) now depends
on the Kconfig option as well.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/Kconfig
drivers/media/common/videobuf2/videobuf2-v4l2.c
drivers/media/media-device.c
drivers/staging/media/sunxi/cedrus/Kconfig

index 8add62a18293eff36f081922f9f73e3b1da26d31..102eb35fcf3fe414502d3c2212819fdf2b08efc8 100644 (file)
@@ -110,6 +110,19 @@ config MEDIA_CONTROLLER_DVB
 
          This is currently experimental.
 
+config MEDIA_CONTROLLER_REQUEST_API
+       bool "Enable Media controller Request API (EXPERIMENTAL)"
+       depends on MEDIA_CONTROLLER && STAGING_MEDIA
+       default n
+       ---help---
+         DO NOT ENABLE THIS OPTION UNLESS YOU KNOW WHAT YOU'RE DOING.
+
+         This option enables the Request API for the Media controller and V4L2
+         interfaces. It is currently needed by a few stateless codec drivers.
+
+         There is currently no intention to provide API or ABI stability for
+         this new API as of yet.
+
 #
 # Video4Linux support
 #      Only enables if one of the V4L2 types (ATV, webcam, radio) is selected
index ce28bc052c3c33358f16f43f82a4629ff2472bf2..1d35aeabfd85ac79de7cb38e98d83f108acdb220 100644 (file)
@@ -634,8 +634,10 @@ static void fill_buf_caps(struct vb2_queue *q, u32 *caps)
                *caps |= V4L2_BUF_CAP_SUPPORTS_USERPTR;
        if (q->io_modes & VB2_DMABUF)
                *caps |= V4L2_BUF_CAP_SUPPORTS_DMABUF;
+#ifdef CONFIG_MEDIA_CONTROLLER_REQUEST_API
        if (q->supports_requests)
                *caps |= V4L2_BUF_CAP_SUPPORTS_REQUESTS;
+#endif
 }
 
 int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req)
index bed24372e61fcd8c8f588321ceb4243b457afc88..b8ec88612df7079e860bfc30c8098b8947d3711a 100644 (file)
@@ -381,10 +381,14 @@ static long media_device_get_topology(struct media_device *mdev, void *arg)
 static long media_device_request_alloc(struct media_device *mdev,
                                       int *alloc_fd)
 {
+#ifdef CONFIG_MEDIA_CONTROLLER_REQUEST_API
        if (!mdev->ops || !mdev->ops->req_validate || !mdev->ops->req_queue)
                return -ENOTTY;
 
        return media_request_alloc(mdev, alloc_fd);
+#else
+       return -ENOTTY;
+#endif
 }
 
 static long copy_arg_from_user(void *karg, void __user *uarg, unsigned int cmd)
index a7a34e89c42db574c51e476f7809408076ef431a..3252efa422f94749abcd6f6f87c1dafd5db04c1d 100644 (file)
@@ -3,6 +3,7 @@ config VIDEO_SUNXI_CEDRUS
        depends on VIDEO_DEV && VIDEO_V4L2 && MEDIA_CONTROLLER
        depends on HAS_DMA
        depends on OF
+       depends on MEDIA_CONTROLLER_REQUEST_API
        select SUNXI_SRAM
        select VIDEOBUF2_DMA_CONTIG
        select V4L2_MEM2MEM_DEV