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 9E389C4345F for ; Fri, 26 Apr 2024 11:11:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5FFB111228C; Fri, 26 Apr 2024 11:11:32 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Y9FN8Tc3"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id 60CA31121F6 for ; Fri, 26 Apr 2024 11:11:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714129891; x=1745665891; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=YJ9FsTaok8o7KkafhlYQn448zC3ZBjyjH0y4r/JAHPw=; b=Y9FN8Tc31Y3DAmppWgcemUdNNuUU1qIFSejwtsXgtoh8cKSMFQPNB+Tx Xoby/ByFf3CftOOE4N1cd+vMMVf07iay1g7hIwKzj91cl1zDauED+hDIZ VEseOPwsUZzklzXOYZW4cRD6j+nov0jnkOqPF+l/u1AOkj7IPH+vk2abg JfYuA7I8zjbhgN1FWfK1pAnR3XQA2RRM4kxVKZnPX5iUWJFTs0m6dU8ji Eg1LCi0pTRaYDJlDU37rwrucOuvfCJRQIt+3V/n+YVr1K4oq2SufCgXIA I9yABOhsR5LTQNR9godIet/qxfX+wNr6p0btYg6UbykEPNtafcyH3KhWB Q==; X-CSE-ConnectionGUID: cVAq/X1FTzmZFSkphZAQLA== X-CSE-MsgGUID: an5NMfmhQlmSZJ5db0Nu5w== X-IronPort-AV: E=McAfee;i="6600,9927,11055"; a="9712804" X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="9712804" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 04:11:30 -0700 X-CSE-ConnectionGUID: v9M/z9J3SF6zz8dfDWYAxg== X-CSE-MsgGUID: iyaYWYy/RVyq3W9PuRr8hg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="25384173" Received: from nirmoyda-desk.igk.intel.com ([10.102.138.190]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 04:11:28 -0700 From: Nirmoy Das To: intel-xe@lists.freedesktop.org Cc: Nirmoy Das , Balasubramani Vivekanandan , Brian Welty , Fei Yang , Jose Souza , Lionel G Landwerlin , Matt Roper , Matthew Brost , Michal Mrozek , Oak Zeng , Thomas Hellstr_m Subject: [PATCH v5 0/5] Refactor default device atomic settings Date: Fri, 26 Apr 2024 12:56:50 +0200 Message-ID: <20240426105655.23738-1-nirmoy.das@intel.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Organization: Intel Deutschland GmbH, Registered Address: Am Campeon 10, 85579 Neubiberg, Germany, Commercial Register: Amtsgericht Muenchen HRB 186928 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" The default behavior of device atomics depends on the VM type and buffer allocation types. Device atomics are expected to function with all types of allocations for traditional applications/APIs. Additionally, in compute/SVM API scenarios with fault mode or LR mode VMs, device atomics must work with single-region allocations. In all other cases device atomics should be disabled by default. PVC needs special care as it doesn't support device atomics on SMEM. v5: Fix broken atomics on PVC from v4 changes. v4: Previous assumption that device atomics should be disabled by default on SMEM only BO was wrong as traditional applications will not use such allocations for CPU atomics. So remove the VM bind flag and the query uAPI and instead refactor default device atomics settings as per VM type and buffer allocations. v3: Capture ret value of xe_vm_bind_ioctl_validate_bo(Matt B). Remove redundant coh_mode param from xe_vm_bind_ioctl_validate_bo(). Remove has_device_atomics_on_smem from xe_graphics_desc(Jose). Replace DRM_XE_QUERY_CONFIG_SUPP_DEV_ATOMIC_ON_SMEM with config flag DRM_XE_QUERY_CONFIG_FLAG_HAS_DEV_ATOMIC_ON_SMEM(Jose). Mention that PTE_AE will not be applied to userptr(Matt R) v2: Add BO helper func in xe_vm_bind_ioctl()(Matt B). Use XE_IOCTL_DBG for checks(Matt B). Move platform checks with help of adding flags in intel_device_info(Matt B). Add document for DRM_XE_VM_BIND_FLAG_DEVICE_ATOMICS(Matt B). Create query uAPI for this newly added VM bind flag(Jose, Lionel). Cc: Balasubramani Vivekanandan Cc: Brian Welty Cc: Fei Yang Cc: Jose Souza Cc: Lionel G Landwerlin Cc: Matt Roper Cc: Matthew Brost Cc: Michal Mrozek Cc: Oak Zeng Cc: Thomas Hellstr_m Nirmoy Das (5): drm/xe: Introduce has_atomic_enable_pte_bit device info drm/xe: Move vm bind bo validation to a helper function drm/xe: Introduce has_device_atomics_on_smem device info drm/xe: Add function to check if BO has single placement drm/xe: Refactor default device atomic settings drivers/gpu/drm/xe/xe_bo.c | 14 +++++ drivers/gpu/drm/xe/xe_bo.h | 1 + drivers/gpu/drm/xe/xe_device_types.h | 4 ++ drivers/gpu/drm/xe/xe_pci.c | 5 ++ drivers/gpu/drm/xe/xe_pci_types.h | 1 + drivers/gpu/drm/xe/xe_pt.c | 27 ++++++++-- drivers/gpu/drm/xe/xe_vm.c | 79 ++++++++++++++++------------ 7 files changed, 93 insertions(+), 38 deletions(-) -- 2.42.0