diff options
author | Francisco Jerez <currojerez@riseup.net> | 2010-09-05 00:03:07 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-09-24 02:25:03 -0400 |
commit | 3bc14b4dca2f8bc088162476279480e78491fd83 (patch) | |
tree | 86a79a9d4e15457dcdbbd72a958ea86a49ed54a0 /drivers/gpu/drm/nouveau | |
parent | f243423759271026ddc3f8ab12a16cc7abfabc49 (diff) |
drm/nouveau: Don't remove ramht entries from the neighboring channels.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-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", |