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 94143CD4F59 for ; Mon, 18 May 2026 23:47:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F86D10EA05; Mon, 18 May 2026 23:47:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="fvQfNmQo"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id A500410E35E for ; Mon, 18 May 2026 23:47:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1779148051; x=1810684051; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=37r+l8jgsOXrPFA/IWQKHPptlElgU1QvfjYR/TvHf1k=; b=fvQfNmQo883R1IPHu79lzFb9sj7T2j8oQqyX5cdbrbPufPcKrUXpAk0J K85ehSh2dzk11VW5lU0EdqLUP52lGyzqOm4g+8F8Udk7k0F13WtgdZJjQ 6Yz+fpgc5m8gT2TW+pqxgyxCkO5Bh0vReJdY6SQOXJuTwo2G2EHXLP13x hq45egikx24ijpCJy7SFi9hxyZXqm+eEHy4AaJr0linuH3xcO8r4vzssA UpwBPpiZeEbTpV/qar+F1fLpDLDLWHFjVfTjK9TqEbUw6wcwGpk0itIln X/2pc6kV26c894R8tcDYj3TZn/k9P3QqKcxXjbVMXmEnPDKOXu+0bfW4N g==; X-CSE-ConnectionGUID: +d2P6HqbRfyBT5yMIyPgdw== X-CSE-MsgGUID: WWdKd9ENRr644WvAWKhRWg== X-IronPort-AV: E=McAfee;i="6800,10657,11790"; a="79866827" X-IronPort-AV: E=Sophos;i="6.23,242,1770624000"; d="scan'208";a="79866827" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2026 16:47:21 -0700 X-CSE-ConnectionGUID: ZOIrke3BTLaOTsysgTJRbg== X-CSE-MsgGUID: DqlJ3cSaSruHCyu5dH4Wrg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,242,1770624000"; d="scan'208";a="236959323" Received: from orsosgc001.jf.intel.com ([10.88.27.185]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2026 16:47:20 -0700 From: Ashutosh Dixit To: intel-xe@lists.freedesktop.org Subject: [PATCH 4/9] drm/xe/rtp: Generalize whitelist_apply_to_hwe Date: Mon, 18 May 2026 16:47:11 -0700 Message-ID: <20260518234716.1540123-5-ashutosh.dixit@intel.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260518234716.1540123-1-ashutosh.dixit@intel.com> References: <20260518234716.1540123-1-ashutosh.dixit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" Generalize whitelist_apply_to_hwe to construct both non-OA and OA whitelist nonpriv registers. Signed-off-by: Ashutosh Dixit --- drivers/gpu/drm/xe/xe_reg_whitelist.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_reg_whitelist.c b/drivers/gpu/drm/xe/xe_reg_whitelist.c index 1e788e2ee4014..6d42c00c1d75b 100644 --- a/drivers/gpu/drm/xe/xe_reg_whitelist.c +++ b/drivers/gpu/drm/xe/xe_reg_whitelist.c @@ -159,9 +159,10 @@ static const struct xe_rtp_entry_sr oa_whitelist[] = { }, }; -static int whitelist_apply_to_hwe(struct xe_hw_engine *hwe) +static int whitelist_apply_to_hwe(struct xe_hw_engine *hwe, struct xe_reg_sr *in, + struct xe_reg_sr *out, int slot_in) { - struct xe_reg_sr *sr = &hwe->reg_whitelist; + struct xe_reg_sr *sr = in; struct xe_reg_sr_entry *entry; struct drm_printer p; unsigned long reg; @@ -170,7 +171,7 @@ static int whitelist_apply_to_hwe(struct xe_hw_engine *hwe) xe_gt_dbg(hwe->gt, "Add %s whitelist to engine\n", sr->name); p = xe_gt_dbg_printer(hwe->gt); - slot = 0; + slot = slot_in; xa_for_each(&sr->xa, reg, entry) { struct xe_reg_sr_entry hwe_entry = { .reg = RING_FORCE_TO_NONPRIV(hwe->mmio_base, slot), @@ -187,7 +188,7 @@ static int whitelist_apply_to_hwe(struct xe_hw_engine *hwe) } xe_reg_whitelist_print_entry(&p, 0, reg, entry); - xe_reg_sr_add(&hwe->reg_sr, &hwe_entry, hwe->gt); + xe_reg_sr_add(out, &hwe_entry, hwe->gt); slot++; } @@ -211,7 +212,7 @@ void xe_reg_whitelist_process_engine(struct xe_hw_engine *hwe) xe_rtp_process_to_sr(&ctx, register_whitelist, ARRAY_SIZE(register_whitelist), &hwe->reg_whitelist, false); - nonpriv_slots = whitelist_apply_to_hwe(hwe); + nonpriv_slots = whitelist_apply_to_hwe(hwe, &hwe->reg_whitelist, &hwe->reg_sr, 0); xe_rtp_process_to_sr(&ctx, oa_whitelist, ARRAY_SIZE(oa_whitelist), &hwe->oa_whitelist, false); -- 2.54.0