[Intel-xe] [RFC PATCH v2 07/23] drm/xe: Add macro to get i915 device from xe_bo

Jouni Högander jouni.hogander at intel.com
Wed May 10 12:11:36 UTC 2023


Add helper macro to kill couple of #ifdefs

Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
---
 drivers/gpu/drm/xe/xe_bo_types.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_bo_types.h b/drivers/gpu/drm/xe/xe_bo_types.h
index 06de3330211d..d456d913eac9 100644
--- a/drivers/gpu/drm/xe/xe_bo_types.h
+++ b/drivers/gpu/drm/xe/xe_bo_types.h
@@ -70,4 +70,7 @@ struct xe_bo {
 	bool created;
 };
 
+#define intel_bo_to_drm_bo(bo) ((bo)->ttm.base)
+#define intel_bo_to_i915(bo) to_i915(intel_bo_to_drm_bo(bo).dev)
+
 #endif
-- 
2.34.1



More information about the Intel-xe mailing list