From patchwork Wed Nov 11 14:37:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 323472 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:5ce:0:0:0:0 with SMTP id l14csp444428ils; Wed, 11 Nov 2020 06:40:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIt50NYiXSbKQWqn3kYTKSdNnvSxluYGkmp+2FVwK0gOvWGEJ0eKCt+5Ndi38NGOF1OBQs X-Received: by 2002:aa7:dcd6:: with SMTP id w22mr26612134edu.19.1605105623312; Wed, 11 Nov 2020 06:40:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605105623; cv=none; d=google.com; s=arc-20160816; b=vtBETtpJ7EfB4kYc7CQoh7frRK073R+HuTOjea0tqWKePCcJtWHSQZ+r49PFWpGl3q jdGrDtRf33ok7N0t62+up/zUHU1Ur6I73Y1sc6oI8ygvAqAl/f3PRVTJ0+UqdRlMGtXo G1Nt9vEmjQv5AttBTuKl9/Jk1LtjkltdeMY/O0ovGFH5f6Hv6F9NX/+6juviu7OIWE1x q+aH1jAwcb7rKBcWmS/NoPVuzYoyWhR4kt8mJ/q+g6eHlwG8k5m9M8WP5SSPTtj5q6Ty KAqNDrwvv3s9erwQRV7WYnwpxfonPV2Yn3sfX72tTTjgCFqWkevM1qXD6FZHAW0rkyNn hQnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=TWPvZ8Q5g6TI75wYwlmr663kYENsDmC3EDOVf4VZUws=; b=UkR1OACv4Czry/cLz7yC2Zs242/qqSdNhvDXK3Ei8Qv4fMkCKD8kszEMRYbnjinMIP +24uzjBGLSjUGDBo2Q+q+a8k5zIPsXkUnNz/AJTGiFb2BElghn+QSwH/ywiwg4gx7uc0 y9Ud7s0PmQZU1n5BAg5cPhMzKax64uDnoxr91dKDonHxEFjnuhBNow+8ZpJvH+rlp5eg 4tWEIL/VPuRuwjN6WHwz/0JiaxVXBtXcgD0oDz64XlqKSwmWshruDSQFpDNSh7kzuGjn mlu9kgckDy2V8sPKNcPMOB13HyOiPGqsJiWF9py9w7R9eqIWf32mC0JTOzml+bovL5N6 0oLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CBTrBBAS; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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. [23.128.96.18]) by mx.google.com with ESMTP id d12si1408986eje.365.2020.11.11.06.40.23; Wed, 11 Nov 2020 06:40:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CBTrBBAS; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1727103AbgKKOkV (ORCPT + 15 others); Wed, 11 Nov 2020 09:40:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727092AbgKKOic (ORCPT ); Wed, 11 Nov 2020 09:38:32 -0500 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC7B9C061A4D for ; Wed, 11 Nov 2020 06:38:30 -0800 (PST) Received: by mail-wm1-x341.google.com with SMTP id a65so2555119wme.1 for ; Wed, 11 Nov 2020 06:38:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TWPvZ8Q5g6TI75wYwlmr663kYENsDmC3EDOVf4VZUws=; b=CBTrBBASaPzbM0zto16rBPP1OtKXcFcWsvhLYI02MALLIPA8DBtqGeNIIaBw2f+BYF LLSdWMMqLd1cSxXQEsUH2BDaLqw9CDkEnwrTTZW+IKADXbZYpeqKuc2AwrkRnbzBJvzQ RffPysPxe41v9IaY+NabRgB08ToFDJIM4T+iuCGZHbRfAx6f9YQYZ4FoGVyO19YkNfuh ayoF4L+aUqUl6J5nhl6ahgS90QBIiFDv2cj+q6JANh/QZ7oPo2hoe6gTHDLZws9wELu8 rylgwYhm1mNBQ9PCWEvkBrWzy1k0xYBYr5egz1ts4u7OvEe1TY4MEstnEl8C8eOmoNIa b/UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TWPvZ8Q5g6TI75wYwlmr663kYENsDmC3EDOVf4VZUws=; b=cRbQBmmdlsY96tpelaBllEwJZhaZSTvC2F2eLbogM5wqxaqY7GlLco3vknlp99NqS5 IR15+k/BgAFemkXPbWD9b1bIX8FhCyH/e4U6wttH1ZyDoHPM/69TPrCAoQQFHae371Us wOngugWRpJZUCs4riVHcjOq5nUC63bnMSed5znCRJm7kGQKYQSrDNxuFZ43N4NJzoDcO 3x16RuBI/H+A6TCDqBC9qMqm6rkUuYCp4KgvWlcqaDeoTGEFFNd2ar30D6XFDXatiT4C deXyDcJ6NFB9RFirm7FtyLLFAt3xty5tZYI8788tJLyMdtfQpeO27wCJJb+UKi0Ki3ef mFrQ== X-Gm-Message-State: AOAM532Bd0TErXaOP22k4TXXYnCuEMvZyAakY8n3O7kdR+/8DhRZo3nD xUU69cmOCTc+RW9QhKVSGG2AiA== X-Received: by 2002:a7b:c4c3:: with SMTP id g3mr4427544wmk.65.1605105509436; Wed, 11 Nov 2020 06:38:29 -0800 (PST) Received: from localhost.localdomain (hst-221-89.medicom.bg. [84.238.221.89]) by smtp.gmail.com with ESMTPSA id b8sm2991405wrv.57.2020.11.11.06.38.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 06:38:29 -0800 (PST) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vikash Garodia , Alexandre Courbot , Fritz Koenig , Stanimir Varbanov Subject: [PATCH v2 4/8] venus: helpers: Calculate properly compressed buffer size Date: Wed, 11 Nov 2020 16:37:51 +0200 Message-Id: <20201111143755.24541-5-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201111143755.24541-1-stanimir.varbanov@linaro.org> References: <20201111143755.24541-1-stanimir.varbanov@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org For resolutions below 720p the size of the compressed buffer must be bigger. Correct this by checking the resolution when calculating buffer size and multiply by four. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/helpers.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.1 diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 688e3e3e8362..490c026b58a3 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -986,6 +986,8 @@ u32 venus_helper_get_framesz(u32 v4l2_fmt, u32 width, u32 height) if (compressed) { sz = ALIGN(height, 32) * ALIGN(width, 32) * 3 / 2 / 2; + if (width < 1280 || height < 720) + sz *= 8; return ALIGN(sz, SZ_4K); }