From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [Intel-xe] [PATCH 07/10] Update compat headers.
Date: Wed, 25 Oct 2023 12:20:42 +0200 [thread overview]
Message-ID: <20231025102045.817068-8-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20231025102045.817068-1-maarten.lankhorst@linux.intel.com>
Some naughty headers used I915_GEM_OBJECT_H instead of their own name,
fix it.
Update headers to move some stuff out from the messy patch.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
| 2 +
| 58 +++++++++++++++++++
.../gem/i915_gem_object_frontbuffer.h | 4 +-
| 4 +-
| 6 ++
5 files changed, 70 insertions(+), 4 deletions(-)
create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_lmem.h
create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object.h
--git a/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_lmem.h b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_lmem.h
new file mode 100644
index 0000000000000..2f55e7e951e8c
--- /dev/null
+++ b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_lmem.h
@@ -0,0 +1,2 @@
+/* Empty */
+
--git a/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object.h b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object.h
new file mode 100644
index 0000000000000..5f0545a3a99b1
--- /dev/null
+++ b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object.h
@@ -0,0 +1,58 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2023 Intel Corporation
+ */
+
+#ifndef _I915_GEM_OBJECT_H_
+#define _I915_GEM_OBJECT_H_
+
+/* For tiling definitions */
+#include <uapi/drm/i915_drm.h>
+
+#undef I915_TILING_X
+#undef I915_TILING_Y
+#define I915_TILING_X 0
+#define I915_TILING_Y 0
+
+#include "xe_bo.h"
+#include <linux/types.h>
+
+static inline int i915_gem_object_read_from_page(struct xe_bo *bo,
+ u32 ofs, u64 *ptr, u32 size)
+{
+ struct ttm_bo_kmap_obj map;
+ void *virtual;
+ bool is_iomem;
+ int ret;
+
+ WARN_ON(size != 8);
+
+ ret = xe_bo_lock(bo, true);
+ if (ret)
+ return ret;
+
+ ret = ttm_bo_kmap(&bo->ttm, ofs >> PAGE_SHIFT, 1, &map);
+ if (ret)
+ goto out_unlock;
+
+ ofs &= ~PAGE_MASK;
+ virtual = ttm_kmap_obj_virtual(&map, &is_iomem);
+ if (is_iomem)
+ *ptr = readq((void __iomem *)(virtual + ofs));
+ else
+ *ptr = *(u64 *)(virtual + ofs);
+
+ ttm_bo_kunmap(&map);
+out_unlock:
+ xe_bo_unlock(bo);
+ return ret;
+}
+
+static inline dma_addr_t i915_gem_object_get_dma_address(const struct xe_bo *bo, pgoff_t n)
+{
+ /* Should never be called */
+ WARN_ON(1);
+ return n;
+}
+
+#endif
diff --git a/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object_frontbuffer.h b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object_frontbuffer.h
index 227965e5f7846..6d883aca48b6e 100644
--- a/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object_frontbuffer.h
+++ b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object_frontbuffer.h
@@ -3,8 +3,8 @@
* Copyright © 2022 Intel Corporation
*/
-#ifndef _I915_GEM_OBJECT_H_
-#define _I915_GEM_OBJECT_H_
+#ifndef _I915_GEM_OBJECT_FB_H_
+#define _I915_GEM_OBJECT_FB_H_
#define i915_gem_object_get_frontbuffer(obj) NULL
#define i915_gem_object_set_frontbuffer(obj, front) (front)
--git a/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h b/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h
index 32f60258ded69..888e7a87a9257 100644
--- a/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h
+++ b/drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h
@@ -1,5 +1,5 @@
-#ifndef _I915_GEM_OBJECT_H_
-#define _I915_GEM_OBJECT_H_
+#ifndef _I915_GEM_STOLEN_H_
+#define _I915_GEM_STOLEN_H_
#include "xe_ttm_stolen_mgr.h"
#include "xe_res_cursor.h"
--git a/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h b/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h
index 9424144b1b5aa..23f2d037c313e 100644
--- a/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h
+++ b/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h
@@ -19,4 +19,10 @@ struct i915_vma {
#define i915_ggtt_clear_scanout(bo) do { } while (0)
#define i915_vma_fence_id(vma) -1
+
+static inline u32 i915_ggtt_offset(const struct i915_vma *vma)
+{
+ return vma->node.start;
+}
+
#endif
--
2.39.2
next prev parent reply other threads:[~2023-10-25 10:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-25 10:20 [Intel-xe] [PATCH 00/10] Split out most of "FIXME: drm/i915/display: Remaining changes to make xe compile" Maarten Lankhorst
2023-10-25 10:20 ` [Intel-xe] [PATCH 01/10] revert fixme in intel_atomic_plane.c Maarten Lankhorst
2023-10-25 10:20 ` [Intel-xe] [PATCH 02/10] drm/atomic: Add drm_atomic_helper_set_fence_deadline() function Maarten Lankhorst
2023-10-25 10:20 ` [Intel-xe] [PATCH 03/10] drm/i915: Implement fence->set_deadline Maarten Lankhorst
2023-10-25 10:20 ` [Intel-xe] [PATCH 04/10] FIXME drm/i915/display: Use fence->set_deadline to boost requests Maarten Lankhorst
2023-10-27 10:05 ` [Intel-xe] [04/10] " Hogander, Jouni
2023-10-25 10:20 ` [Intel-xe] [PATCH 05/10] fixup xe i915_drv.h compat header Maarten Lankhorst
2023-10-25 10:20 ` [Intel-xe] [PATCH 06/10] revert intel_frontbuffer changes Maarten Lankhorst
2023-10-27 10:17 ` [Intel-xe] [06/10] " Hogander, Jouni
2023-10-25 10:20 ` Maarten Lankhorst [this message]
2023-10-25 10:20 ` [Intel-xe] [PATCH 08/10] more reverts Maarten Lankhorst
2023-10-25 10:20 ` [Intel-xe] [PATCH 09/10] drm/i915/display: Use i915_gem_object_get_dma_address to get dma address Maarten Lankhorst
2023-10-25 10:20 ` [Intel-xe] [PATCH 10/10] revert more (fbc) Maarten Lankhorst
2023-10-27 10:01 ` [Intel-xe] [10/10] " Hogander, Jouni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231025102045.817068-8-maarten.lankhorst@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=intel-xe@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.