diff options
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/drm_gem.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 33dad3fa6043..8601b72b6f26 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c | |||
@@ -68,8 +68,18 @@ | |||
68 | * We make up offsets for buffer objects so we can recognize them at | 68 | * We make up offsets for buffer objects so we can recognize them at |
69 | * mmap time. | 69 | * mmap time. |
70 | */ | 70 | */ |
71 | |||
72 | /* pgoff in mmap is an unsigned long, so we need to make sure that | ||
73 | * the faked up offset will fit | ||
74 | */ | ||
75 | |||
76 | #if BITS_PER_LONG == 64 | ||
71 | #define DRM_FILE_PAGE_OFFSET_START ((0xFFFFFFFFUL >> PAGE_SHIFT) + 1) | 77 | #define DRM_FILE_PAGE_OFFSET_START ((0xFFFFFFFFUL >> PAGE_SHIFT) + 1) |
72 | #define DRM_FILE_PAGE_OFFSET_SIZE ((0xFFFFFFFFUL >> PAGE_SHIFT) * 16) | 78 | #define DRM_FILE_PAGE_OFFSET_SIZE ((0xFFFFFFFFUL >> PAGE_SHIFT) * 16) |
79 | #else | ||
80 | #define DRM_FILE_PAGE_OFFSET_START ((0xFFFFFFFUL >> PAGE_SHIFT) + 1) | ||
81 | #define DRM_FILE_PAGE_OFFSET_SIZE ((0xFFFFFFFUL >> PAGE_SHIFT) * 16) | ||
82 | #endif | ||
73 | 83 | ||
74 | /** | 84 | /** |
75 | * Initialize the GEM device fields | 85 | * Initialize the GEM device fields |