Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp233103pxb; Wed, 25 Aug 2021 01:47:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCLRhg61o252zNZTV1rtuPjtYVVmnWxIAb8/TVaSIr+SyI6A5U/D7hTrKniLreSeiYm7hY X-Received: by 2002:aa7:c2da:: with SMTP id m26mr29036815edp.351.1629881229440; Wed, 25 Aug 2021 01:47:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629881229; cv=none; d=google.com; s=arc-20160816; b=Uw2ohVOO+a71qwGvNUPzsl6qX2P8K5oG8bmOtaIsdz3+7DJHgSh46/pGX2knTeuh3c A2u+6iXuTjqwSIV4BImjo5nYfP33EUMR9r2DT76WL/USrdWfiCF+HkAnaBXCqu/HMdyF u//RSOuB894BIW8Q2CXhTzkm6THZFkdbTzvhUwyBF6hGH2S61EurDXjcWPv4HIWdiSvz G9W3lb19BTeo0f6T1A7V8KXOu6OJw6PwQm0AjKNR5LwMlAL1d1eZ7VpUgdvZ7pM3ExUv k62St6a0Fm0VmSv7/AmqhRBncOBBM5k4vbZ4hQwcyHVkM9w4xgCW4hZrk1avVMjor1ta jFzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=DD+vGj7ofgnvZii5xeY46fgXPJdBgorEBByAa0gsdc0=; b=w7YMEU5Fik6iQnTxKuqVCLtFUMQBjFBF1sKsI9CBnXO2RvjIU+xA5PDWxqSi7TI+tp Pj9IIFTJO7hA0P3aapOoymZdd4fuNvl9E+RhF8H0iu0ouzVc243SsO/9OFuqwyf5g3xG AOuSnTAVo/i5qz2vsWBwOreAAkIbYZbxxX/T/2bP9GeO2ljo4OckCmS0B+Qt8gsHtv7X GA0jXtbyvfsz+MHutkUfQtYZEovXONZX4rHllhXN9UhHibURW0MKk5UHCnUWJCCJxM8u 0LxK7YCz+FrGOFg+/v+RtSw+V8kEiPLeR25PhWCFB6/c+ENB0s5OKYZS5mlkfppYNFuz ie2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w11si23843972ede.300.2021.08.25.01.46.46; Wed, 25 Aug 2021 01:47:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239374AbhHYIpp (ORCPT + 99 others); Wed, 25 Aug 2021 04:45:45 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:26322 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237471AbhHYIpp (ORCPT ); Wed, 25 Aug 2021 04:45:45 -0400 Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 25 Aug 2021 01:44:59 -0700 X-QCInternal: smtphost Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/AES256-SHA; 25 Aug 2021 01:44:58 -0700 X-QCInternal: smtphost Received: from c-mansur-linux.qualcomm.com ([10.204.83.180]) by ironmsg01-blr.qualcomm.com with ESMTP; 25 Aug 2021 14:14:39 +0530 Received: by c-mansur-linux.qualcomm.com (Postfix, from userid 461723) id D527722757; Wed, 25 Aug 2021 14:14:37 +0530 (IST) From: Mansur Alisha Shaik To: linux-media@vger.kernel.org, stanimir.varbanov@linaro.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, vgarodia@codeaurora.org, dikshita@codeaurora.org, nhebert@chromium.org, Mansur Alisha Shaik Subject: [PATCH] venus: vdec: update output buffer size during vdec_s_fmt() Date: Wed, 25 Aug 2021 14:14:34 +0530 Message-Id: <20210825084434.32309-1-mansur@codeaurora.org> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Video driver maintains an internal context for the output buffer size. During S_fmt() on capture plane, the output buffer size is not updated in driver context. As a result, during buf_prepare(), the size of the vb2_plane and internal size of the buffer, as maintained by the driver, does not match. This leads to buf_prepare() failure. Update the instance context for the output buffer size during s_fmt(). Signed-off-by: Mansur Alisha Shaik --- drivers/media/platform/qcom/venus/vdec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 198e47eb63f4..c129b061a325 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -332,8 +332,11 @@ static int vdec_s_fmt(struct file *file, void *fh, struct v4l2_format *f) if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) inst->fmt_out = fmt; - else if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) + else if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { inst->fmt_cap = fmt; + inst->output2_buf_size = + venus_helper_get_framesz(pixfmt_cap, orig_pixmp.width, orig_pixmp.height); + } return 0; } -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation