diff options
author | Keith Packard <keithp@keithp.com> | 2008-05-08 10:44:02 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2008-05-08 10:44:02 -0700 |
commit | 9af4c497433398fa4576a7c1c31036448cf4f24c (patch) | |
tree | 796775f0bebcdedc7b28dbc2511bfc00797786fc /shared-core | |
parent | effc6d998f080ba6f9c81d1b4b0e75a42be0238e (diff) |
[intel-gem] Move domains to relocation records. add set_domain ioctl.
Domain information is about buffer relationships, not buffer contents. That
means a relocation contains the domain information as it knows how the
source buffer references the target buffer.
This also adds the set_domain ioctl so that user space can move buffers to
the cpu domain.
Diffstat (limited to 'shared-core')
-rw-r--r-- | shared-core/i915_drm.h | 28 | ||||
-rw-r--r-- | shared-core/i915_drv.h | 3 |
2 files changed, 18 insertions, 13 deletions
diff --git a/shared-core/i915_drm.h b/shared-core/i915_drm.h index 8c3cd646..d71447e6 100644 --- a/shared-core/i915_drm.h +++ b/shared-core/i915_drm.h @@ -443,6 +443,20 @@ struct drm_i915_gem_relocation_entry { * the execbuffer ioctl when the relocation is written. */ uint64_t presumed_offset; + + /** + * Target memory domains read by this operation. + */ + uint32_t read_domains; + + /** + * Target memory domains written by this operation. + * + * Note that only one domain may be written by the whole + * execbuffer operation, so that where there are conflicts, + * the application will get -EINVAL back. + */ + uint32_t write_domain; }; /** @@ -451,13 +465,6 @@ struct drm_i915_gem_relocation_entry { * Most of these just align with the various caches in * the system and are used to flush and invalidate as * objects end up cached in different domains. - * - * STOLEN is a domain for the stolen memory portion of the - * address space; those pages are accessible only through the - * GTT and, hence, look a lot like VRAM on a discrete card. - * We'll allow programs to move objects into stolen memory - * mostly as a way to demonstrate the VRAM capabilities of this - * API */ /* 0x00000001 is DRM_GEM_DOMAIN_CPU */ @@ -465,8 +472,7 @@ struct drm_i915_gem_relocation_entry { #define DRM_GEM_DOMAIN_I915_SAMPLER 0x00000004 /* Sampler cache, used by texture engine */ #define DRM_GEM_DOMAIN_I915_COMMAND 0x00000008 /* Command queue, used to load batch buffers */ #define DRM_GEM_DOMAIN_I915_INSTRUCTION 0x00000010 /* Instruction cache, used by shader programs */ -#define DRM_GEM_DOMAIN_I915_STOLEN 0x00000020 /* Stolen memory, needed by some objects */ -#define DRM_GEM_DOMAIN_I915_VERTEX 0x00000040 /* Vertex address cache */ +#define DRM_GEM_DOMAIN_I915_VERTEX 0x00000020 /* Vertex address cache */ struct drm_i915_gem_validate_entry { /** @@ -482,10 +488,6 @@ struct drm_i915_gem_validate_entry { /** Required alignment in graphics aperture */ uint64_t alignment; - /** Memory domains used in this execbuffer run */ - uint32_t read_domains; - uint32_t write_domain; - /** * Returned value of the updated offset of the buffer, for future * presumed_offset writes. diff --git a/shared-core/i915_drv.h b/shared-core/i915_drv.h index daa77f72..96257ab6 100644 --- a/shared-core/i915_drv.h +++ b/shared-core/i915_drv.h @@ -383,6 +383,9 @@ int i915_gem_unpin_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); int i915_gem_init_object(struct drm_gem_object *obj); void i915_gem_free_object(struct drm_gem_object *obj); +int i915_gem_set_domain_ioctl (struct drm_gem_object *obj, + uint32_t read_domains, + uint32_t write_domain); #endif |