On Wed, 2005-09-07 at 18:12 +0200, Daniel Estévez wrote:
> I have a new ibook with an ATI Mobility Radeon 9550 card and  
> want to help the r300 project testing the driver. I have compiled  
> the patched x server and the mesa drivers from cvs. I also have  
> compiled radeon.ko from the drm cvs of the dri project.
> 
> With the help of Vladimir Dergachev (aka volodya), the r300 driver, I made 
> the 
> radeon.ko driver see mi card by adding my it to drm_pciids.txt. I attach the 
> patch.
> 
> It seems that there is a problem with agp when x starts. Vladimir thinks that 
> it is related to powerpc and told me to post here. This are the 
> important parts of the logs:

You should use David Airlie kernel DRM (which is in current Linus "git"
top of tree) along with the following patch in case it didn't make it
yet:

Index: linux-work/drivers/char/drm/drm_bufs.c
===================================================================
--- linux-work.orig/drivers/char/drm/drm_bufs.c 2005-08-31 13:26:55.000000000 
+1000
+++ linux-work/drivers/char/drm/drm_bufs.c      2005-09-05 11:55:31.000000000 
+1000
@@ -48,8 +48,8 @@
 }
 EXPORT_SYMBOL(drm_get_resource_len);
 
-static drm_local_map_t *drm_find_matching_map(drm_device_t *dev,
-                                             drm_local_map_t *map)
+static drm_map_list_t *drm_find_matching_map(drm_device_t *dev,
+                                            drm_local_map_t *map)
 {
        struct list_head *list;
 
@@ -57,7 +57,7 @@
                drm_map_list_t *entry = list_entry(list, drm_map_list_t, head);
                if (entry->map && map->type == entry->map->type &&
                    entry->map->offset == map->offset) {
-                       return entry->map;
+                       return entry;
                }
        }
 
@@ -114,14 +114,13 @@
  * type.  Adds the map to the map list drm_device::maplist. Adds MTRR's where
  * applicable and if supported by the kernel.
  */
-int drm_addmap(drm_device_t * dev, unsigned int offset,
-              unsigned int size, drm_map_type_t type,
-              drm_map_flags_t flags, drm_local_map_t ** map_ptr)
+static int drm_addmap_core(drm_device_t * dev, unsigned int offset,
+                          unsigned int size, drm_map_type_t type,
+                          drm_map_flags_t flags, drm_map_list_t ** maplist)
 {
        drm_map_t *map;
        drm_map_list_t *list;
        drm_dma_handle_t *dmah;
-       drm_local_map_t *found_map;
 
        map = drm_alloc( sizeof(*map), DRM_MEM_MAPS );
        if ( !map )
@@ -166,17 +165,17 @@
                 * needing to be aware of it.  Therefore, we just return success
                 * when the server tries to create a duplicate map.
                 */
-               found_map = drm_find_matching_map(dev, map);
-               if (found_map != NULL) {
-                       if (found_map->size != map->size) {
+               list = drm_find_matching_map(dev, map);
+               if (list != NULL) {
+                       if (list->map->size != map->size) {
                                DRM_DEBUG("Matching maps of type %d with "
                                   "mismatched sizes, (%ld vs %ld)\n",
-                                   map->type, map->size, found_map->size);
-                               found_map->size = map->size;
+                                   map->type, map->size, list->map->size);
+                               list->map->size = map->size;
                        }
 
                        drm_free(map, sizeof(*map), DRM_MEM_MAPS);
-                       *map_ptr = found_map;
+                       *maplist = list;
                        return 0;
                }
 
@@ -264,9 +263,23 @@
                                    : map->offset, dev);
        up(&dev->struct_sem);
 
-       *map_ptr = map;
+       *maplist = list;
        return 0;
 }
+
+int drm_addmap(drm_device_t * dev, unsigned int offset,
+              unsigned int size, drm_map_type_t type,
+              drm_map_flags_t flags, drm_local_map_t ** map_ptr)
+{
+       drm_map_list_t *list;
+       int rc;
+
+       rc = drm_addmap_core(dev, offset, size, type, flags, &list);
+       if (!rc)
+               *map_ptr = list->map;
+       return rc;
+}
+
 EXPORT_SYMBOL(drm_addmap);
 
 int drm_addmap_ioctl(struct inode *inode, struct file *filp,
@@ -275,10 +288,9 @@
        drm_file_t *priv = filp->private_data;
        drm_device_t *dev = priv->head->dev;
        drm_map_t map;
-       drm_map_t *map_ptr;
+       drm_map_list_t *maplist;
        drm_map_t __user *argp = (void __user *)arg;
        int err;
-       unsigned long handle = 0;
 
        if (!(filp->f_mode & 3))
                return -EACCES; /* Require read/write */
@@ -286,27 +298,14 @@
        if (copy_from_user(& map, argp, sizeof(map))) {
                return -EFAULT;
        }
-
-       err = drm_addmap(dev, map.offset, map.size, map.type, map.flags,
-                        &map_ptr);
-
-       if (err) {
+ 
+       err = drm_addmap_core(dev, map.offset, map.size, map.type, map.flags,
+                             &maplist);        
+       if (err)
                return err;
-       }
-
-       {
-               drm_map_list_t *_entry;
-               list_for_each_entry(_entry, &dev->maplist->head, head) {
-                       if (_entry->map == map_ptr)
-                               handle = _entry->user_token;
-               }
-               if (!handle)
-                       return -EFAULT;
-       }
-
-       if (copy_to_user(argp, map_ptr, sizeof(*map_ptr)))
+       if (copy_to_user(argp, maplist->map, sizeof(drm_map_t)))
                return -EFAULT;
-       if (put_user(handle, &argp->handle))
+       if (put_user(maplist->user_token, &argp->handle))
                return -EFAULT;
        return 0;
 }




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to