From nobody Sat Nov 30 16:46:49 2024 Received: from smtp.forwardemail.net (smtp.forwardemail.net [207.246.76.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEA5418A95A for ; Mon, 9 Sep 2024 19:26:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=207.246.76.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725909967; cv=none; b=ilQSo7ENVOoQ/PsgcaFhqGYXp5wHYQvtDG0BMHkYEl2VPjm/r+uZb+Np4zWrk479fKEE94r+0gr4qGOShMkgR9FWpJ7waXw7hghwT2m7dxeqqS5pa5fmYuPTTvxIK31vQGlLL7oIqAbWaQFs3yBw8hSPkpktYGoqTgDZouw4Vso= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725909967; c=relaxed/simple; bh=40PWtHkm3lAWdPBxRclI58MPctQBA2CPhNT5ad9EirM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A+3X3ZNQxk0U/l5bmakZgO5xjzUPyt7/qD7iNUqmOYbnuE32YrUfUyai82ThEyUDGDCsLRPZCeLen5LuzgrBKTPn8CsDFxQ92Jfc6rcwy+lN0L1lShnqGgcSwRlQkVmE1c5P3A4wjqTFxwDqB+AVnWP9Im2JIx14DSvd45q8tSU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b=NyPNIiIq; arc=none smtp.client-ip=207.246.76.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fe-bounces.kwiboo.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kwiboo.se header.i=@kwiboo.se header.b="NyPNIiIq" 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=1725909950; bh=we3j17WQIW7n2HdjKlgLrR+OGSw0elTbOxzJrkOsglI=; b=NyPNIiIqKo98ZIwa2jwc5Yn4JC1uMXoBZkdNsQ/GoAS3lPEiGu93+YR4Km8USzY8NibHutwjD wJiSzER+jnGdfctixSu+wXJbyDzPqQlXflVx5+mtAyp9YsR+90h4Nsz3veTYmBWEtxasClKg8t1 bMiTsr4qPigILOQfky+qtGsWaX6NdvkriAz2bjbipA4cwUApG0pqKPqVZNRN+U0knDZpbQhBHvD dFZWtbftnuUOrx2epZ+sptno7DPqnNCTBCBiipXIT4IwwWauKreGgffYFFYcj5NFOKpVODPvKYY Ob5pM6Fpkb2i0AlrnLYh3FGNEDkENf2oKdHMrZoJBqqA== From: Jonas Karlman To: Sebastian Fricke , Ezequiel Garcia , Mauro Carvalho Chehab , Greg Kroah-Hartman Cc: Alex Bee , Nicolas Dufresne , Benjamin Gaignard , Detlev Casanova , Dan Carpenter , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Jonas Karlman , Christopher Obbard Subject: [PATCH v6 03/11] media: rkvdec: h264: Use bytesperline and buffer height as virstride Date: Mon, 9 Sep 2024 19:25:01 +0000 Message-ID: <20240909192522.1076704-4-jonas@kwiboo.se> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240909192522.1076704-1-jonas@kwiboo.se> References: <20240909192522.1076704-1-jonas@kwiboo.se> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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, 207.246.76.47 X-ForwardEmail-ID: 66df4bbcc680cb8b7d2dc1ad Content-Type: text/plain; charset="utf-8" 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 --- v6: - No change v5: - Collect r-b and t-b tags v4: - No change v3: - Remove unnecessary yuv_virstride +=3D --- 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/m= edia/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 =3D 0; - u32 ver_virstride =3D 0; - u32 y_virstride =3D 0; + u32 hor_virstride; + u32 ver_virstride; + u32 y_virstride; u32 yuv_virstride =3D 0; u32 offset; dma_addr_t dst_addr; @@ -909,16 +909,16 @@ static void config_registers(struct rkvdec_ctx *ctx, =20 f =3D &ctx->decoded_fmt; dst_fmt =3D &f->fmt.pix_mp; - hor_virstride =3D (sps->bit_depth_luma_minus8 + 8) * dst_fmt->width / 8; - ver_virstride =3D round_up(dst_fmt->height, 16); + hor_virstride =3D dst_fmt->plane_fmt[0].bytesperline; + ver_virstride =3D dst_fmt->height; y_virstride =3D hor_virstride * ver_virstride; =20 if (sps->chroma_format_idc =3D=3D 0) yuv_virstride =3D y_virstride; else if (sps->chroma_format_idc =3D=3D 1) - yuv_virstride +=3D y_virstride + y_virstride / 2; + yuv_virstride =3D y_virstride + y_virstride / 2; else if (sps->chroma_format_idc =3D=3D 2) - yuv_virstride +=3D 2 * y_virstride; + yuv_virstride =3D 2 * y_virstride; =20 reg =3D RKVDEC_Y_HOR_VIRSTRIDE(hor_virstride / 16) | RKVDEC_UV_HOR_VIRSTRIDE(hor_virstride / 16) | --=20 2.46.0