lkml.org 
[lkml]   [2018]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 04/10] media: vim2m: Implement media request complete op to schedule m2m run
Date
This adds an implementation of the media request complete operation for
the vim2m driver, that ensures that the driver will try to schedule a
m2m run whenever a request was completed. Without this operation, no m2m
device run will be scheduled in many scenarios.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
---
drivers/media/platform/vim2m.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c
index 2dcf0ea85705..08c4c5566614 100644
--- a/drivers/media/platform/vim2m.c
+++ b/drivers/media/platform/vim2m.c
@@ -453,6 +453,17 @@ static void device_isr(struct timer_list *t)
schedule_work(&vim2m_dev->work_run);
}

+static void request_complete(struct media_request *req)
+{
+ struct vim2m_ctx *curr_ctx;
+
+ curr_ctx = (struct vim2m_ctx *) vb2_core_request_find_buffer_priv(req);
+ if (curr_ctx == NULL)
+ return;
+
+ v4l2_m2m_try_schedule(curr_ctx->fh.m2m_ctx);
+}
+
/*
* video ioctls
*/
@@ -1025,6 +1036,7 @@ static const struct v4l2_m2m_ops m2m_ops = {

static const struct media_device_ops m2m_media_ops = {
.req_queue = vb2_request_queue,
+ .req_complete = request_complete,
};

static int vim2m_probe(struct platform_device *pdev)
--
2.16.3
\
 
 \ /
  Last update: 2018-04-19 17:45    [W:0.235 / U:3.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site