From patchwork Sat Sep 29 12:00:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinu Gorle X-Patchwork-Id: 10620751 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 235B7180E for ; Sat, 29 Sep 2018 12:01:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1343B2A5F2 for ; Sat, 29 Sep 2018 12:01:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 072312A747; Sat, 29 Sep 2018 12:01:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 139D42A71B for ; Sat, 29 Sep 2018 12:01:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728106AbeI2S3D (ORCPT ); Sat, 29 Sep 2018 14:29:03 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53014 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728101AbeI2S3D (ORCPT ); Sat, 29 Sep 2018 14:29:03 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 100B76079B; Sat, 29 Sep 2018 12:00:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538222451; bh=abJtm1RN3/9VqctTj7AY48YHYu2eMzXzXt8khf1alAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AOy+RjwYeV+V4dpgNq7vFt/PHvnI47K157PmPQYmFuybfYDJ28myZ3ka5SgbhIAbt Ntkrf1lFqjXFk7UICaaqzJOWWeXq9ve7Gu0U7JCoU3TVwpoMLdqk1iez5gnuktqsVn GJy4YYajzNJcDo/hTTUlQ/l25GTQ6DmU+df8k0t8= Received: from sgorle-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sgorle@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8C87E60B7A; Sat, 29 Sep 2018 12:00:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538222449; bh=abJtm1RN3/9VqctTj7AY48YHYu2eMzXzXt8khf1alAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SGE2hNF3ff9rv9SkgNgDeiUw//QaTR+8xbm+MXxNrSZOVqkEoMq+/JeA5D6kuK7EK X3FXMaNCzqmxWmaHZBI09L7N2lXkxHiWTeBXTLYHL1DB2X0P4yNJa4WJWzBdldJviw jsHZvEIf99ZINaFgw1xeEjiJTSToGU3+L5lfpMmw= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8C87E60B7A Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sgorle@codeaurora.org From: Srinu Gorle To: stanimir.varbanov@linaro.org, hverkuil@xs4all.nl, mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, sgorle@codeaurora.org Cc: acourbot@chromium.org, vgarodia@codeaurora.org Subject: [PATCH v1 1/5] media: venus: handle video decoder resolution change Date: Sat, 29 Sep 2018 17:30:28 +0530 Message-Id: <1538222432-25894-2-git-send-email-sgorle@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1538222432-25894-1-git-send-email-sgorle@codeaurora.org> References: <1538222432-25894-1-git-send-email-sgorle@codeaurora.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add logic for below to handle resolution change during video decode. - stream off support for video decoder OUTPUT plane and flush old resolution OUTPUT plane buffers. - De-allocate and allocate video firmware internal buffers. And also ensures g_fmt for output plane populated only after SPS and PPS has parsed. Signed-off-by: Srinu Gorle --- drivers/media/platform/qcom/venus/helpers.c | 159 +++++++++++++++++++++++----- drivers/media/platform/qcom/venus/helpers.h | 3 + drivers/media/platform/qcom/venus/hfi.c | 5 +- drivers/media/platform/qcom/venus/hfi.h | 2 +- drivers/media/platform/qcom/venus/vdec.c | 102 +++++++++++++++--- drivers/media/platform/qcom/venus/venc.c | 20 +++- 6 files changed, 246 insertions(+), 45 deletions(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index e436385..822a853 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -180,6 +180,7 @@ int venus_helper_alloc_dpb_bufs(struct venus_inst *inst) list_add_tail(&buf->list, &inst->dpbbufs); } + venus_helper_queue_dpb_bufs(inst); return 0; fail: @@ -319,6 +320,65 @@ static int intbufs_free(struct venus_inst *inst) return intbufs_unset_buffers(inst); } +static int alloc_reconfig_buffers(struct venus_inst *inst) +{ + size_t arr_sz; + size_t i; + int ret; + unsigned int buf_type; + + if (IS_V4(inst->core)) + arr_sz = ARRAY_SIZE(intbuf_types_4xx); + else + arr_sz = ARRAY_SIZE(intbuf_types_1xx); + + for (i = 0; i < arr_sz; i++) { + buf_type = IS_V4(inst->core) ? intbuf_types_4xx[i] : + intbuf_types_1xx[i]; + if (buf_type == HFI_BUFFER_INTERNAL_PERSIST || + buf_type == HFI_BUFFER_INTERNAL_PERSIST_1) + continue; + + ret = intbufs_set_buffer(inst, buf_type); + if (ret) + goto error; + } + + return 0; + +error: + intbufs_unset_buffers(inst); + return ret; +} + +static int unset_reconfig_buffers(struct venus_inst *inst) +{ + struct hfi_buffer_desc bd = {0}; + struct intbuf *buf, *n; + int ret = 0; + + list_for_each_entry_safe(buf, n, &inst->internalbufs, list) { + if (buf->type == HFI_BUFFER_INTERNAL_PERSIST || + buf->type == HFI_BUFFER_INTERNAL_PERSIST_1) + continue; + + bd.buffer_size = buf->size; + bd.buffer_type = buf->type; + bd.num_buffers = 1; + bd.device_addr = buf->da; + bd.response_required = true; + + ret = hfi_session_unset_buffers(inst, &bd); + + list_del_init(&buf->list); + dma_free_attrs(inst->core->dev, buf->size, buf->va, buf->da, + buf->attrs); + kfree(buf); + } + + return ret; +} + static u32 load_per_instance(struct venus_inst *inst) { u32 mbs; @@ -969,14 +1029,26 @@ void venus_helper_vb2_buf_queue(struct vb2_buffer *vb) struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); struct venus_inst *inst = vb2_get_drv_priv(vb->vb2_queue); struct v4l2_m2m_ctx *m2m_ctx = inst->m2m_ctx; + struct venus_core *core = inst->core; + struct device *dev = core->dev; int ret; + bool is_plane_enabled; mutex_lock(&inst->lock); v4l2_m2m_buf_queue(m2m_ctx, vbuf); - if (!(inst->streamon_out & inst->streamon_cap)) + is_plane_enabled = inst->streamon_out && + vb->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; + is_plane_enabled |= inst->streamon_cap && + vb->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; + + if (!is_plane_enabled) { + dev_info(dev, "%s: Yet to start_stream the Q", + vb->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE ? + "FTB" : "ETB"); goto unlock; + } ret = is_buf_refed(inst, vbuf); if (ret) @@ -1009,37 +1081,72 @@ void venus_helper_vb2_stop_streaming(struct vb2_queue *q) struct venus_core *core = inst->core; int ret; - mutex_lock(&inst->lock); - - if (inst->streamon_out & inst->streamon_cap) { - ret = hfi_session_stop(inst); - ret |= hfi_session_unload_res(inst); + hfi_session_stop(inst); + ret = hfi_session_unload_res(inst); + if (inst->hfi_codec == HFI_VIDEO_CODEC_H264) ret |= session_unregister_bufs(inst); - ret |= intbufs_free(inst); - ret |= hfi_session_deinit(inst); - - if (inst->session_error || core->sys_error) - ret = -EIO; + ret |= intbufs_free(inst); + ret |= hfi_session_deinit(inst); - if (ret) - hfi_session_abort(inst); + if (inst->session_error || core->sys_error) + ret = -EIO; - venus_helper_free_dpb_bufs(inst); + if (IS_V3(core) && ret) + hfi_session_abort(inst); - load_scale_clocks(core); - INIT_LIST_HEAD(&inst->registeredbufs); - } + venus_helper_free_dpb_bufs(inst); + load_scale_clocks(core); + INIT_LIST_HEAD(&inst->registeredbufs); venus_helper_buffers_done(inst, VB2_BUF_STATE_ERROR); +} +EXPORT_SYMBOL_GPL(venus_helper_vb2_stop_streaming); - if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) - inst->streamon_out = 0; - else - inst->streamon_cap = 0; +int venus_helper_alloc_intbufs(struct venus_inst *inst) +{ + int ret = 0; - mutex_unlock(&inst->lock); + ret = intbufs_free(inst); + ret |= intbufs_alloc(inst); + + return ret; } -EXPORT_SYMBOL_GPL(venus_helper_vb2_stop_streaming); +EXPORT_SYMBOL_GPL(venus_helper_alloc_intbufs); + +int venus_helper_alloc_reconfig_bufs(struct venus_inst *inst) +{ + int ret = 0; + + ret = unset_reconfig_buffers(inst); + ret |= alloc_reconfig_buffers(inst); + + return ret; +} +EXPORT_SYMBOL_GPL(venus_helper_alloc_reconfig_bufs); + +int venus_helper_queue_initial_bufs(struct venus_inst *inst, unsigned int type) +{ + struct v4l2_m2m_ctx *m2m_ctx = inst->m2m_ctx; + struct v4l2_m2m_buffer *buf, *n; + int ret; + + if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { + v4l2_m2m_for_each_dst_buf_safe(m2m_ctx, buf, n) { + ret = session_process_buf(inst, &buf->vb); + if (ret) + return_buf_error(inst, &buf->vb); + } + } + if (type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { + v4l2_m2m_for_each_src_buf_safe(m2m_ctx, buf, n) { + ret = session_process_buf(inst, &buf->vb); + if (ret) + return_buf_error(inst, &buf->vb); + } + } + return 0; +} +EXPORT_SYMBOL(venus_helper_queue_initial_bufs); int venus_helper_vb2_start_streaming(struct venus_inst *inst) { @@ -1064,14 +1171,8 @@ int venus_helper_vb2_start_streaming(struct venus_inst *inst) if (ret) goto err_unload_res; - ret = venus_helper_queue_dpb_bufs(inst); - if (ret) - goto err_session_stop; - return 0; -err_session_stop: - hfi_session_stop(inst); err_unload_res: hfi_session_unload_res(inst); err_unreg_bufs: diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h index 2475f284..3de0c44 100644 --- a/drivers/media/platform/qcom/venus/helpers.h +++ b/drivers/media/platform/qcom/venus/helpers.h @@ -31,6 +31,8 @@ void venus_helper_buffers_done(struct venus_inst *inst, int venus_helper_vb2_start_streaming(struct venus_inst *inst); void venus_helper_m2m_device_run(void *priv); void venus_helper_m2m_job_abort(void *priv); +int venus_helper_queue_initial_bufs(struct venus_inst *inst, unsigned int type); +int venus_helper_alloc_intbufs(struct venus_inst *inst); int venus_helper_get_bufreq(struct venus_inst *inst, u32 type, struct hfi_buffer_requirements *req); u32 venus_helper_get_framesz_raw(u32 hfi_fmt, u32 width, u32 height); @@ -62,4 +64,5 @@ int venus_helper_get_out_fmts(struct venus_inst *inst, u32 fmt, u32 *out_fmt, int venus_helper_free_dpb_bufs(struct venus_inst *inst); int venus_helper_power_enable(struct venus_core *core, u32 session_type, bool enable); +int venus_helper_alloc_reconfig_bufs(struct venus_inst *inst); #endif diff --git a/drivers/media/platform/qcom/venus/hfi.c b/drivers/media/platform/qcom/venus/hfi.c index 2420782..36a4784 100644 --- a/drivers/media/platform/qcom/venus/hfi.c +++ b/drivers/media/platform/qcom/venus/hfi.c @@ -308,6 +308,7 @@ int hfi_session_stop(struct venus_inst *inst) return 0; } +EXPORT_SYMBOL_GPL(hfi_session_stop); int hfi_session_continue(struct venus_inst *inst) { @@ -384,14 +385,14 @@ int hfi_session_unload_res(struct venus_inst *inst) return 0; } -int hfi_session_flush(struct venus_inst *inst) +int hfi_session_flush(struct venus_inst *inst, u32 mode) { const struct hfi_ops *ops = inst->core->ops; int ret; reinit_completion(&inst->done); - ret = ops->session_flush(inst, HFI_FLUSH_ALL); + ret = ops->session_flush(inst, mode); if (ret) return ret; diff --git a/drivers/media/platform/qcom/venus/hfi.h b/drivers/media/platform/qcom/venus/hfi.h index 6038d8e..5e883a1 100644 --- a/drivers/media/platform/qcom/venus/hfi.h +++ b/drivers/media/platform/qcom/venus/hfi.h @@ -170,7 +170,7 @@ struct hfi_ops { int hfi_session_abort(struct venus_inst *inst); int hfi_session_load_res(struct venus_inst *inst); int hfi_session_unload_res(struct venus_inst *inst); -int hfi_session_flush(struct venus_inst *inst); +int hfi_session_flush(struct venus_inst *inst, u32 mode); int hfi_session_set_buffers(struct venus_inst *inst, struct hfi_buffer_desc *bd); int hfi_session_unset_buffers(struct venus_inst *inst, diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 991e158..98675db 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -207,7 +207,6 @@ static int vdec_g_fmt(struct file *file, void *fh, struct v4l2_format *f) inst->out_width = inst->reconfig_width; inst->out_height = inst->reconfig_height; - inst->reconfig = false; format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; format.fmt.pix_mp.pixelformat = inst->fmt_cap->pixfmt; @@ -223,6 +222,9 @@ static int vdec_g_fmt(struct file *file, void *fh, struct v4l2_format *f) pixmp->pixelformat = fmt->pixfmt; if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { + if (!(inst->reconfig)) + return -EINVAL; + pixmp->width = inst->width; pixmp->height = inst->height; pixmp->colorspace = inst->colorspace; @@ -451,6 +453,8 @@ static int vdec_subscribe_event(struct v4l2_fh *fh, if (cmd->flags & V4L2_DEC_CMD_STOP_TO_BLACK) return -EINVAL; break; + case V4L2_DEC_CMD_START: + return 0; default: return -EINVAL; } @@ -465,6 +469,9 @@ static int vdec_subscribe_event(struct v4l2_fh *fh, struct hfi_frame_data fdata = {0}; int ret; + if (cmd->cmd != V4L2_DEC_CMD_STOP) + return 0; + ret = vdec_try_decoder_cmd(file, fh, cmd); if (ret) return ret; @@ -790,22 +797,60 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) { struct venus_inst *inst = vb2_get_drv_priv(q); int ret; + bool is_mplane_enabled; mutex_lock(&inst->lock); + is_mplane_enabled = q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE && + inst->streamon_cap; + is_mplane_enabled |= q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE && + inst->streamon_out; - if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) - inst->streamon_out = 1; - else - inst->streamon_cap = 1; + if (is_mplane_enabled) { + mutex_unlock(&inst->lock); + return 0; + } - if (!(inst->streamon_out & inst->streamon_cap)) { + if (q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE && + !inst->streamon_out){ mutex_unlock(&inst->lock); return 0; } + if (inst->streamon_out && !inst->streamon_cap && + q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { + ret = vdec_output_conf(inst); + if (ret) + goto deinit_sess; + + ret = venus_helper_set_num_bufs(inst, inst->num_input_bufs, + inst->num_output_bufs, + inst->num_output_bufs); + + if (ret) + goto deinit_sess; + + ret = vdec_verify_conf(inst); + if (ret) + goto deinit_sess; + + if (inst->reconfig) + ret = venus_helper_alloc_reconfig_bufs(inst); + + if (ret) + goto deinit_sess; + + ret = venus_helper_alloc_dpb_bufs(inst); + if (ret) + goto deinit_sess; + + if (inst->reconfig) { + hfi_session_continue(inst); + inst->reconfig = false; + } + goto enable_mplane; + } venus_helper_init_instance(inst); - inst->reconfig = false; inst->sequence_cap = 0; inst->sequence_out = 0; @@ -830,14 +875,17 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) if (ret) goto deinit_sess; - ret = venus_helper_alloc_dpb_bufs(inst); - if (ret) - goto deinit_sess; - ret = venus_helper_vb2_start_streaming(inst); if (ret) goto deinit_sess; +enable_mplane: + if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) + inst->streamon_out = 1; + else if (q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) + inst->streamon_cap = 1; + + ret = venus_helper_queue_initial_bufs(inst, q->type); mutex_unlock(&inst->lock); return 0; @@ -854,12 +902,42 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) return ret; } +static void vdec_stop_streaming(struct vb2_queue *q) +{ + struct venus_inst *inst = vb2_get_drv_priv(q); + int ret; + + mutex_lock(&inst->lock); + + if (!inst->streamon_cap && !inst->streamon_out) + goto unlock; + + if (inst->streamon_cap && + q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { + ret = hfi_session_stop(inst); + inst->streamon_cap = 0; + } + + if (inst->streamon_out && !inst->streamon_cap) { + inst->streamon_out = 0; + venus_helper_vb2_stop_streaming(q); + } + + if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) + inst->streamon_out = 0; + else + inst->streamon_cap = 0; +unlock: + venus_helper_buffers_done(inst, VB2_BUF_STATE_ERROR); + mutex_unlock(&inst->lock); +} + static const struct vb2_ops vdec_vb2_ops = { .queue_setup = vdec_queue_setup, .buf_init = venus_helper_vb2_buf_init, .buf_prepare = venus_helper_vb2_buf_prepare, .start_streaming = vdec_start_streaming, - .stop_streaming = venus_helper_vb2_stop_streaming, + .stop_streaming = vdec_stop_streaming, .buf_queue = venus_helper_vb2_buf_queue, }; diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index ce85962..3ce0f7a 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -1005,12 +1005,30 @@ static int venc_start_streaming(struct vb2_queue *q, unsigned int count) return ret; } +void venc_stop_streaming(struct vb2_queue *q) +{ + struct venus_inst *inst = vb2_get_drv_priv(q); + + mutex_lock(&inst->lock); + + if (inst->streamon_out & inst->streamon_cap) + venus_helper_vb2_stop_streaming(q); + + if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) + inst->streamon_out = 0; + else + inst->streamon_cap = 0; + + mutex_unlock(&inst->lock); +} +EXPORT_SYMBOL_GPL(venc_stop_streaming); + static const struct vb2_ops venc_vb2_ops = { .queue_setup = venc_queue_setup, .buf_init = venus_helper_vb2_buf_init, .buf_prepare = venus_helper_vb2_buf_prepare, .start_streaming = venc_start_streaming, - .stop_streaming = venus_helper_vb2_stop_streaming, + .stop_streaming = venc_stop_streaming, .buf_queue = venus_helper_vb2_buf_queue, }; From patchwork Sat Sep 29 12:00:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinu Gorle X-Patchwork-Id: 10620733 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D38006CB for ; Sat, 29 Sep 2018 12:01:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C06962A5F2 for ; Sat, 29 Sep 2018 12:01:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B40962A7E0; Sat, 29 Sep 2018 12:01:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B6D82A71B for ; Sat, 29 Sep 2018 12:01:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728199AbeI2S3H (ORCPT ); Sat, 29 Sep 2018 14:29:07 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53114 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728101AbeI2S3G (ORCPT ); Sat, 29 Sep 2018 14:29:06 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5B3A760C54; Sat, 29 Sep 2018 12:00:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538222454; bh=wt2Vs3KJBChGk74wCKLDNU/mV6zsInmXHS2Vli2g4Fc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RBn+xub+ZzYePgGnuayj5HIMKpPiU3PCr6ti1R+LbEHSlSZqAjl/sYL8eDyJmq2q7 venno4v7cjpqrpYS4DB/N13/3mI2wZsEhPq28UnFyh6fV7qCShCj1qniuZLXWGOhrJ kPi4tET81d+rBRbdH6sIFrpagikgolvvGb57iG7c= Received: from sgorle-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sgorle@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4B95C602F1; Sat, 29 Sep 2018 12:00:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538222453; bh=wt2Vs3KJBChGk74wCKLDNU/mV6zsInmXHS2Vli2g4Fc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nd/qzE07DkKrLOFUPLhebp6p0bgsW84cEVM59EHaW0+/p1HspJ0nZEzGCb2APXiFt 7SoNRLxrRz7Wl4RvDoo7qKrR8tpfkPm2kF6s8zCRgpyjGCPU1xsdH3adAbCDmX/OZT wwzr4XQBpXMGy2L0veA4UMejKplzigFeexj4QzbM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4B95C602F1 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sgorle@codeaurora.org From: Srinu Gorle To: stanimir.varbanov@linaro.org, hverkuil@xs4all.nl, mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, sgorle@codeaurora.org Cc: acourbot@chromium.org, vgarodia@codeaurora.org Subject: [PATCH v1 2/5] media: venus: dynamically configure codec type Date: Sat, 29 Sep 2018 17:30:29 +0530 Message-Id: <1538222432-25894-3-git-send-email-sgorle@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1538222432-25894-1-git-send-email-sgorle@codeaurora.org> References: <1538222432-25894-1-git-send-email-sgorle@codeaurora.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP - currently video decoder instance is hardcoded to H.264 video format. - this change enables video decoder dynamically configure to any supported video format. Signed-off-by: Srinu Gorle --- drivers/media/platform/qcom/venus/helpers.c | 51 ++++++++++++++--------------- drivers/media/platform/qcom/venus/helpers.h | 1 + drivers/media/platform/qcom/venus/vdec.c | 2 ++ 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 822a853..c82dbac 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -36,47 +36,44 @@ struct intbuf { unsigned long attrs; }; -bool venus_helper_check_codec(struct venus_inst *inst, u32 v4l2_pixfmt) +u32 v4l2_venus_fmt(u32 pixfmt) { - struct venus_core *core = inst->core; - u32 session_type = inst->session_type; - u32 codec; - - switch (v4l2_pixfmt) { + switch (pixfmt) { case V4L2_PIX_FMT_H264: - codec = HFI_VIDEO_CODEC_H264; - break; + case V4L2_PIX_FMT_H264_NO_SC: + return HFI_VIDEO_CODEC_H264; case V4L2_PIX_FMT_H263: - codec = HFI_VIDEO_CODEC_H263; - break; + return HFI_VIDEO_CODEC_H263; case V4L2_PIX_FMT_MPEG1: - codec = HFI_VIDEO_CODEC_MPEG1; - break; + return HFI_VIDEO_CODEC_MPEG1; case V4L2_PIX_FMT_MPEG2: - codec = HFI_VIDEO_CODEC_MPEG2; - break; + return HFI_VIDEO_CODEC_MPEG2; case V4L2_PIX_FMT_MPEG4: - codec = HFI_VIDEO_CODEC_MPEG4; - break; + return HFI_VIDEO_CODEC_MPEG4; case V4L2_PIX_FMT_VC1_ANNEX_G: case V4L2_PIX_FMT_VC1_ANNEX_L: - codec = HFI_VIDEO_CODEC_VC1; - break; + return HFI_VIDEO_CODEC_VC1; case V4L2_PIX_FMT_VP8: - codec = HFI_VIDEO_CODEC_VP8; - break; + return HFI_VIDEO_CODEC_VP8; case V4L2_PIX_FMT_VP9: - codec = HFI_VIDEO_CODEC_VP9; - break; + return HFI_VIDEO_CODEC_VP9; case V4L2_PIX_FMT_XVID: - codec = HFI_VIDEO_CODEC_DIVX; - break; + return HFI_VIDEO_CODEC_DIVX; case V4L2_PIX_FMT_HEVC: - codec = HFI_VIDEO_CODEC_HEVC; - break; + return HFI_VIDEO_CODEC_HEVC; default: - return false; + return 0; } +} +EXPORT_SYMBOL_GPL(v4l2_venus_fmt); + +bool venus_helper_check_codec(struct venus_inst *inst, u32 v4l2_pixfmt) +{ + struct venus_core *core = inst->core; + u32 session_type = inst->session_type; + u32 codec; + + codec = v4l2_venus_fmt(v4l2_pixfmt); if (session_type == VIDC_SESSION_TYPE_ENC && core->enc_codecs & codec) return true; diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h index 3de0c44..725831d 100644 --- a/drivers/media/platform/qcom/venus/helpers.h +++ b/drivers/media/platform/qcom/venus/helpers.h @@ -19,6 +19,7 @@ struct venus_inst; +u32 v4l2_venus_fmt(u32 pixfmt); bool venus_helper_check_codec(struct venus_inst *inst, u32 v4l2_pixfmt); struct vb2_v4l2_buffer *venus_helper_find_buf(struct venus_inst *inst, unsigned int type, u32 idx); diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 98675db..afe3b36 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -413,6 +413,8 @@ static int vdec_enum_framesizes(struct file *file, void *fh, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE); if (!fmt) return -EINVAL; + inst->fmt_out = fmt; + inst->hfi_codec = v4l2_venus_fmt(fmt->pixfmt); } if (fsize->index) From patchwork Sat Sep 29 12:00:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinu Gorle X-Patchwork-Id: 10620735 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C24D96CB for ; Sat, 29 Sep 2018 12:01:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0BFD2A5F2 for ; Sat, 29 Sep 2018 12:01:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A4F6A2A71B; Sat, 29 Sep 2018 12:01:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BC312A747 for ; Sat, 29 Sep 2018 12:01:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728244AbeI2S3L (ORCPT ); Sat, 29 Sep 2018 14:29:11 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53194 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728241AbeI2S3K (ORCPT ); Sat, 29 Sep 2018 14:29:10 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E722760B7F; Sat, 29 Sep 2018 12:00:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538222457; bh=F1MtYhnXdGfQ6iKMBLdLmFe2T2EZmwMzIVbji0LHeX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U0D5ccPgao1aPF2DXyOB175RnLporFlG+/5jAFf6E13JqxsZ8zXmkXXkUD+coHeGs mxNmvLDML2pmUrhPD1MnHugSZO5jaa/ZZnSSdriKB/dr1hesBlgq/JTwvc6uxXmYdO OvELIJWx/iZ51FA2YYyTqEgFA2SrpBw6fKIsf0FI= Received: from sgorle-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sgorle@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0D21460C4F; Sat, 29 Sep 2018 12:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538222457; bh=F1MtYhnXdGfQ6iKMBLdLmFe2T2EZmwMzIVbji0LHeX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U0D5ccPgao1aPF2DXyOB175RnLporFlG+/5jAFf6E13JqxsZ8zXmkXXkUD+coHeGs mxNmvLDML2pmUrhPD1MnHugSZO5jaa/ZZnSSdriKB/dr1hesBlgq/JTwvc6uxXmYdO OvELIJWx/iZ51FA2YYyTqEgFA2SrpBw6fKIsf0FI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0D21460C4F Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sgorle@codeaurora.org From: Srinu Gorle To: stanimir.varbanov@linaro.org, hverkuil@xs4all.nl, mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, sgorle@codeaurora.org Cc: acourbot@chromium.org, vgarodia@codeaurora.org Subject: [PATCH v1 3/5] media: venus: do not destroy video session during queue setup Date: Sat, 29 Sep 2018 17:30:30 +0530 Message-Id: <1538222432-25894-4-git-send-email-sgorle@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1538222432-25894-1-git-send-email-sgorle@codeaurora.org> References: <1538222432-25894-1-git-send-email-sgorle@codeaurora.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP - open and close video sessions for plane properties is incorrect. - add check to ensure, same instance persist from driver open to close. Signed-off-by: Srinu Gorle --- drivers/media/platform/qcom/venus/hfi.c | 3 +++ drivers/media/platform/qcom/venus/vdec.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/media/platform/qcom/venus/hfi.c b/drivers/media/platform/qcom/venus/hfi.c index 36a4784..59c34ba 100644 --- a/drivers/media/platform/qcom/venus/hfi.c +++ b/drivers/media/platform/qcom/venus/hfi.c @@ -207,6 +207,9 @@ int hfi_session_init(struct venus_inst *inst, u32 pixfmt) const struct hfi_ops *ops = core->ops; int ret; + if (inst->state >= INST_INIT && inst->state < INST_STOP) + return 0; + inst->hfi_codec = to_codec_type(pixfmt); reinit_completion(&inst->done); diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index afe3b36..0035cf2 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -700,6 +700,8 @@ static int vdec_num_buffers(struct venus_inst *inst, unsigned int *in_num, *out_num = HFI_BUFREQ_COUNT_MIN(&bufreq, ver); + return 0; + deinit: hfi_session_deinit(inst); From patchwork Sat Sep 29 12:00:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinu Gorle X-Patchwork-Id: 10620741 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F93B6CB for ; Sat, 29 Sep 2018 12:01:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F32692A5F2 for ; Sat, 29 Sep 2018 12:01:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E74852A747; Sat, 29 Sep 2018 12:01:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 964F32A5F2 for ; Sat, 29 Sep 2018 12:01:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728278AbeI2S3P (ORCPT ); Sat, 29 Sep 2018 14:29:15 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53292 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727979AbeI2S3O (ORCPT ); Sat, 29 Sep 2018 14:29:14 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3293160C4F; Sat, 29 Sep 2018 12:01:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538222462; bh=lCfy+UF0ywb1ADOv4ZALgAaUmL0UY/E/F7ZjJErnBks=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PCQdV3Uv8PtTmqLKGT64kownTwOj6qU6trKJXjWkoVhPUlG/EA3oqxwrhQtxloqFh rfKtfABHw6RHLcRrccJQufcV5wXTL+omldqWD0rlJoe2yhDIGIbeiy+48yzeuWTng4 0Dw7Kz/HfVWVxL3YMIpDkqFHv2VMTlhRQeo8M0ZQ= Received: from sgorle-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sgorle@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id C0DC760C4B; Sat, 29 Sep 2018 12:00:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538222460; bh=lCfy+UF0ywb1ADOv4ZALgAaUmL0UY/E/F7ZjJErnBks=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IdKP9Au9WZ33DZWnJ7KCULSv/KWjMT7O0LmfqlFa/Q1I33hz/FuvOEZ4OvlvnGlhK h7m0e6r3YS9+RTkqpSubiB477w8jcqgbAokhO4KKbhF8UosAqnBRdAmd3Y+8vUY6kH sfxE2ln6B/gEkJN1MAP0+sWIl+bF/esUHXFmDjBU= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C0DC760C4B Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sgorle@codeaurora.org From: Srinu Gorle To: stanimir.varbanov@linaro.org, hverkuil@xs4all.nl, mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, sgorle@codeaurora.org Cc: acourbot@chromium.org, vgarodia@codeaurora.org Subject: [PATCH v1 4/5] media: venus: video decoder drop frames handling Date: Sat, 29 Sep 2018 17:30:31 +0530 Message-Id: <1538222432-25894-5-git-send-email-sgorle@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1538222432-25894-1-git-send-email-sgorle@codeaurora.org> References: <1538222432-25894-1-git-send-email-sgorle@codeaurora.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP - when drop frame flag received from venus h/w, reset buffer parameters and update v4l2 buffer flags as error buffer. Signed-off-by: Srinu Gorle --- drivers/media/platform/qcom/venus/vdec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 0035cf2..311f209 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -991,6 +991,12 @@ static void vdec_buf_done(struct venus_inst *inst, unsigned int buf_type, if (hfi_flags & HFI_BUFFERFLAG_DATACORRUPT) state = VB2_BUF_STATE_ERROR; + if (hfi_flags & HFI_BUFFERFLAG_DROP_FRAME) { + vb->planes[0].bytesused = 0; + vb->timestamp = 0; + state = VB2_BUF_STATE_ERROR; + } + v4l2_m2m_buf_done(vbuf, state); } From patchwork Sat Sep 29 12:00:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinu Gorle X-Patchwork-Id: 10620737 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5587E180E for ; Sat, 29 Sep 2018 12:01:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45C552A5F2 for ; Sat, 29 Sep 2018 12:01:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39CF92A747; Sat, 29 Sep 2018 12:01:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E40E02A5F2 for ; Sat, 29 Sep 2018 12:01:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728305AbeI2S3T (ORCPT ); Sat, 29 Sep 2018 14:29:19 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53432 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727979AbeI2S3S (ORCPT ); Sat, 29 Sep 2018 14:29:18 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C4357609A8; Sat, 29 Sep 2018 12:01:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538222465; bh=iXCfK9aOM52GK3s6zuZjO0C42P/1OJbKV7Q83ZSNahk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CBz7PkcRocL/Bc/vmT2/gZ/mE2aH43btYSncPLQZE1Nr6iKjsnHH6aEoDjfRzQGDP /Sq02qzWSVLTSTgGNw/n7xukS8a4jS+pii0HjxXxUisfW2ANMYzkVMzYQmOYOMtmys PcVpHbZDJAvcGO6avDUDGG2x6CVkBvYqzxdCnu9E= Received: from sgorle-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sgorle@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id A3C7460C61; Sat, 29 Sep 2018 12:01:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538222464; bh=iXCfK9aOM52GK3s6zuZjO0C42P/1OJbKV7Q83ZSNahk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SJ6GeSdR5/tlTQPc/lmxQFWOnPAatdU6rvoccZJErsIYcwURqC3Hs3q5muD+2l7XD p5mcjQY3PEkVOWu2UNm7KXPZFZ7usc4caihMVJ051rXRJxYirnDDCttp9rZNQPVsw6 8Sfsig6DX1QlW/g+SnS92gffqBZMgLWHqPeF6X/8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A3C7460C61 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sgorle@codeaurora.org From: Srinu Gorle To: stanimir.varbanov@linaro.org, hverkuil@xs4all.nl, mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, sgorle@codeaurora.org Cc: acourbot@chromium.org, vgarodia@codeaurora.org Subject: [PATCH v1 5/5] media: venus: update number of bytes used field properly for EOS frames Date: Sat, 29 Sep 2018 17:30:32 +0530 Message-Id: <1538222432-25894-6-git-send-email-sgorle@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1538222432-25894-1-git-send-email-sgorle@codeaurora.org> References: <1538222432-25894-1-git-send-email-sgorle@codeaurora.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP - In video decoder session, update number of bytes used for yuv buffers appropriately for EOS buffers. Signed-off-by: Srinu Gorle --- drivers/media/platform/qcom/venus/vdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 311f209..a48eed1 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -978,7 +978,7 @@ static void vdec_buf_done(struct venus_inst *inst, unsigned int buf_type, if (vbuf->flags & V4L2_BUF_FLAG_LAST) { const struct v4l2_event ev = { .type = V4L2_EVENT_EOS }; - + vb->planes[0].bytesused = bytesused; v4l2_event_queue_fh(&inst->fh, &ev); } } else {