From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AA9F3CCFA13 for ; Mon, 10 Nov 2025 14:49:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3328710E402; Mon, 10 Nov 2025 14:49:01 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="MAiRR18p"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by gabe.freedesktop.org (Postfix) with ESMTPS id C7B2B10E402 for ; Mon, 10 Nov 2025 14:48:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1762786140; x=1794322140; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=IWRAcALaXu7lmMMNc6AUV8YarnB1PhbeJM73glfRcnk=; b=MAiRR18puIyNIOUuM4shm4MXHuoDnB2ZHx30TmHM9WpDfc25GI4NWOO1 d6yRjqXFJ1VzQ9ocsfBTb8rVRnkOzcz8R6G2NYJUdViIlXGYzCE1YTeal zJnr3M8eQC5UaGPOTKqJXg2yfC71qGbT1Z4ftEZlkY7k5OoyaK5zij+eM UE0cJQdw9z3oNQLWKZ7aro3tsDJzMmTbQ84soN488c2Cr658Z7Guw7NPe QJsGvkOS8nSFsqvRhuulnncceEfZlUrZY0WahKynX9Dr5vTbVe93x6ZMv H1ANVFA6c00AwN6oLrHbs9sz0CvtkPEH/tU5KcIqnPea/YQ822zYAMEgK g==; X-CSE-ConnectionGUID: 0JK7dq8LQ9WcBIDE67UAgg== X-CSE-MsgGUID: dXGV5QdaSx+raThQfzefrw== X-IronPort-AV: E=McAfee;i="6800,10657,11531"; a="64745187" X-IronPort-AV: E=Sophos;i="6.17,312,1747724400"; d="scan'208";a="64745187" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2025 06:48:59 -0800 X-CSE-ConnectionGUID: 5C//ofEJTF+ZrXdZbkr2mw== X-CSE-MsgGUID: WRC3KwBDRlWHRqDt+9FW9g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,293,1754982000"; d="scan'208";a="188855215" Received: from gjloop-mobl.amr.corp.intel.com (HELO adixit-MOBL3.intel.com) ([10.125.49.216]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2025 06:48:59 -0800 Date: Mon, 10 Nov 2025 06:48:58 -0800 Message-ID: <87346muen9.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Balasubramani Vivekanandan Cc: igt-dev@lists.freedesktop.org, Zbigniew Kempczynski Subject: Re: [PATCH 1/2] lib/intel_blt: BB index should be incremented in dwords In-Reply-To: <20251110135805.3620715-3-balasubramani.vivekanandan@intel.com> References: <20251110135805.3620715-3-balasubramani.vivekanandan@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" On Mon, 10 Nov 2025 05:58:06 -0800, Balasubramani Vivekanandan wrote: > > Size in bytes in used to increment the BB index, which is incorrect. > Convert bytes to number of dwords. > > Signed-off-by: Balasubramani Vivekanandan > --- > lib/intel_blt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/intel_blt.c b/lib/intel_blt.c > index 7f7f5485e..9a0bcb96b 100644 > --- a/lib/intel_blt.c > +++ b/lib/intel_blt.c > @@ -1714,7 +1714,7 @@ uint64_t emit_blt_fast_copy(int fd, > > igt_assert(bb_pos + sizeof(data) < blt->bb.size); > memcpy(bb + bb_pos, &data, sizeof(data)); What about here? > - bb_pos += sizeof(data); > + bb_pos += DIV_ROUND_UP(sizeof(data), sizeof(*bb)); > > if (emit_bbe) { > igt_assert(bb_pos + sizeof(uint32_t) < blt->bb.size); Here also has: bb_pos += sizeof(uint32_t); And the function is returning bb_pos and can be called multiple times with the returned bb_pos. > -- > 2.43.0 > So there are multiple places where bb_pos is being added to bb. Maybe the fix should be to just make bb a uint8_t * rather than uint32 * ?