Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5752565imu; Mon, 26 Nov 2018 04:54:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/Urgi6DMi8R0gPac8j9ZaLo6wtsGazIPxIFbVvEFX4h431tfdnBT/Qsy8+4VYU7TVWk0kjk X-Received: by 2002:a62:1d8f:: with SMTP id d137mr22832202pfd.11.1543236862069; Mon, 26 Nov 2018 04:54:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543236862; cv=none; d=google.com; s=arc-20160816; b=rFbvMy3rkwICSCvpqrryGk74/NC7Ufp8onRUAdVJtS2tfo4KYsT1Hnmusapq9sRVro YuXyW7mP4iYAA10Zcs0iXSkYFS6tMtHZfOPlf5mg+Q3E123d9QsAn68wD5GJj9WuLn+b XLBQ1jn3kGDIETgFMreoX595GUB5oHguNOwMPo6GxmG20djepfqL57pXro0IIHaBokYH G7aV5bjJvbUuNgrqcvF5QkZYrEqxKTnVCgTEQGVujKjeAIyxzJglXh+kKZwSD3LipJpJ EzkOqPqs5TYrFFpxquUpmbMlWVviqxIzs0UlIevrEDC/fSFFcRfENiYPcss0UM5DErnx FniQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=LctftIN0IH9KwXOdA6CaBuuSTofypnJVmeb0Ubk74FE=; b=Jjgop4yuMkWOqX0mpDIoOa6E/0aLvcZ5hix89lMTkzuwaSaNWMtN9KonvJcH5ufyoW DGiiLRvUyrhT+1KuVKrcTEfwPzBhtBVkqspt/woDarKFlwJyPYGnXfduWztIZB7sbGTD KO0y0ofZouC5b2dyEskWu7QgX4duhkE2VHGmhSIcv+q1T5dtgfLdk8HcKs4QlwDT4xCZ QQuwxxkXC5ZBxlRRoQ1dkbQ9I1FYCM4UGVS/sR9Mmy4VzurctjNZYePz8ahDNjUsQ18r tbbepQCz1yLnz5IT6j+1c0LGj40iyPWw+aVCmFbUk2rOcDcTkONEzMDb6IfYV8j/Np2D X6sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LJ4kBn+l; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5-v6si200123plt.408.2018.11.26.04.53.54; Mon, 26 Nov 2018 04:54:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LJ4kBn+l; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726655AbeKZXrP (ORCPT + 99 others); Mon, 26 Nov 2018 18:47:15 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:55464 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726300AbeKZXrO (ORCPT ); Mon, 26 Nov 2018 18:47:14 -0500 Received: by mail-wm1-f65.google.com with SMTP id y139so18047255wmc.5 for ; Mon, 26 Nov 2018 04:53:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=LctftIN0IH9KwXOdA6CaBuuSTofypnJVmeb0Ubk74FE=; b=LJ4kBn+lLlRB3uvnPlhtf/NuLNUwObZ+lRsqsw5h48fovgl3102vk/O2xFAWDN9/U1 iZEEzvhXiZhFiUEnKSImyui/yAV2828+WHMUKflxxLlrvk7ZWOCwGc1WKPnas93nYFJm kmBLilD5YfBp+LYq+Uzfanv86m5mXVN8lbdnc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=LctftIN0IH9KwXOdA6CaBuuSTofypnJVmeb0Ubk74FE=; b=dXxXNK0MebnuiIPAtiT78VSbe0KrxaOmlqOClIrIEEIFleAYXy6K+LVEd/ppzKR1KM Dci21x4CGTDvFl4rFMRXdkM+bvJgufEyj5OplR3Jqgvte2mcgNyZWky7SXpNwj4jkBLf LGPQGAnQFUilo7Zv/1Osw/I+G7ox5/g91yJf5HrNhhP2BtvklDnYLRwXxJzVRvaHovSk EhXcJkHTaym3sb1uYWYTOon1P0dEO207Zke13cs4VkoYzz5tOW2oVMapdvLQYjvE3EUV fHhbFr7+cNXkQiPLomIFKC4RSR4+O8a24x18272ve5GcMpYEsq9wNRBYapw8q/a8Z9ke k/9Q== X-Gm-Message-State: AA+aEWbUKTKQnIYGdNCfO6WqS/JXpA0PM6g0ZYWFWi5//5ay4XWMoVUy MmkZx6b4aMOCFLhfCITuoYUmOg== X-Received: by 2002:a1c:d83:: with SMTP id 125mr16920389wmn.116.1543236790811; Mon, 26 Nov 2018 04:53:10 -0800 (PST) Received: from [192.168.27.209] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id o81sm947994wmd.10.2018.11.26.04.53.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Nov 2018 04:53:09 -0800 (PST) Subject: Re: [PATCH v3] media: venus: amend buffer size for bitstream plane To: Malathi Gottam , stanimir.varbanov@linaro.org, hverkuil@xs4all.nl, mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, acourbot@chromium.org, vgarodia@codeaurora.org References: <1543227173-2160-1-git-send-email-mgottam@codeaurora.org> From: Stanimir Varbanov Message-ID: Date: Mon, 26 Nov 2018 14:53:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1543227173-2160-1-git-send-email-mgottam@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Malathi, Thanks for the patch! On 11/26/18 12:12 PM, Malathi Gottam wrote: > Accept the buffer size requested by client and compare it > against driver calculated size and set the maximum to > bitstream plane. > > Signed-off-by: Malathi Gottam > --- > drivers/media/platform/qcom/venus/venc.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) Acked-by: Stanimir Varbanov > > diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c > index ce85962..e43dd3d 100644 > --- a/drivers/media/platform/qcom/venus/venc.c > +++ b/drivers/media/platform/qcom/venus/venc.c > @@ -303,6 +303,7 @@ static int venc_enum_fmt(struct file *file, void *fh, struct v4l2_fmtdesc *f) > struct v4l2_pix_format_mplane *pixmp = &f->fmt.pix_mp; > struct v4l2_plane_pix_format *pfmt = pixmp->plane_fmt; > const struct venus_format *fmt; > + u32 sizeimage; > > memset(pfmt[0].reserved, 0, sizeof(pfmt[0].reserved)); > memset(pixmp->reserved, 0, sizeof(pixmp->reserved)); > @@ -334,9 +335,10 @@ static int venc_enum_fmt(struct file *file, void *fh, struct v4l2_fmtdesc *f) > pixmp->num_planes = fmt->num_planes; > pixmp->flags = 0; > > - pfmt[0].sizeimage = venus_helper_get_framesz(pixmp->pixelformat, > - pixmp->width, > - pixmp->height); > + sizeimage = venus_helper_get_framesz(pixmp->pixelformat, > + pixmp->width, > + pixmp->height); > + pfmt[0].sizeimage = max(ALIGN(pfmt[0].sizeimage, SZ_4K), sizeimage); > > if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) > pfmt[0].bytesperline = ALIGN(pixmp->width, 128); > @@ -408,8 +410,10 @@ static int venc_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->output_buf_size = pixmp->plane_fmt[0].sizeimage; > + } > > return 0; > } > @@ -908,6 +912,7 @@ static int venc_queue_setup(struct vb2_queue *q, > sizes[0] = venus_helper_get_framesz(inst->fmt_cap->pixfmt, > inst->width, > inst->height); > + sizes[0] = max(sizes[0], inst->output_buf_size); > inst->output_buf_size = sizes[0]; > break; > default: > -- regards, Stan