diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2015-04-07 16:21:11 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-04-10 10:41:24 +0200 |
commit | 149c86e74fe44dcbac5e9f8d145c5fbc5dc21261 (patch) | |
tree | fe80ee5d681c97e8c91bbf7a712a2714e8d469d7 /drivers/gpu/drm/i915/i915_gem_context.c | |
parent | d7b9ca2f7a41cd36f5ca6c220df48ca9294ed37a (diff) | |
download | talos-obmc-linux-149c86e74fe44dcbac5e9f8d145c5fbc5dc21261.tar.gz talos-obmc-linux-149c86e74fe44dcbac5e9f8d145c5fbc5dc21261.zip |
drm/i915: Allocate context objects from stolen
As we never expose context objects directly to userspace, we can forgo
allocating a first-class GEM object for them and prefer to use the
limited resource of reserved/stolen memory for them. Note this means
that their initial contents are undefined.
However, a downside of using stolen objects for execlists is that we
cannot access the physical address directly (thanks MCH!) which prevents
their use.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_context.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_context.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index f3e84c44d009..e4c57a3981b3 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -157,7 +157,9 @@ i915_gem_alloc_context_obj(struct drm_device *dev, size_t size) struct drm_i915_gem_object *obj; int ret; - obj = i915_gem_alloc_object(dev, size); + obj = i915_gem_object_create_stolen(dev, size); + if (obj == NULL) + obj = i915_gem_alloc_object(dev, size); if (obj == NULL) return ERR_PTR(-ENOMEM); |