tech-x11 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: radaeondrmkms on i386 - how to get the console back



matthew green wrote:
>as some of you are aware, radeondrmkms on i386 doesn't work properly.
>i've been tracking down the problems.

[snip]

>but there is a much deeper issue in the drm code itself.  when
>the ati driver is trying to mmap the shader it gets an EINVAL.
>i tracked this down to his code failing:
>
>drm_vm.c:
>     87 static paddr_t
>     88 drm_mmap_paddr_locked(struct drm_device *dev, off_t byte_offset, int prot)
>     89 {
>     90         const off_t page_offset = (byte_offset >> PAGE_SHIFT);
>     91         struct drm_hash_item *hash;
>     92
>     93         KASSERT(mutex_is_locked(&dev->struct_mutex));
>     94         KASSERT(byte_offset == (byte_offset & ~(PAGE_SIZE-1)));
>     95
>     96         if ((dev->dma != NULL) &&
>     97             (0 <= byte_offset) &&
>     98             (page_offset <= dev->dma->page_count))
>     99                 return drm_mmap_dma_paddr(dev, byte_offset, prot);
>    100
>    101         if (drm_ht_find_item(&dev->map_hash, page_offset, &hash))
>    102                 return -1;
>
>at line 101 drm_ht_find_item() fails and we return -1.
>
>no idea what's going on here, yet.

What value do you have in byte_offset ? Is it larger than 32 bits ?

I have been using the patch below for i386 but haven't tried radeon
for a while.

Will rebuild with your latest drm and mesa changes and report back.

Robert Swindells

Index: radeon_ttm.c
===================================================================
RCS file: /cvsroot/src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c,v
retrieving revision 1.5
diff -u -r1.5 radeon_ttm.c
--- radeon_ttm.c        26 Jul 2014 21:19:45 -0000      1.5
+++ radeon_ttm.c        19 Dec 2014 19:33:25 -0000
@@ -50,7 +50,11 @@
 #include <drm/bus_dma_hacks.h>
 #endif
 
+#ifdef _LP64
 #define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT)
+#else
+#define        DRM_FILE_PAGE_OFFSET (0xa0000000 >> PAGE_SHIFT)
+#endif
 
 static int radeon_ttm_debugfs_init(struct radeon_device *rdev);
 static void radeon_ttm_debugfs_fini(struct radeon_device *rdev);


Home | Main Index | Thread Index | Old Index