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 B52D0C61DB2 for ; Thu, 5 Jun 2025 15:30:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 66CE810E94D; Thu, 5 Jun 2025 15:30:56 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="dUE3N9bw"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7BC9D10E8A8 for ; Thu, 5 Jun 2025 15:30:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1749137454; x=1780673454; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=73zeleJWGbSGZsRvzUEabXLTBsH/HM6ykS9dGhAXwcs=; b=dUE3N9bwb+j9cgEiTwzJgy2DnqdVfjWsPsUe74FSuqOUkEFMPt4lfGco u5fj4Lr4b+u/8HWkLpNmsNULOi8zmwGAKYmA2A2N0c8rFUciZscnkBAFO n80XyBzEiXHO5ftyZ28RESLo0iM1wiJhkcw0S2oiS01vq/2sFQGn+vyDy 6llPHg9+C4mWf0Vq2jcFQVr7QQhPBcyTWZoHuMP1n5SuF216GBVpt9J9I LO7hFUWOAwvkNmfIHr4fiKEN2bRvLpszLQrykgrGszEzUCzASvBnSppaq dlNnI6p9jrD9ydmFQ4c1aWPmCIi7XxGTHw8jQJqTyOpBeXDkBWAhR00Le w==; X-CSE-ConnectionGUID: d4wcG/SSTZa2YvU+fwwxoQ== X-CSE-MsgGUID: R++Z+EXAQou/BlEjARwU2A== X-IronPort-AV: E=McAfee;i="6800,10657,11455"; a="61529483" X-IronPort-AV: E=Sophos;i="6.16,212,1744095600"; d="scan'208";a="61529483" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2025 08:30:51 -0700 X-CSE-ConnectionGUID: VMChSfBDTYet4VUEIlC0XA== X-CSE-MsgGUID: WJaHPZPJSKiSYUm9/NEunw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,212,1744095600"; d="scan'208";a="176502791" Received: from lstrano-desk.jf.intel.com ([10.54.39.91]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2025 08:30:52 -0700 From: Matthew Brost To: intel-xe@lists.freedesktop.org Cc: francois.dugast@intel.com, thomas.hellstrom@linux.intel.com, himal.prasad.ghimiray@intel.com Subject: [PATCH 01/15] drm/xe: Drop struct xe_migrate_pt_update argument from populate / clear vfuns Date: Thu, 5 Jun 2025 08:32:09 -0700 Message-Id: <20250605153223.2789122-2-matthew.brost@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250605153223.2789122-1-matthew.brost@intel.com> References: <20250605153223.2789122-1-matthew.brost@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" struct xe_migrate_pt_update will not be available in run job where CPU binds will be implemented. This field is used in populate and replaced with a VM field in clear. Signed-off-by: Matthew Brost --- drivers/gpu/drm/xe/xe_migrate.c | 9 +++++---- drivers/gpu/drm/xe/xe_migrate.h | 12 +++++------- drivers/gpu/drm/xe/xe_pt.c | 12 +++++------- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c index 8f8e9fdfb2a8..d8b50305df87 100644 --- a/drivers/gpu/drm/xe/xe_migrate.c +++ b/drivers/gpu/drm/xe/xe_migrate.c @@ -1199,6 +1199,7 @@ static void write_pgtable(struct xe_tile *tile, struct xe_bb *bb, u64 ppgtt_ofs, struct xe_migrate_pt_update *pt_update) { const struct xe_migrate_pt_update_ops *ops = pt_update->ops; + struct xe_vm *vm = pt_update->vops->vm; u32 chunk; u32 ofs = update->ofs, size = update->qwords; @@ -1230,10 +1231,10 @@ static void write_pgtable(struct xe_tile *tile, struct xe_bb *bb, u64 ppgtt_ofs, bb->cs[bb->len++] = lower_32_bits(addr); bb->cs[bb->len++] = upper_32_bits(addr); if (pt_op->bind) - ops->populate(pt_update, tile, NULL, bb->cs + bb->len, + ops->populate(tile, NULL, bb->cs + bb->len, ofs, chunk, update); else - ops->clear(pt_update, tile, NULL, bb->cs + bb->len, + ops->clear(vm, tile, NULL, bb->cs + bb->len, ofs, chunk, update); bb->len += chunk * 2; @@ -1290,12 +1291,12 @@ xe_migrate_update_pgtables_cpu(struct xe_migrate *m, &pt_op->entries[j]; if (pt_op->bind) - ops->populate(pt_update, m->tile, + ops->populate(m->tile, &update->pt_bo->vmap, NULL, update->ofs, update->qwords, update); else - ops->clear(pt_update, m->tile, + ops->clear(vm, m->tile, &update->pt_bo->vmap, NULL, update->ofs, update->qwords, update); } diff --git a/drivers/gpu/drm/xe/xe_migrate.h b/drivers/gpu/drm/xe/xe_migrate.h index fb9839c1bae0..b064455b604e 100644 --- a/drivers/gpu/drm/xe/xe_migrate.h +++ b/drivers/gpu/drm/xe/xe_migrate.h @@ -31,7 +31,6 @@ struct xe_vma; struct xe_migrate_pt_update_ops { /** * @populate: Populate a command buffer or page-table with ptes. - * @pt_update: Embeddable callback argument. * @tile: The tile for the current operation. * @map: struct iosys_map into the memory to be populated. * @pos: If @map is NULL, map into the memory to be populated. @@ -43,13 +42,12 @@ struct xe_migrate_pt_update_ops { * page-table system to populate command buffers or shared * page-tables with PTEs. */ - void (*populate)(struct xe_migrate_pt_update *pt_update, - struct xe_tile *tile, struct iosys_map *map, + void (*populate)(struct xe_tile *tile, struct iosys_map *map, void *pos, u32 ofs, u32 num_qwords, const struct xe_vm_pgtable_update *update); /** * @clear: Clear a command buffer or page-table with ptes. - * @pt_update: Embeddable callback argument. + * @vm: VM being updated * @tile: The tile for the current operation. * @map: struct iosys_map into the memory to be populated. * @pos: If @map is NULL, map into the memory to be populated. @@ -61,9 +59,9 @@ struct xe_migrate_pt_update_ops { * page-table system to populate command buffers or shared * page-tables with PTEs. */ - void (*clear)(struct xe_migrate_pt_update *pt_update, - struct xe_tile *tile, struct iosys_map *map, - void *pos, u32 ofs, u32 num_qwords, + void (*clear)(struct xe_vm *vm, struct xe_tile *tile, + struct iosys_map *map, void *pos, u32 ofs, + u32 num_qwords, const struct xe_vm_pgtable_update *update); /** diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c index f39d5cc9f411..db1c363a65d5 100644 --- a/drivers/gpu/drm/xe/xe_pt.c +++ b/drivers/gpu/drm/xe/xe_pt.c @@ -962,9 +962,8 @@ bool xe_pt_zap_ptes_range(struct xe_tile *tile, struct xe_vm *vm, } static void -xe_vm_populate_pgtable(struct xe_migrate_pt_update *pt_update, struct xe_tile *tile, - struct iosys_map *map, void *data, - u32 qword_ofs, u32 num_qwords, +xe_vm_populate_pgtable(struct xe_tile *tile, struct iosys_map *map, + void *data, u32 qword_ofs, u32 num_qwords, const struct xe_vm_pgtable_update *update) { struct xe_pt_entry *ptes = update->pt_entries; @@ -1735,12 +1734,11 @@ static unsigned int xe_pt_stage_unbind(struct xe_tile *tile, } static void -xe_migrate_clear_pgtable_callback(struct xe_migrate_pt_update *pt_update, - struct xe_tile *tile, struct iosys_map *map, - void *ptr, u32 qword_ofs, u32 num_qwords, +xe_migrate_clear_pgtable_callback(struct xe_vm *vm, struct xe_tile *tile, + struct iosys_map *map, void *ptr, + u32 qword_ofs, u32 num_qwords, const struct xe_vm_pgtable_update *update) { - struct xe_vm *vm = pt_update->vops->vm; u64 empty = __xe_pt_empty_pte(tile, vm, update->pt->level); int i; -- 2.34.1