From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B39A72D4B78; Sun, 1 Jun 2025 23:35:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748820959; cv=none; b=gYtJ+jNaK4kv7xl7HJLsxBDp0n4z7k0i4oo54J0PLqCYl/NwR+BtULamHsOSH0+29V9DpdP524bk7WilIOJBLIq62p9GrjCCzdxDJAEiHFDDJ8p2epUEHpc8cCr/GuUEr5xIe882QD4f0HF9Mal3w+HNbnegruRCENuqA72Hj4k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748820959; c=relaxed/simple; bh=dt8kPgWDpFu2sSg07IECaKF33MJ/jwpv24xF5OlDrII=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rNHPjmF4mSmsXVrpIWvkCNYU/ppsBfzkPCdnR6C8gm/cyCPS9Q5m6ua/dbmCdc4gtjTgE3w9H9IAdKXCX2ORM7l9gqw4ZwTq394sQhPZIyIvfVfQFzZiZ3chZIzn+ltucaqVzW6/gdzGDB5mikIC8wnGP2okdoMm7kMu0O62Alw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=epGJlrNt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="epGJlrNt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6B69C4CEE7; Sun, 1 Jun 2025 23:35:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1748820959; bh=dt8kPgWDpFu2sSg07IECaKF33MJ/jwpv24xF5OlDrII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=epGJlrNtKhKIcSTtI8cqt8YALfJr5978EHciwqZYLULaGePSlYKqOSAgdCr6rljjd 63ShEDibjhTHBRM+qKphYxB/96mmwJQtGKYAJAf39tZN/KyTjzwVU0wxRxEhOBrcYp INmbnSHdVsQK81XZd12bdBThxoPjYMeIJ+xUslZSOIOg3QJcjdKuSeCmIilDPaSwTz iTYIaSjIzWtMqjecag3ghbGUkqFLFF064WuON2K9dVWrRL9kdypjmAf+b6//dfEK9h PJYA8Y7hDP5YGb1wdjJF/arZRnExL/j8/wSO+SJnh5+yyVPrwplPzuEvVjQ7GX+6cK bTO5/DOnpzE6g== From: Sasha Levin To: patches@lists.linux.dev, stable@vger.kernel.org Cc: Jonas Karlman , Nicolas Dufresne , Christopher Obbard , Hans Verkuil , Sasha Levin , ezequiel@vanguardiasur.com.ar, mchehab@kernel.org, gregkh@linuxfoundation.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH AUTOSEL 6.12 45/93] media: rkvdec: h264: Use bytesperline and buffer height as virstride Date: Sun, 1 Jun 2025 19:33:12 -0400 Message-Id: <20250601233402.3512823-45-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250601233402.3512823-1-sashal@kernel.org> References: <20250601233402.3512823-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.12.31 Content-Transfer-Encoding: 8bit From: Jonas Karlman [ Upstream commit d5e0aa61470c48ddc04d433a00e79cef8716377a ] Use bytesperline and buffer height to calculate the strides configured. This does not really change anything other than ensuring the bytesperline that is signaled to userspace matches what is configured in HW. Signed-off-by: Jonas Karlman Reviewed-by: Nicolas Dufresne Tested-by: Nicolas Dufresne Tested-by: Christopher Obbard Signed-off-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- ### Key Reasons for NO Backport: 1. **Not a Bug Fix**: The commit message explicitly states "This does not really change anything other than ensuring the bytesperline that is signaled to userspace matches what is configured in HW." This is not fixing a functional bug but rather improving consistency between userspace and hardware configuration. 2. **Code Quality/Consistency Improvement**: The changes are primarily about code correctness and consistency rather than fixing a critical issue that affects users. This aligns with similar commits #1, #2, and #4 which were marked as NO for backporting. 3. **Staging Driver**: The rkvdec driver is in `drivers/staging/media/`, which indicates it's still under development and not considered stable. Staging drivers typically have more relaxed backporting requirements. 4. **Specific Code Changes Analysis**: - **Before**: `hor_virstride = (sps->bit_depth_luma_minus8 + 8) 0001-Fix-Clippy-warnings.patch 0002-Enhance-inference-prompt-to-utilize-CVEKERNELDIR-whe.patch 0003-Update-to-latest-version-of-clap.patch Cargo.lock Cargo.toml LICENSE README.md adreno_acd_support_analysis.md amd_display_ips_sequential_ono_backport_analysis.md analyze_merge_commit.sh dpp_rcg_backport_analysis.md drm_amd_display_vertical_interrupt_dcn32_dcn401_backport_analysis.md drm_bridge_analysis.txt drm_format_helper_24bit_analysis.md drm_imagination_register_update_analysis.md drm_mediatek_mtk_dpi_refactoring_analysis.md intel_ipu6_constify_analysis.md io_uring_analysis.txt ksmbd_analysis.txt merge_commit_analysis.txt model prompt src target test_gpio_cleanup.txt test_patch.txt verisilicon_av1_4k_analysis.md dst_fmt->width / 8;` - **After**: `hor_virstride = dst_fmt->plane_fmt[0].bytesperline;` - **Before**: `ver_virstride = round_up(dst_fmt->height, 16);` - **After**: `ver_virstride = dst_fmt->height;` 5. **No Risk Indication**: The changes don't indicate they're fixing crashes, data corruption, security issues, or other critical problems that would warrant stable backporting. 6. **Pattern Match with Similar Commits**: Looking at the provided examples: - Similar commits #1, #2, #4, and #5 that make stride/calculation improvements were marked as NO - Only commit #3 that increased max supported height (a clear functional limitation fix) was marked as YES 7. **No Stable Tree Mention**: The commit message contains no indication of stable tree inclusion via Fixes: tags or explicit stable tree requests. ### Conclusion: This commit improves code consistency by using the actual bytesperline values from userspace instead of calculating them from SPS parameters, but it doesn't fix a user-impacting bug. It's a code quality improvement that follows the pattern of other NO-backport commits in the provided examples. drivers/staging/media/rkvdec/rkvdec-h264.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec-h264.c b/drivers/staging/media/rkvdec/rkvdec-h264.c index 4fc167b42cf0c..7a1e76d423df5 100644 --- a/drivers/staging/media/rkvdec/rkvdec-h264.c +++ b/drivers/staging/media/rkvdec/rkvdec-h264.c @@ -896,9 +896,9 @@ static void config_registers(struct rkvdec_ctx *ctx, dma_addr_t rlc_addr; dma_addr_t refer_addr; u32 rlc_len; - u32 hor_virstride = 0; - u32 ver_virstride = 0; - u32 y_virstride = 0; + u32 hor_virstride; + u32 ver_virstride; + u32 y_virstride; u32 yuv_virstride = 0; u32 offset; dma_addr_t dst_addr; @@ -909,16 +909,16 @@ static void config_registers(struct rkvdec_ctx *ctx, f = &ctx->decoded_fmt; dst_fmt = &f->fmt.pix_mp; - hor_virstride = (sps->bit_depth_luma_minus8 + 8) * dst_fmt->width / 8; - ver_virstride = round_up(dst_fmt->height, 16); + hor_virstride = dst_fmt->plane_fmt[0].bytesperline; + ver_virstride = dst_fmt->height; y_virstride = hor_virstride * ver_virstride; if (sps->chroma_format_idc == 0) yuv_virstride = y_virstride; else if (sps->chroma_format_idc == 1) - yuv_virstride += y_virstride + y_virstride / 2; + yuv_virstride = y_virstride + y_virstride / 2; else if (sps->chroma_format_idc == 2) - yuv_virstride += 2 * y_virstride; + yuv_virstride = 2 * y_virstride; reg = RKVDEC_Y_HOR_VIRSTRIDE(hor_virstride / 16) | RKVDEC_UV_HOR_VIRSTRIDE(hor_virstride / 16) | -- 2.39.5