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 B525BC3DA49 for ; Tue, 30 Jul 2024 11:49:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7564910E50D; Tue, 30 Jul 2024 11:49:07 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="cbZSVDCq"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id B883310E516 for ; Tue, 30 Jul 2024 11:49:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1722340147; x=1753876147; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hjLMOHlNO8AleDNGrEzIJHH7o3VRK1t7It/GmekWzqE=; b=cbZSVDCqXU92CpfcGJQlWxf8e6oj+elY+5SqUeyfSR5JpFG8J4KqSlpS UQ0d3NxTTBpTzew/IjOpueJJ/YgK7MPepoo0nlQJD094jd7ab5iy4qI3W OOWgih0V/3GEB5rzaBDE2RdVqdmWpNwMzTAH4JFpma3Izv5+4vmxI8cmp z4fnBKNgna+G9c6gbVTOH4ANIk/0gKaQVEQP7wQgEybYh5HH0yOps44My +ePRrKG6JTkPG5vKLl6kwd2jzmLWuOkECDJU95xJutd+YUePjsNliAW5p 70O7iUOeqGAcq/qCNXxNLKcmO2XxL03jWp+7sFF9O0fy7JECWCctUwTsv A==; X-CSE-ConnectionGUID: 7oQNkozuRCaVxXM6MmCzow== X-CSE-MsgGUID: CUobJ649QGmyjS0Cx5A40A== X-IronPort-AV: E=McAfee;i="6700,10204,11148"; a="23937474" X-IronPort-AV: E=Sophos;i="6.09,248,1716274800"; d="scan'208";a="23937474" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2024 04:49:07 -0700 X-CSE-ConnectionGUID: HPVhFu3tQy+Vz/hFRUGoLQ== X-CSE-MsgGUID: mRZUlw8lQMaiTls93MuIxA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,248,1716274800"; d="scan'208";a="54217354" Received: from cpetruta-mobl1.ger.corp.intel.com (HELO localhost.localdomain) ([10.245.246.43]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2024 04:49:03 -0700 From: Christoph Manszewski To: igt-dev@lists.freedesktop.org Cc: =?UTF-8?q?Zbigniew=20Kempczy=C5=84ski?= , Kamil Konieczny , Dominik Grzegorzek , Maciej Patelczyk , =?UTF-8?q?Dominik=20Karol=20Pi=C4=85tkowski?= , Pawel Sikora , Andrzej Hajda , Kolanupaka Naveena , Mika Kuoppala , Gwan-gyeong Mun Subject: [PATCH i-g-t v2 48/66] lib/intel_batchbuffer: Add helper to get pointer at specified offset Date: Tue, 30 Jul 2024 13:45:05 +0200 Message-Id: <20240730114523.334156-49-christoph.manszewski@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240730114523.334156-1-christoph.manszewski@intel.com> References: <20240730114523.334156-1-christoph.manszewski@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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" From: Andrzej Hajda The helper will be used to access data placed in batchbuffer. Signed-off-by: Andrzej Hajda Cc: Mika Kuoppala Cc: Dominik Grzegorzek --- lib/intel_batchbuffer.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h index cb32206e5..7caf6c518 100644 --- a/lib/intel_batchbuffer.h +++ b/lib/intel_batchbuffer.h @@ -353,6 +353,11 @@ static inline uint32_t intel_bb_offset(struct intel_bb *ibb) return (uint32_t) ((uint8_t *) ibb->ptr - (uint8_t *) ibb->batch); } +static inline void *intel_bb_ptr_get(struct intel_bb *ibb, uint32_t offset) +{ + return ((uint8_t *) ibb->batch + offset); +} + static inline void intel_bb_ptr_set(struct intel_bb *ibb, uint32_t offset) { ibb->ptr = (void *) ((uint8_t *) ibb->batch + offset); -- 2.34.1