[Intel-gfx] [PATCH 10/21] drm/i915: Allocate scratch page from stolen
Tvrtko Ursulin
tvrtko.ursulin at linux.intel.com
Mon Jun 6 15:05:02 UTC 2016
On 03/06/16 17:08, Chris Wilson wrote:
> With the last direct CPU access to the scratch page removed, we can now
> allocate it from our small amount of reserved system pages (stolen
> memory).
>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/intel_ringbuffer.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index 106f40c52bb5..b7eebbed945d 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -660,7 +660,9 @@ int intel_init_pipe_control(struct intel_engine_cs *engine)
>
> WARN_ON(engine->scratch.obj);
>
> - obj = i915_gem_object_create(engine->i915->dev, 4096);
> + obj = i915_gem_object_create_stolen(engine->i915->dev, 4096);
> + if (obj == NULL)
> + obj = i915_gem_object_create(engine->i915->dev, 4096);
> if (IS_ERR(obj)) {
> DRM_ERROR("Failed to allocate scratch page\n");
> ret = PTR_ERR(obj);
>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Regards,
Tvrtko
More information about the Intel-gfx
mailing list