Date: Thu, 24 Sep 2009 12:16:43 -0500 From: Robert Noland <rnoland@FreeBSD.org> To: Richard Kolkovich <sarumont@sigil.org> Cc: freebsd-x11@freebsd.org Subject: Re: HD4550 DRI issues Message-ID: <1253812603.2031.1528.camel@balrog.2hip.net> In-Reply-To: <20090924145417.GA2539@magus.portal.sigil.org> References: <20090923210626.GC46493@magus.portal.sigil.org> <1253741283.2031.334.camel@balrog.2hip.net> <20090924145417.GA2539@magus.portal.sigil.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Thu, 2009-09-24 at 09:54 -0500, Richard Kolkovich wrote:
> (II) RADEON(0): [pci] 32768 kB allocated with handle 0xdc85e000
> (II) RADEON(0): [pci] ring handle = 0xdc85e000
> (II) RADEON(0): [pci] Ring mapped at 0x28a2c000
> (II) RADEON(0): [pci] Ring contents 0x4cf0c1f7
> (II) RADEON(0): [pci] ring read ptr handle = 0xdc95f000
> (II) RADEON(0): [pci] Ring read ptr mapped at 0x286fb000
> (II) RADEON(0): [pci] Ring read ptr contents 0x1fa2f22c
> (II) RADEON(0): [pci] vertex/indirect buffers handle = 0xdc960000
> (II) RADEON(0): [pci] Vertex/indirect buffers mapped at 0x38c00000
> (II) RADEON(0): [pci] Vertex/indirect buffers contents 0x79940699
> (II) RADEON(0): [pci] GART texture map handle = 0xdcb60000
> (II) RADEON(0): [pci] GART Texture map mapped at 0x38f60000
Ok, I think this is where the problem is... All of the "contents"
registers should be 0 at start up. I've seen this before, but never
been able to reproduce it locally. Could you try the attached patch and
see if it makes a difference?
robert.
--
Robert Noland <rnoland@FreeBSD.org>
FreeBSD
[-- Attachment #2 --]
diff --git a/sys/dev/drm/drmP.h b/sys/dev/drm/drmP.h
index 04b77f7..fac2bff 100644
--- a/sys/dev/drm/drmP.h
+++ b/sys/dev/drm/drmP.h
@@ -757,7 +757,7 @@ d_ioctl_t drm_ioctl;
d_open_t drm_open;
d_read_t drm_read;
d_poll_t drm_poll;
-d_mmap_t drm_mmap;
+d_mmap2_t drm_mmap;
extern drm_local_map_t *drm_getsarea(struct drm_device *dev);
/* File operations helpers (drm_fops.c) */
diff --git a/sys/dev/drm/drm_drv.c b/sys/dev/drm/drm_drv.c
index c690c34..c6602c3 100644
--- a/sys/dev/drm/drm_drv.c
+++ b/sys/dev/drm/drm_drv.c
@@ -126,9 +126,9 @@ static struct cdevsw drm_cdevsw = {
.d_read = drm_read,
.d_ioctl = drm_ioctl,
.d_poll = drm_poll,
- .d_mmap = drm_mmap,
+ .d_mmap2 = drm_mmap,
.d_name = "drm",
- .d_flags = D_TRACKCLOSE
+ .d_flags = D_TRACKCLOSE | D_MMAP2
};
static int drm_msi = 1; /* Enable by default. */
diff --git a/sys/dev/drm/drm_vm.c b/sys/dev/drm/drm_vm.c
index 7d5cd8d..55ad51e 100644
--- a/sys/dev/drm/drm_vm.c
+++ b/sys/dev/drm/drm_vm.c
@@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$");
#include "dev/drm/drm.h"
int drm_mmap(struct cdev *kdev, vm_offset_t offset, vm_paddr_t *paddr,
- int prot)
+ int prot, vm_memattr_t *memattr)
{
struct drm_device *dev = drm_get_device_from_kdev(kdev);
struct drm_file *file_priv = NULL;
@@ -114,6 +114,10 @@ int drm_mmap(struct cdev *kdev, vm_offset_t offset, vm_paddr_t *paddr,
phys = vtophys((char *)map->handle + (offset - map->offset));
break;
case _DRM_SCATTER_GATHER:
+#ifdef VM_MEMATTR_UNCACHEABLE
+ *memattr = VM_MEMATTR_UNCACHEABLE;
+#endif
+ /* FALLTHROUGH */
case _DRM_SHM:
phys = vtophys(offset);
break;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1253812603.2031.1528.camel>
