diff options
author | Keith Packard <keithp@keithp.com> | 2008-06-13 19:47:23 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2008-06-13 19:47:23 -0700 |
commit | 19c3418848ccdbb163cd16b354b14b0559813d6c (patch) | |
tree | f61e5539cf938f01fed63b5f55444d15718cc7da | |
parent | 93c2871eccc1abde0d88ea439cf963c4895a26fc (diff) |
[intel-gem] inactive list may contain objects in CPU write domain
Pin/unpin need to know whether to remove/add objects from the inactive list,
inactive objects cannot be in any GPU write domain as those would be on the
flushing list instead. However, inactive objects may be in the CPU write
domain.
-rw-r--r-- | linux-core/i915_gem.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/linux-core/i915_gem.c b/linux-core/i915_gem.c index a15d7f23..5e5c0ea1 100644 --- a/linux-core/i915_gem.c +++ b/linux-core/i915_gem.c @@ -1837,7 +1837,8 @@ i915_gem_object_pin(struct drm_gem_object *obj, uint32_t alignment) if (obj_priv->pin_count == 1) { atomic_inc(&dev->pin_count); atomic_add(obj->size, &dev->pin_memory); - if (!obj_priv->active && obj->write_domain == 0) + if (!obj_priv->active && (obj->write_domain & ~I915_GEM_DOMAIN_CPU) == 0 && + !list_empty(&obj_priv->list)) list_del_init(&obj_priv->list); } i915_verify_inactive(dev, __FILE__, __LINE__); @@ -1862,8 +1863,9 @@ i915_gem_object_unpin(struct drm_gem_object *obj) * the inactive list */ if (obj_priv->pin_count == 0) { - if (!obj_priv->active && obj->write_domain == 0) - list_move_tail(&obj_priv->list, &dev_priv->mm.inactive_list); + if (!obj_priv->active && (obj->write_domain & ~I915_GEM_DOMAIN_CPU) == 0) + list_move_tail(&obj_priv->list, + &dev_priv->mm.inactive_list); atomic_dec(&dev->pin_count); atomic_sub(obj->size, &dev->pin_memory); } |