From: Sunyoung Kang Date: Fri, 27 Apr 2018 06:01:18 +0000 (+0900) Subject: media: mfc: support the s5p_mfc_poll() ioctl X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=620537320d9eac19b070a780797aeb6478b135c2;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git media: mfc: support the s5p_mfc_poll() ioctl To use poll() ioctl, wait POLLOUT event for source and POLLIN event for destination. Change-Id: I35f8f31dd47408ee2d8b720a020fc4a66754986a Signed-off-by: Sunyoung Kang --- diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc.c b/drivers/media/platform/exynos/mfc/s5p_mfc.c index 705ac511f272..c8449388720a 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "s5p_mfc_common.h" @@ -811,16 +812,20 @@ static unsigned int s5p_mfc_poll(struct file *file, struct poll_table_struct *wait) { struct s5p_mfc_ctx *ctx = fh_to_mfc_ctx(file->private_data); + unsigned long req_events = poll_requested_events(wait); unsigned int ret = 0; - enum s5p_mfc_node_type node_type; - node_type = s5p_mfc_get_node_type(file); + mfc_debug_enter(); - if (s5p_mfc_is_decoder_node(node_type)) + if (req_events & (POLLOUT | POLLWRNORM)) { + mfc_debug(2, "wait source buffer\n"); ret = vb2_poll(&ctx->vq_src, file, wait); - else + } else if (req_events & (POLLIN | POLLRDNORM)) { + mfc_debug(2, "wait destination buffer\n"); ret = vb2_poll(&ctx->vq_dst, file, wait); + } + mfc_debug_leave(); return ret; }