Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2348855rdh; Sun, 29 Oct 2023 11:47:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEUUNZQlbhOQ+pUiA93SbKaq4tbCVFEFK7lI1xFgFmgf/LZ5vlr4VA6D8YU3GxX/2+x54ZT X-Received: by 2002:a17:903:11c9:b0:1c9:e774:58e1 with SMTP id q9-20020a17090311c900b001c9e77458e1mr7848651plh.8.1698605234737; Sun, 29 Oct 2023 11:47:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698605234; cv=none; d=google.com; s=arc-20160816; b=vGL9pe6QriHvx9dg+zUfDTQ2i0Q1oeZtmXYs16UwJJqW/ZdEGt0PKSlD7GFB4faik4 8p5U+VdejoA8obepZ9o/dlH5nT0pK0JBJgcf6DQFSkVcaosJPIqpG/fT/55dgmgMyyai feBz7sdW4w1CZC9tCdLSBsB4BA5KoOnQ/meTQWyraRvZCPy3xuMUE1p7Pz/S72Wimdw2 NH19pv8/ZF4YHX8sUQh48iu+P4704Vx6VYX0CkS5QiAVpKgGcnVlnQta1TlZhnUtJf8s utbZV59avrZqHpmVZcCzefE1t2+JtXmSHEfVi06V3q3mWsC18GLsavy6fV+iAHseOP3Z XsGw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TjALA8+JUykYZHDpAwjPY9nVwije8ffpqMNBtSLkpsI=; fh=mpVSHlz6QLTMQJyYfdyLOAes1Kk5kund3qIBSdmv/MI=; b=N1NyV2TI3v+Osgoooo3gS20Mi9vRmrZOf4wWORxJ1x0aOaq0XDKc/muGtQa9Nj8mpN +wMSn92LP9T6s9BWLJMq6jgXuhWMG8yNVogh2Su99DtutLy3aJVbzDgx0iff9B1khPgH IRlq0hZ39+P+jPJaBVg4/q1nKqfbiDxyXRNinzBc6QUx6VgKo8KYTxQXK6ZcEp1TYhVh CEGNhB07NhA/d/bpaPVrYH5qEz++ApmsD9DrXeN/QM5ZljwmL9il5M4dYSNbDyc5wz+1 +fti33sdYPdJwFSfh0rAj2MraTpCihMqxf6hqDOk76/EsjJkL3/hgD8TIIOUbdm7qdVY 0sYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kwiboo.se header.s=fe-e1b5cab7be header.b=0ly+YWDL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kwiboo.se Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id l3-20020a170902d04300b001c446b59c8dsi3924908pll.271.2023.10.29.11.47.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 11:47:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kwiboo.se header.s=fe-e1b5cab7be header.b=0ly+YWDL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kwiboo.se Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 890E18061B65; Sun, 29 Oct 2023 11:46:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230519AbjJ2SqO (ORCPT + 99 others); Sun, 29 Oct 2023 14:46:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230391AbjJ2Spy (ORCPT ); Sun, 29 Oct 2023 14:45:54 -0400 Received: from smtp.forwardemail.net (smtp.forwardemail.net [149.28.215.223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8FC9EE; Sun, 29 Oct 2023 11:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1698605142; bh=TjALA8+JUykYZHDpAwjPY9nVwije8ffpqMNBtSLkpsI=; b=0ly+YWDLBVm51SnIOA/FhxAjf8NTj4SjSIRf0TAlXphOi14vMZD9mbGRjLrPz5mjdhvPnCC8y ApDpG4yi7/ZLQZxlIpwQjnPML5Z4yk8n/0aNN/C9d82x3bBRQWB7EKDTrEQcZVQ28RNerqLJT1+ 9XsVMS1ULbLMXjSbGHu8rVOEt1S1YtkQ8+nbgP5XC0wg5mO8332iypBWioUDHFVs2YYl1Zu456j PHTZhG5okEgRmbJ4g7/yff0desRMURdSeI/oC+mZlO/TGdFytYLt/2Pc+JMcCbyML6a4I2odEtc xht2Vms1I9Sf3rdhEd6DlL2zqyNIygEqufE6eZIMuhVg== From: Jonas Karlman To: Ezequiel Garcia , Mauro Carvalho Chehab , "Greg Kroah-Hartman" Cc: Alex Bee , Nicolas Dufresne , Benjamin Gaignard , Sebastian Fricke , Christopher Obbard , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Jonas Karlman Subject: [PATCH v3 03/10] media: rkvdec: h264: Use bytesperline and buffer height as virstride Date: Sun, 29 Oct 2023 18:34:10 +0000 Message-ID: <20231029183427.1781554-4-jonas@kwiboo.se> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231029183427.1781554-1-jonas@kwiboo.se> References: <20231029183427.1781554-1-jonas@kwiboo.se> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 149.28.215.223 X-ForwardEmail-ID: 653ea5c58fe0ffca230b0f2f X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 29 Oct 2023 11:46:24 -0700 (PDT) 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 --- v3: - Remove unnecessary yuv_virstride += 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 4fc167b42cf0..7a1e76d423df 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.42.0