[Intel-gfx] [RFC 04/14] drm/i915: Add a couple intel_gt helpers
Tvrtko Ursulin
tvrtko.ursulin at linux.intel.com
Mon Jun 10 15:54:09 UTC 2019
From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Two trivial helpers to convert from intel_gt to i915 and uncore which will
be needed by the following patches.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
drivers/gpu/drm/i915/gt/intel_gt.h | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 drivers/gpu/drm/i915/gt/intel_gt.h
diff --git a/drivers/gpu/drm/i915/gt/intel_gt.h b/drivers/gpu/drm/i915/gt/intel_gt.h
new file mode 100644
index 000000000000..b672f8b03bfd
--- /dev/null
+++ b/drivers/gpu/drm/i915/gt/intel_gt.h
@@ -0,0 +1,26 @@
+/*
+ * SPDX-License-Identifier: MIT
+ *
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_GT__
+#define __INTEL_GT__
+
+#include "gt/intel_gt_types.h"
+
+#include "intel_uncore.h"
+
+#include "i915_drv.h"
+
+static inline struct drm_i915_private *gt_to_i915(struct intel_gt *gt)
+{
+ return container_of(gt, struct drm_i915_private, gt);
+}
+
+static inline struct intel_uncore *gt_to_uncore(struct intel_gt *gt)
+{
+ return >_to_i915(gt)->uncore;
+}
+
+#endif /* __INTEL_GT_H__ */
\ No newline at end of file
--
2.20.1
More information about the Intel-gfx
mailing list