Commit c0d90829 authored by Keith Packard's avatar Keith Packard Committed by Dave Airlie

drm/i915: Rename object_set_domain to object_set_to_gpu_domain

Now that the CPU and GTT domain operations are isolated to their own
functions, the previously general-purpose set_domain function is now used
only to set GPU domains. It also has no failure cases, which is important as
this eliminates any possible interruption of the computation of new object
domains and subsequent emmission of the flushing instructions into the ring.
Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent e47c68e9
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
#define I915_GEM_GPU_DOMAINS (~(I915_GEM_DOMAIN_CPU | I915_GEM_DOMAIN_GTT)) #define I915_GEM_GPU_DOMAINS (~(I915_GEM_DOMAIN_CPU | I915_GEM_DOMAIN_GTT))
static int static void
i915_gem_object_set_domain(struct drm_gem_object *obj, i915_gem_object_set_to_gpu_domain(struct drm_gem_object *obj,
uint32_t read_domains, uint32_t read_domains,
uint32_t write_domain); uint32_t write_domain);
static void i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj); static void i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj);
...@@ -1477,8 +1477,8 @@ i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj, int write) ...@@ -1477,8 +1477,8 @@ i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj, int write)
* MI_FLUSH * MI_FLUSH
* drm_agp_chipset_flush * drm_agp_chipset_flush
*/ */
static int static void
i915_gem_object_set_domain(struct drm_gem_object *obj, i915_gem_object_set_to_gpu_domain(struct drm_gem_object *obj,
uint32_t read_domains, uint32_t read_domains,
uint32_t write_domain) uint32_t write_domain)
{ {
...@@ -1540,7 +1540,6 @@ i915_gem_object_set_domain(struct drm_gem_object *obj, ...@@ -1540,7 +1540,6 @@ i915_gem_object_set_domain(struct drm_gem_object *obj,
obj->read_domains, obj->write_domain, obj->read_domains, obj->write_domain,
dev->invalidate_domains, dev->flush_domains); dev->invalidate_domains, dev->flush_domains);
#endif #endif
return 0;
} }
/** /**
...@@ -2043,24 +2042,10 @@ i915_gem_execbuffer(struct drm_device *dev, void *data, ...@@ -2043,24 +2042,10 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
for (i = 0; i < args->buffer_count; i++) { for (i = 0; i < args->buffer_count; i++) {
struct drm_gem_object *obj = object_list[i]; struct drm_gem_object *obj = object_list[i];
/* make sure all previous memory operations have passed */ /* Compute new gpu domains and update invalidate/flushing */
ret = i915_gem_object_set_domain(obj, i915_gem_object_set_to_gpu_domain(obj,
obj->pending_read_domains, obj->pending_read_domains,
obj->pending_write_domain); obj->pending_write_domain);
if (ret) {
/* As we've partially updated domains on our buffers,
* we have to emit the flush we've accumulated
* before exiting, or we'll have broken the
* active/flushing/inactive invariants.
*
* We'll potentially have some things marked as
* being in write domains that they actually aren't,
* but that should be merely a minor performance loss.
*/
flush_domains = i915_gem_dev_set_domain(dev);
(void)i915_add_request(dev, flush_domains);
goto err;
}
} }
i915_verify_inactive(dev, __FILE__, __LINE__); i915_verify_inactive(dev, __FILE__, __LINE__);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment