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 3/4] drm:  Add __arm defines to DRM
Date: Wed,  4 Aug 2010 14:48:25 -0600	[thread overview]
Message-ID: <1280954906-31645-4-git-send-email-jcrouse@codeaurora.org> (raw)
In-Reply-To: <1274989227-11669-1-git-send-email-jcrouse@codeaurora.org>

Add __arm defines to specify behavior specific for
an ARM processor.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
---
 drivers/gpu/drm/drm_bufs.c |    2 +-
 drivers/gpu/drm/drm_vm.c   |   14 +++++++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
index 3c2c663..a5c9ce9 100644
--- a/drivers/gpu/drm/drm_bufs.c
+++ b/drivers/gpu/drm/drm_bufs.c
@@ -176,7 +176,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
 	switch (map->type) {
 	case _DRM_REGISTERS:
 	case _DRM_FRAME_BUFFER:
-#if !defined(__sparc__) && !defined(__alpha__) && !defined(__ia64__) && !defined(__powerpc64__) && !defined(__x86_64__)
+#if !defined(__sparc__) && !defined(__alpha__) && !defined(__ia64__) && !defined(__powerpc64__) && !defined(__x86_64__) && !defined(__arm__)
 		if (map->offset + (map->size-1) < map->offset ||
 		    map->offset < virt_to_phys(high_memory)) {
 			kfree(map);
diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
index c3b13fb..3778360 100644
--- a/drivers/gpu/drm/drm_vm.c
+++ b/drivers/gpu/drm/drm_vm.c
@@ -61,7 +61,7 @@ static pgprot_t drm_io_prot(uint32_t map_type, struct vm_area_struct *vma)
 		tmp = pgprot_writecombine(tmp);
 	else
 		tmp = pgprot_noncached(tmp);
-#elif defined(__sparc__)
+#elif defined(__sparc__) || defined(__arm__)
 	tmp = pgprot_noncached(tmp);
 #endif
 	return tmp;
@@ -601,6 +601,7 @@ int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
 	}
 
 	switch (map->type) {
+#if !defined(__arm__)
 	case _DRM_AGP:
 		if (drm_core_has_AGP(dev) && dev->agp->cant_use_aperture) {
 			/*
@@ -615,20 +616,31 @@ int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
 			break;
 		}
 		/* fall through to _DRM_FRAME_BUFFER... */
+#endif
 	case _DRM_FRAME_BUFFER:
 	case _DRM_REGISTERS:
 		offset = dev->driver->get_reg_ofs(dev);
 		vma->vm_flags |= VM_IO;	/* not in core dump */
 		vma->vm_page_prot = drm_io_prot(map->type, vma);
+#if !defined(__arm__)
 		if (io_remap_pfn_range(vma, vma->vm_start,
 				       (map->offset + offset) >> PAGE_SHIFT,
 				       vma->vm_end - vma->vm_start,
 				       vma->vm_page_prot))
 			return -EAGAIN;
+#else
+		if (remap_pfn_range(vma, vma->vm_start,
+					(map->offset + offset) >> PAGE_SHIFT,
+					vma->vm_end - vma->vm_start,
+					vma->vm_page_prot))
+			return -EAGAIN;
+#endif
+
 		DRM_DEBUG("   Type = %d; start = 0x%lx, end = 0x%lx,"
 			  " offset = 0x%llx\n",
 			  map->type,
 			  vma->vm_start, vma->vm_end, (unsigned long long)(map->offset + offset));
+
 		vma->vm_ops = &drm_vm_ops;
 		break;
 	case _DRM_CONSISTENT:
-- 
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     ` Jordan Crouse [this message]
2010-08-04 20:48     ` [PATCH 4/4] drm: Make sure the DRM offset matches the CPU Jordan Crouse
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-4-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).