]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
Merge remote branch 'nouveau/for-airlied' of /ssd/git/drm-nouveau-next into drm-fixes
authorDave Airlie <airlied@redhat.com>
Thu, 26 Aug 2010 23:09:46 +0000 (09:09 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 26 Aug 2010 23:09:46 +0000 (09:09 +1000)
* 'nouveau/for-airlied' of /ssd/git/drm-nouveau-next:
  drm/nouveau: drop drm_global_mutex before sleeping in submission path
  drm: export drm_global_mutex for drivers to use
  drm/nv20: Don't use pushbuf calls on the original nv20.
  drm/nouveau: Fix TMDS on some DCB1.5 boards.
  drm/nouveau: Fix backlight control on PPC machines with an internal TMDS panel.
  drm/nv30: Apply modesetting to the correct slave encoder
  drm/nouveau: Use a helper function to match PCI device/subsystem IDs.
  drm/nv50: add dcb type 14 to enum to prevent compiler complaint

1  2 
drivers/gpu/drm/drm_fops.c
drivers/gpu/drm/nouveau/nouveau_gem.c

index 3a652a65546f16781542b7613865a8c1e692b60c,41dfaae411590567e84970e165946067f498fcb0..b744dad5c237f5371d571d13dc35d46a2fc95e2c
@@@ -41,6 -41,7 +41,7 @@@
  
  /* from BKL pushdown: note that nothing else serializes idr_find() */
  DEFINE_MUTEX(drm_global_mutex);
+ EXPORT_SYMBOL(drm_global_mutex);
  
  static int drm_open_helper(struct inode *inode, struct file *filp,
                           struct drm_device * dev);
@@@ -135,9 -136,15 +136,9 @@@ int drm_open(struct inode *inode, struc
        retcode = drm_open_helper(inode, filp, dev);
        if (!retcode) {
                atomic_inc(&dev->counts[_DRM_STAT_OPENS]);
 -              spin_lock(&dev->count_lock);
 -              if (!dev->open_count++) {
 -                      spin_unlock(&dev->count_lock);
 +              if (!dev->open_count++)
                        retcode = drm_setup(dev);
 -                      goto out;
 -              }
 -              spin_unlock(&dev->count_lock);
        }
 -out:
        if (!retcode) {
                mutex_lock(&dev->struct_mutex);
                if (minor->type == DRM_MINOR_LEGACY) {
@@@ -564,14 -571,18 +565,14 @@@ int drm_release(struct inode *inode, st
         */
  
        atomic_inc(&dev->counts[_DRM_STAT_CLOSES]);
 -      spin_lock(&dev->count_lock);
        if (!--dev->open_count) {
                if (atomic_read(&dev->ioctl_count)) {
                        DRM_ERROR("Device busy: %d\n",
                                  atomic_read(&dev->ioctl_count));
                        retcode = -EBUSY;
 -                      goto out;
 -              }
 -              retcode = drm_lastclose(dev);
 +              } else
 +                      retcode = drm_lastclose(dev);
        }
 -out:
 -      spin_unlock(&dev->count_lock);
        mutex_unlock(&drm_global_mutex);
  
        return retcode;
index 79fc5ffff226bee50423830bccd1fc37243fe75a,93711dfcafc1eec2d488ca97f6e20a1594b9e952..581c67cd7b24c24446097797f54ffc5d689f92b0
@@@ -284,7 -284,7 +284,7 @@@ retry
                if (!gem) {
                        NV_ERROR(dev, "Unknown handle 0x%08x\n", b->handle);
                        validate_fini(op, NULL);
 -                      return -EINVAL;
 +                      return -ENOENT;
                }
                nvbo = gem->driver_private;
  
                                return -EINVAL;
                        }
  
+                       mutex_unlock(&drm_global_mutex);
                        ret = ttm_bo_wait_cpu(&nvbo->bo, false);
+                       mutex_lock(&drm_global_mutex);
                        if (ret) {
                                NV_ERROR(dev, "fail wait_cpu\n");
                                return ret;
@@@ -663,7 -665,7 +665,7 @@@ nouveau_gem_ioctl_pushbuf(struct drm_de
                                      push[i].length);
                }
        } else
-       if (dev_priv->card_type >= NV_20) {
+       if (dev_priv->chipset >= 0x25) {
                ret = RING_SPACE(chan, req->nr_push * 2);
                if (ret) {
                        NV_ERROR(dev, "cal_space: %d\n", ret);
@@@ -738,7 -740,7 +740,7 @@@ out_next
                req->suffix0 = 0x00000000;
                req->suffix1 = 0x00000000;
        } else
-       if (dev_priv->card_type >= NV_20) {
+       if (dev_priv->chipset >= 0x25) {
                req->suffix0 = 0x00020000;
                req->suffix1 = 0x00000000;
        } else {
@@@ -775,7 -777,7 +777,7 @@@ nouveau_gem_ioctl_cpu_prep(struct drm_d
  
        gem = drm_gem_object_lookup(dev, file_priv, req->handle);
        if (!gem)
 -              return ret;
 +              return -ENOENT;
        nvbo = nouveau_gem_object(gem);
  
        if (nvbo->cpu_filp) {
@@@ -813,7 -815,7 +815,7 @@@ nouveau_gem_ioctl_cpu_fini(struct drm_d
  
        gem = drm_gem_object_lookup(dev, file_priv, req->handle);
        if (!gem)
 -              return ret;
 +              return -ENOENT;
        nvbo = nouveau_gem_object(gem);
  
        if (nvbo->cpu_filp != file_priv)
@@@ -838,7 -840,7 +840,7 @@@ nouveau_gem_ioctl_info(struct drm_devic
  
        gem = drm_gem_object_lookup(dev, file_priv, req->handle);
        if (!gem)
 -              return -EINVAL;
 +              return -ENOENT;
  
        ret = nouveau_gem_info(gem, req);
        drm_gem_object_unreference_unlocked(gem);