diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_ramht.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_ramht.c b/drivers/gpu/drm/nouveau/nouveau_ramht.c index f240ba241943..7f16697cc96c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ramht.c +++ b/drivers/gpu/drm/nouveau/nouveau_ramht.c | |||
@@ -63,6 +63,23 @@ nouveau_ramht_entry_valid(struct drm_device *dev, struct nouveau_gpuobj *ramht, | |||
63 | return (ctx != 0); | 63 | return (ctx != 0); |
64 | } | 64 | } |
65 | 65 | ||
66 | static int | ||
67 | nouveau_ramht_entry_same_channel(struct nouveau_channel *chan, | ||
68 | struct nouveau_gpuobj *ramht, u32 offset) | ||
69 | { | ||
70 | struct drm_nouveau_private *dev_priv = chan->dev->dev_private; | ||
71 | u32 ctx = nv_ro32(ramht, offset + 4); | ||
72 | |||
73 | if (dev_priv->card_type >= NV_50) | ||
74 | return true; | ||
75 | else if (dev_priv->card_type >= NV_40) | ||
76 | return chan->id == | ||
77 | ((ctx >> NV40_RAMHT_CONTEXT_CHANNEL_SHIFT) & 0x1f); | ||
78 | else | ||
79 | return chan->id == | ||
80 | ((ctx >> NV_RAMHT_CONTEXT_CHANNEL_SHIFT) & 0x1f); | ||
81 | } | ||
82 | |||
66 | int | 83 | int |
67 | nouveau_ramht_insert(struct nouveau_channel *chan, u32 handle, | 84 | nouveau_ramht_insert(struct nouveau_channel *chan, u32 handle, |
68 | struct nouveau_gpuobj *gpuobj) | 85 | struct nouveau_gpuobj *gpuobj) |
@@ -159,6 +176,7 @@ nouveau_ramht_remove_locked(struct nouveau_channel *chan, u32 handle) | |||
159 | co = ho = nouveau_ramht_hash_handle(chan, handle); | 176 | co = ho = nouveau_ramht_hash_handle(chan, handle); |
160 | do { | 177 | do { |
161 | if (nouveau_ramht_entry_valid(dev, ramht, co) && | 178 | if (nouveau_ramht_entry_valid(dev, ramht, co) && |
179 | nouveau_ramht_entry_same_channel(chan, ramht, co) && | ||
162 | (handle == nv_ro32(ramht, co))) { | 180 | (handle == nv_ro32(ramht, co))) { |
163 | NV_DEBUG(dev, | 181 | NV_DEBUG(dev, |
164 | "remove ch%d 0x%08x: h=0x%08x, c=0x%08x\n", | 182 | "remove ch%d 0x%08x: h=0x%08x, c=0x%08x\n", |