summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_bo.c
diff options
context:
space:
mode:
authorNirmoy Das <nirmoy.das@intel.com>2024-04-30 18:25:28 +0200
committerNirmoy Das <nirmoy.das@intel.com>2024-05-06 18:14:11 +0200
commita4b725767d93e3564019906ad43908b8bf3d4d9e (patch)
tree1d6ce72397c8d8c5c57a1660d7719784793f5088 /drivers/gpu/drm/xe/xe_bo.c
parent06e69a424930154bf030a56f8ddf781aee71f0e3 (diff)
downloadlwn-a4b725767d93e3564019906ad43908b8bf3d4d9e.tar.gz
lwn-a4b725767d93e3564019906ad43908b8bf3d4d9e.zip
drm/xe: Add function to check if BO has single placement
A new helper function xe_bo_has_single_placement() to check if a BO has single placement. Reviewed-by: José Roberto de Souza <jose.souza@intel.com> Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240430162529.21588-5-nirmoy.das@intel.com Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_bo.c')
-rw-r--r--drivers/gpu/drm/xe/xe_bo.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
index 52a16cb4e736..03f7fe7acf8c 100644
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -96,6 +96,20 @@ bool xe_bo_is_stolen(struct xe_bo *bo)
}
/**
+ * xe_bo_has_single_placement - check if BO is placed only in one memory location
+ * @bo: The BO
+ *
+ * This function checks whether a given BO is placed in only one memory location.
+ *
+ * Returns: true if the BO is placed in a single memory location, false otherwise.
+ *
+ */
+bool xe_bo_has_single_placement(struct xe_bo *bo)
+{
+ return bo->placement.num_placement == 1;
+}
+
+/**
* xe_bo_is_stolen_devmem - check if BO is of stolen type accessed via PCI BAR
* @bo: The BO
*