summaryrefslogtreecommitdiffstats
path: root/include/drm/drm_vma_manager.h
diff options
context:
space:
mode:
authorThomas Zimmermann2019-02-07 09:59:31 +0100
committerAlex Deucher2019-03-19 21:03:53 +0100
commitbf141a88b329d12c9aaea4f7e7a8fdbd2dfe987d (patch)
tree2046b3bd8faca73da578d2ee8a9ef0318e254af3 /include/drm/drm_vma_manager.h
parentdrm/ttm: Quick-test mmap offset in ttm_bo_mmap() (diff)
downloadkernel-qcow2-linux-bf141a88b329d12c9aaea4f7e7a8fdbd2dfe987d.tar.gz
kernel-qcow2-linux-bf141a88b329d12c9aaea4f7e7a8fdbd2dfe987d.tar.xz
kernel-qcow2-linux-bf141a88b329d12c9aaea4f7e7a8fdbd2dfe987d.zip
drm: Use the same mmap-range offset and size for GEM and TTM
GEM defines DRM_FILE_PAGE_OFFSET_{START,SIZE} constants for the mmap-able range of addresses. TTM can use them as well. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Christian König <christian.koenig@amd.com> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'include/drm/drm_vma_manager.h')
-rw-r--r--include/drm/drm_vma_manager.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/drm/drm_vma_manager.h b/include/drm/drm_vma_manager.h
index c7987daeaed0..f4f8ff1cdeec 100644
--- a/include/drm/drm_vma_manager.h
+++ b/include/drm/drm_vma_manager.h
@@ -29,6 +29,18 @@
#include <linux/spinlock.h>
#include <linux/types.h>
+/* We make up offsets for buffer objects so we can recognize them at
+ * mmap time. pgoff in mmap is an unsigned long, so we need to make sure
+ * that the faked up offset will fit
+ */
+#if BITS_PER_LONG == 64
+#define DRM_FILE_PAGE_OFFSET_START ((0xFFFFFFFFUL >> PAGE_SHIFT) + 1)
+#define DRM_FILE_PAGE_OFFSET_SIZE ((0xFFFFFFFFUL >> PAGE_SHIFT) * 16)
+#else
+#define DRM_FILE_PAGE_OFFSET_START ((0xFFFFFFFUL >> PAGE_SHIFT) + 1)
+#define DRM_FILE_PAGE_OFFSET_SIZE ((0xFFFFFFFUL >> PAGE_SHIFT) * 16)
+#endif
+
struct drm_file;
struct drm_vma_offset_file {