diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_ramht.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_ramht.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_ramht.c b/drivers/gpu/drm/nouveau/nouveau_ramht.c index 2d8580927ca4..bef3e6910418 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ramht.c +++ b/drivers/gpu/drm/nouveau/nouveau_ramht.c | |||
@@ -104,17 +104,17 @@ nouveau_ramht_insert(struct nouveau_channel *chan, u32 handle, | |||
104 | nouveau_gpuobj_ref(gpuobj, &entry->gpuobj); | 104 | nouveau_gpuobj_ref(gpuobj, &entry->gpuobj); |
105 | 105 | ||
106 | if (dev_priv->card_type < NV_40) { | 106 | if (dev_priv->card_type < NV_40) { |
107 | ctx = NV_RAMHT_CONTEXT_VALID | (gpuobj->cinst >> 4) | | 107 | ctx = NV_RAMHT_CONTEXT_VALID | (gpuobj->pinst >> 4) | |
108 | (chan->id << NV_RAMHT_CONTEXT_CHANNEL_SHIFT) | | 108 | (chan->id << NV_RAMHT_CONTEXT_CHANNEL_SHIFT) | |
109 | (gpuobj->engine << NV_RAMHT_CONTEXT_ENGINE_SHIFT); | 109 | (gpuobj->engine << NV_RAMHT_CONTEXT_ENGINE_SHIFT); |
110 | } else | 110 | } else |
111 | if (dev_priv->card_type < NV_50) { | 111 | if (dev_priv->card_type < NV_50) { |
112 | ctx = (gpuobj->cinst >> 4) | | 112 | ctx = (gpuobj->pinst >> 4) | |
113 | (chan->id << NV40_RAMHT_CONTEXT_CHANNEL_SHIFT) | | 113 | (chan->id << NV40_RAMHT_CONTEXT_CHANNEL_SHIFT) | |
114 | (gpuobj->engine << NV40_RAMHT_CONTEXT_ENGINE_SHIFT); | 114 | (gpuobj->engine << NV40_RAMHT_CONTEXT_ENGINE_SHIFT); |
115 | } else { | 115 | } else { |
116 | if (gpuobj->engine == NVOBJ_ENGINE_DISPLAY) { | 116 | if (gpuobj->engine == NVOBJ_ENGINE_DISPLAY) { |
117 | ctx = (gpuobj->cinst << 10) | 2; | 117 | ctx = (gpuobj->cinst << 10) | chan->id; |
118 | } else { | 118 | } else { |
119 | ctx = (gpuobj->cinst >> 4) | | 119 | ctx = (gpuobj->cinst >> 4) | |
120 | ((gpuobj->engine << | 120 | ((gpuobj->engine << |
@@ -214,18 +214,19 @@ out: | |||
214 | spin_unlock_irqrestore(&chan->ramht->lock, flags); | 214 | spin_unlock_irqrestore(&chan->ramht->lock, flags); |
215 | } | 215 | } |
216 | 216 | ||
217 | void | 217 | int |
218 | nouveau_ramht_remove(struct nouveau_channel *chan, u32 handle) | 218 | nouveau_ramht_remove(struct nouveau_channel *chan, u32 handle) |
219 | { | 219 | { |
220 | struct nouveau_ramht_entry *entry; | 220 | struct nouveau_ramht_entry *entry; |
221 | 221 | ||
222 | entry = nouveau_ramht_remove_entry(chan, handle); | 222 | entry = nouveau_ramht_remove_entry(chan, handle); |
223 | if (!entry) | 223 | if (!entry) |
224 | return; | 224 | return -ENOENT; |
225 | 225 | ||
226 | nouveau_ramht_remove_hash(chan, entry->handle); | 226 | nouveau_ramht_remove_hash(chan, entry->handle); |
227 | nouveau_gpuobj_ref(NULL, &entry->gpuobj); | 227 | nouveau_gpuobj_ref(NULL, &entry->gpuobj); |
228 | kfree(entry); | 228 | kfree(entry); |
229 | return 0; | ||
229 | } | 230 | } |
230 | 231 | ||
231 | struct nouveau_gpuobj * | 232 | struct nouveau_gpuobj * |