From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6227D3B7770; Tue, 21 Jul 2026 20:32:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784665975; cv=none; b=Dw7VXFMIzm2POWv4QeFn3Qpzpxqw9JaUS/nJxmhnrrsCqtWYtAUfdJKT/5cWcBE9Lt7IlCpMRMz/zBrEAZPqqaPPruq650YXSw7/8o+Fm033Uy7tT6Y/A7w+cDo4UW+A1Ca7xygRUGYrJOYr8qm5S3AD4kWpnmb+MZvSh7D2anM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784665975; c=relaxed/simple; bh=w/B5bqKtBxdTK8he4dBuVdOZQZWVIlrTiavFBi2HzIY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sKje7BjGowmE74B0bgbzBeAdqxGE0dh3gwEkoRJlqX1rztsPvwgUVtriLBzYtIOUPuMrxiSnAl5w2AU0kKevuz4s4LFOswl6XFdjV1YFtvJZVDoTqtKaYgT3iq+kVE65zcLtCyntuAyFpi/fiA0gQgmNbDPkOdo2hbPm4FLL5bw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=o+dXD6pz; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="o+dXD6pz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE50F1F00A3A; Tue, 21 Jul 2026 20:32:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784665974; bh=MErmtOkD1HHZYHUlbUEJ+avMvF+veQ/CcLnjAqNUIFQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=o+dXD6pz+BZQPm+Tf/5AKOBFrfF2W1Et8QmIubiCGSNfIZ2oSBiy9Bh5xEq+/Ennr 7ebhq8WwoEuIPm7p0hb2K3B2mDmMoKiCw47qhrpuHKIJltX/YVNKq4GQsmxcco1JxL 79xM11E3sj5I1yueNpJLKjwSTkVoXA7frsYLF0c8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Renjiang Han , Dikshita Agarwal , Bryan ODonoghue , Sasha Levin Subject: [PATCH 6.6 0464/1266] media: qcom: venus: drop extra padding in NV12 raw size calculation Date: Tue, 21 Jul 2026 17:15:01 +0200 Message-ID: <20260721152452.217251946@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152441.786066624@linuxfoundation.org> References: <20260721152441.786066624@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Renjiang Han [ Upstream commit e1c9adabb268cc5d56723b7df1da49e59070f309 ] get_framesize_raw_nv12() currently adds SZ_4K to the UV plane size and an additional SZ_8K to the total buffer size. This inflates the calculated sizeimage and leads userspace to over-allocate buffers without a clear requirement. Remove the extra SZ_4K/SZ_8K padding and compute the NV12 size as the sum of Y and UV planes, keeping the final ALIGN(size, SZ_4K) intact. Fixes: e1cb72de702ad ("media: venus: helpers: move frame size calculations on common place") Signed-off-by: Renjiang Han Reviewed-by: Dikshita Agarwal Signed-off-by: Bryan O'Donoghue Signed-off-by: Sasha Levin --- drivers/media/platform/qcom/venus/helpers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 8295542e1a7c8c..d6984129c2f361 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -954,8 +954,8 @@ static u32 get_framesize_raw_nv12(u32 width, u32 height) uv_sclines = ALIGN(((height + 1) >> 1), 16); y_plane = y_stride * y_sclines; - uv_plane = uv_stride * uv_sclines + SZ_4K; - size = y_plane + uv_plane + SZ_8K; + uv_plane = uv_stride * uv_sclines; + size = y_plane + uv_plane; return ALIGN(size, SZ_4K); } -- 2.53.0