]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge remote branch 'nouveau/for-airlied' of ../drm-nouveau-next into drm-core-next
authorDave Airlie <airlied@redhat.com>
Wed, 6 Oct 2010 02:38:04 +0000 (12:38 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 6 Oct 2010 02:57:11 +0000 (12:57 +1000)
[airlied - add fix for vmwgfx build]

* 'nouveau/for-airlied' of ../drm-nouveau-next: (93 commits)
  drm/ttm: restructure to allow driver to plug in alternate memory manager
  drm/ttm: introduce utility function to free an allocated memory node
  drm/nouveau: fix thinkos in mem timing table recordlen check
  drm/nouveau: parse voltage from perf 0x40 entires
  drm/nouveau: don't use the default pll limits in table v2.1 on nv50+ cards
  drm/nv50: Fix large 3D performance regression caused by the interchannel sync patches.
  drm/nouveau: Synchronize buffer object moves in hardware.
  drm/nouveau: Use semaphores to handle inter-channel sync in hardware.
  drm/nouveau: Provide a means to have arbitrary work run on fence completion.
  drm/nouveau: Minor refactoring/cleanup of the fence code.
  drm/nouveau: Add a module option to force card POST.
  drm/nv50: prevent (IB_PUT == IB_GET) for occurring unless idle
  drm/nv0x-nv4x: Leave the 0x40 bit untouched when changing CRE_LCD.
  drm/nv30-nv40: Fix postdivider mask when writing engine/memory PLLs.
  drm/nouveau: Fix perf table parsing on BMP v5.25.
  drm/nouveau: fix required mode bandwidth calculation for DP
  drm/nouveau: fix typo in c2aa91afea5f7e7ae4530fabd37414a79c03328c
  drm/nva3: split pm backend out from nv50
  drm/nouveau: run perflvl and M table scripts on mem clock change
  drm/nouveau: pass perflvl struct to clock_pre()
  ...

1  2 
drivers/gpu/drm/nouveau/nouveau_gem.c
drivers/gpu/drm/nouveau/nouveau_notifier.c
drivers/gpu/drm/ttm/ttm_bo_util.c
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c

index 19620a6709f55c00e97efd5d2f816705788420f8,1e630987543e93709f827eb181c3373366044483..5c4c929d7f744d6911c1a16b67924ab770b6de5c
@@@ -167,9 -167,11 +167,9 @@@ nouveau_gem_ioctl_new(struct drm_devic
                goto out;
  
        ret = drm_gem_handle_create(file_priv, nvbo->gem, &req->info.handle);
 +      /* drop reference from allocate - handle holds it now */
 +      drm_gem_object_unreference_unlocked(nvbo->gem);
  out:
 -      drm_gem_object_handle_unreference_unlocked(nvbo->gem);
 -
 -      if (ret)
 -              drm_gem_object_unreference_unlocked(nvbo->gem);
        return ret;
  }
  
@@@ -362,7 -364,7 +362,7 @@@ validate_list(struct nouveau_channel *c
        list_for_each_entry(nvbo, list, entry) {
                struct drm_nouveau_gem_pushbuf_bo *b = &pbbo[nvbo->pbbo_index];
  
-               ret = nouveau_bo_sync_gpu(nvbo, chan);
+               ret = nouveau_fence_sync(nvbo->bo.sync_obj, chan);
                if (unlikely(ret)) {
                        NV_ERROR(dev, "fail pre-validate sync\n");
                        return ret;
                        return ret;
                }
  
-               ret = nouveau_bo_sync_gpu(nvbo, chan);
+               ret = nouveau_fence_sync(nvbo->bo.sync_obj, chan);
                if (unlikely(ret)) {
                        NV_ERROR(dev, "fail post-validate sync\n");
                        return ret;
index 3c9964a8fbad00eb4a8371f94900432521f1367f,2cc59f8c658bd63b840fbf35c7871d090a587d95..d670839cb34dffafa7d3275b31a08dc743bb716c
@@@ -28,6 -28,7 +28,7 @@@
  #include "drmP.h"
  #include "drm.h"
  #include "nouveau_drv.h"
+ #include "nouveau_ramht.h"
  
  int
  nouveau_notifier_init_channel(struct nouveau_channel *chan)
@@@ -79,7 -80,6 +80,7 @@@ nouveau_notifier_takedown_channel(struc
        mutex_lock(&dev->struct_mutex);
        nouveau_bo_unpin(chan->notifier_bo);
        mutex_unlock(&dev->struct_mutex);
 +      drm_gem_object_handle_unreference_unlocked(chan->notifier_bo->gem);
        drm_gem_object_unreference_unlocked(chan->notifier_bo->gem);
        drm_mm_takedown(&chan->notifier_heap);
  }
@@@ -113,7 -113,7 +114,7 @@@ nouveau_notifier_alloc(struct nouveau_c
                return -ENOMEM;
        }
  
-       offset = chan->notifier_bo->bo.mem.mm_node->start << PAGE_SHIFT;
+       offset = chan->notifier_bo->bo.mem.start << PAGE_SHIFT;
        if (chan->notifier_bo->bo.mem.mem_type == TTM_PL_VRAM) {
                target = NV_DMA_TARGET_VIDMEM;
        } else
        nobj->dtor = nouveau_notifier_gpuobj_dtor;
        nobj->priv = mem;
  
-       ret = nouveau_gpuobj_ref_add(dev, chan, handle, nobj, NULL);
+       ret = nouveau_ramht_insert(chan, handle, nobj);
+       nouveau_gpuobj_ref(NULL, &nobj);
        if (ret) {
-               nouveau_gpuobj_del(dev, &nobj);
                drm_mm_put_block(mem);
-               NV_ERROR(dev, "Error referencing notifier ctxdma: %d\n", ret);
+               NV_ERROR(dev, "Error adding notifier to ramht: %d\n", ret);
                return ret;
        }
  
index 3451a82adba76c31672ee96f086146f5da1ab12b,c9d2d4d8d066bc54606f85d10b208ac1333519dd..ff358ad45aa3e8a022739bbbcaa96d3b8ea1ccfa
  
  void ttm_bo_free_old_node(struct ttm_buffer_object *bo)
  {
-       struct ttm_mem_reg *old_mem = &bo->mem;
-       if (old_mem->mm_node) {
-               spin_lock(&bo->glob->lru_lock);
-               drm_mm_put_block(old_mem->mm_node);
-               spin_unlock(&bo->glob->lru_lock);
-       }
-       old_mem->mm_node = NULL;
+       ttm_bo_mem_put(bo, &bo->mem);
  }
  
  int ttm_bo_move_ttm(struct ttm_buffer_object *bo,
@@@ -263,8 -256,7 +256,7 @@@ int ttm_bo_move_memcpy(struct ttm_buffe
        dir = 1;
  
        if ((old_mem->mem_type == new_mem->mem_type) &&
-           (new_mem->mm_node->start <
-            old_mem->mm_node->start + old_mem->mm_node->size)) {
+           (new_mem->start < old_mem->start + old_mem->size)) {
                dir = -1;
                add = new_mem->num_pages - 1;
        }
@@@ -351,7 -343,6 +343,7 @@@ static int ttm_buffer_object_transfer(s
        INIT_LIST_HEAD(&fbo->lru);
        INIT_LIST_HEAD(&fbo->swap);
        fbo->vm_node = NULL;
 +      atomic_set(&fbo->cpu_writers, 0);
  
        fbo->sync_obj = driver->sync_obj_ref(bo->sync_obj);
        kref_init(&fbo->list_kref);
index b27a9f2887d21f51480b7a3b8530e3436f78deb5,870967a97c15d52eb3f380323e6038d32ed6e76f..e7304188a784da8d8b1e850c1e4b3a06978c0995
@@@ -144,13 -144,6 +144,13 @@@ static int vmw_fb_check_var(struct fb_v
                return -EINVAL;
        }
  
 +      if (!vmw_kms_validate_mode_vram(vmw_priv,
 +                                      info->fix.line_length,
 +                                      var->yoffset + var->yres)) {
 +              DRM_ERROR("Requested geom can not fit in framebuffer\n");
 +              return -EINVAL;
 +      }
 +
        return 0;
  }
  
@@@ -212,9 -205,6 +212,9 @@@ static void vmw_fb_dirty_flush(struct v
                SVGAFifoCmdUpdate body;
        } *cmd;
  
 +      if (vmw_priv->suspended)
 +              return;
 +
        spin_lock_irqsave(&par->dirty.lock, flags);
        if (!par->dirty.active) {
                spin_unlock_irqrestore(&par->dirty.lock, flags);
@@@ -612,6 -602,6 +612,7 @@@ int vmw_dmabuf_to_start_of_vram(struct 
  {
        struct ttm_buffer_object *bo = &vmw_bo->base;
        struct ttm_placement ne_placement = vmw_vram_ne_placement;
++      struct drm_mm_node *mm_node;
        int ret = 0;
  
        ne_placement.lpfn = bo->num_pages;
        if (unlikely(ret != 0))
                goto err_unlock;
  
-           bo->mem.mm_node->start < bo->num_pages)
++      mm_node = bo->mem.mm_node;
 +      if (bo->mem.mem_type == TTM_PL_VRAM &&
++          mm_node->start < bo->num_pages)
 +              (void) ttm_bo_validate(bo, &vmw_sys_placement, false,
 +                                     false, false);
 +
        ret = ttm_bo_validate(bo, &ne_placement, false, false, false);
  
        /* Could probably bug on */