linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jordan Crouse <jcrouse@codeaurora.org>
To: dri-devel@lists.freedesktop.org
Cc: linux-arm-msm@vger.kernel.org, Jordan Crouse <jcrouse@codeaurora.org>
Subject: [PATCH 4/4] drm:  Make sure the DRM offset matches the CPU
Date: Wed,  4 Aug 2010 14:48:26 -0600	[thread overview]
Message-ID: <1280954906-31645-5-git-send-email-jcrouse@codeaurora.org> (raw)
In-Reply-To: <1274989227-11669-1-git-send-email-jcrouse@codeaurora.org>

The pgoff option in mmap() is defined as an unsigned long
so the offset generated by DRM needs to fit into
BITS_PER_LONG for the CPU in question.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
---
 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 33dad3f..8601b72 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -68,8 +68,18 @@
  * 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
 
 /**
  * Initialize the GEM device fields
-- 
1.7.0.1


  parent reply	other threads:[~2010-08-04 20:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4B8BE42C.1090401@codeaurora.org>
     [not found] ` <4B8BE489.7020402@codeaurora.org>
2010-03-15  0:56   ` [PATCH] drm: Allow platform devices to register as DRM devices Dave Airlie
2010-03-15 18:04     ` Jordan Crouse
2010-03-16  3:05       ` Dave Airlie
2010-03-16  2:41     ` Paul Mundt
2010-03-15 19:27   ` Ville Syrjälä
2010-05-27 19:40   ` [PATCH v2] DRM platform device support jcrouse
2010-08-04 20:48     ` [PATCH v3] " Jordan Crouse
2010-08-04 20:48     ` [PATCH 1/4] drm: Remove drm_resource wrappers Jordan Crouse
2010-08-04 20:53       ` Matt Turner
2010-08-04 20:48     ` [PATCH 2/4] drm: Add support for platform devices to register as DRM devices Jordan Crouse
2010-08-04 20:48     ` [PATCH 3/4] drm: Add __arm defines to DRM Jordan Crouse
2010-08-04 20:48     ` Jordan Crouse [this message]
2010-05-27 19:40   ` [PATCH 1/4] drm: Remove drm_resource wrappers jcrouse
2010-05-27 21:15     ` Matt Turner
2010-05-27 19:40   ` [PATCH 2/4] drm: Add support for platform devices to register as DRM devices jcrouse
2010-05-27 19:40   ` [PATCH 3/4] drm: Add __arm defines to DRM jcrouse
2010-05-27 19:40   ` [PATCH 4/4] drm: Make sure the DRM offset matches the CPU jcrouse

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=1280954906-31645-5-git-send-email-jcrouse@codeaurora.org \
    --to=jcrouse@codeaurora.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).