[RFC 04/14] drm/i915: Add a couple intel_gt helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>

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@xxxxxxxxx>
---
 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 &gt_to_i915(gt)->uncore;
+}
+
+#endif /* __INTEL_GT_H__ */
\ No newline at end of file
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux