]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/gpu/drm/nouveau/nouveau_ramht.c
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / drivers / gpu / drm / nouveau / nouveau_ramht.c
index 2d8580927ca4579075cd870e5cfdf6459c44d9c6..bef3e691041863a0523f0b7ba7aa2ea1626af760 100644 (file)
@@ -104,17 +104,17 @@ nouveau_ramht_insert(struct nouveau_channel *chan, u32 handle,
        nouveau_gpuobj_ref(gpuobj, &entry->gpuobj);
 
        if (dev_priv->card_type < NV_40) {
-               ctx = NV_RAMHT_CONTEXT_VALID | (gpuobj->cinst >> 4) |
+               ctx = NV_RAMHT_CONTEXT_VALID | (gpuobj->pinst >> 4) |
                      (chan->id << NV_RAMHT_CONTEXT_CHANNEL_SHIFT) |
                      (gpuobj->engine << NV_RAMHT_CONTEXT_ENGINE_SHIFT);
        } else
        if (dev_priv->card_type < NV_50) {
-               ctx = (gpuobj->cinst >> 4) |
+               ctx = (gpuobj->pinst >> 4) |
                      (chan->id << NV40_RAMHT_CONTEXT_CHANNEL_SHIFT) |
                      (gpuobj->engine << NV40_RAMHT_CONTEXT_ENGINE_SHIFT);
        } else {
                if (gpuobj->engine == NVOBJ_ENGINE_DISPLAY) {
-                       ctx = (gpuobj->cinst << 10) | 2;
+                       ctx = (gpuobj->cinst << 10) | chan->id;
                } else {
                        ctx = (gpuobj->cinst >> 4) |
                              ((gpuobj->engine <<
@@ -214,18 +214,19 @@ out:
        spin_unlock_irqrestore(&chan->ramht->lock, flags);
 }
 
-void
+int
 nouveau_ramht_remove(struct nouveau_channel *chan, u32 handle)
 {
        struct nouveau_ramht_entry *entry;
 
        entry = nouveau_ramht_remove_entry(chan, handle);
        if (!entry)
-               return;
+               return -ENOENT;
 
        nouveau_ramht_remove_hash(chan, entry->handle);
        nouveau_gpuobj_ref(NULL, &entry->gpuobj);
        kfree(entry);
+       return 0;
 }
 
 struct nouveau_gpuobj *