On Sun, 19 Sep 2004 17:27:02 -0400
Jon Smirl <[EMAIL PROTECTED]> wrote:

> That should be >= in the patch not <=.  The requested size needs to be
> smaller than the permanent map size.

That's not enough. You also need to change DRM(mmap), otherwise DRI
clients will fail to mmap the frame buffer. The attached patch does
both. This way I got permanent maps working in the Savage driver (not
committed yet) without probing the video ram in preinit.

Regards,
  Felix

| Felix Kühling <[EMAIL PROTECTED]>                     http://fxk.de.vu |
| PGP Fingerprint: 6A3C 9566 5B30 DDED 73C3  B152 151C 5CC1 D888 E595 |
Index: drm_bufs.h
===================================================================
RCS file: /cvs/dri/drm/linux/drm_bufs.h,v
retrieving revision 1.41
diff -u -r1.41 drm_bufs.h
--- drm_bufs.h  8 Sep 2004 20:57:39 -0000       1.41
+++ drm_bufs.h  20 Sep 2004 00:02:33 -0000
@@ -186,7 +186,7 @@
                                drm_map_list_t *_entry = list_entry( _list, 
drm_map_list_t, head );
                                if ( _entry->map && _entry->map->type == map->type &&
                                                _entry->map->offset == map->offset &&
-                                               _entry->map->size == map->size ) {
+                                               _entry->map->size >= map->size ) {
                                        DRM(free)( map, sizeof(*map), DRM_MEM_MAPS );
                                        map = _entry->map;
                                        DRM_DEBUG( "Found existing: offset = 0x%08lx, 
size = 0x%08lx, type = %d\n",
Index: drm_vm.h
===================================================================
RCS file: /cvs/dri/drm/linux/drm_vm.h,v
retrieving revision 1.38
diff -u -r1.38 drm_vm.h
--- drm_vm.h    5 Sep 2004 10:54:58 -0000       1.38
+++ drm_vm.h    20 Sep 2004 00:02:34 -0000
@@ -569,7 +569,7 @@
                return -EPERM;
 
                                /* Check for valid size. */
-       if (map->size != vma->vm_end - vma->vm_start) return -EINVAL;
+       if (map->size < vma->vm_end - vma->vm_start) return -EINVAL;
 
        if (!capable(CAP_SYS_ADMIN) && (map->flags & _DRM_READ_ONLY)) {
                vma->vm_flags &= ~(VM_WRITE | VM_MAYWRITE);

Reply via email to