[Intel-gfx] [PATCH 13/15] drm/i915: Implement GTT variants of pread

Eric Anholt eric at anholt.net
Wed Mar 23 18:23:46 CET 2011


On Tue, 22 Mar 2011 13:51:58 +0000, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

Again, needs more justification.  For example, I would expect us not to
bother with the GTT on SNB pread/pwrite, and just read the backing pages
(they're in our cache, no need to clflush or anything) like we already
have code to do.  And one note below.

> @@ -587,17 +727,41 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data,
>  
>  	trace_i915_gem_object_pread(obj, args->offset, args->size);
>  
> -	ret = i915_gem_object_set_cpu_read_domain_range(obj,
> -							args->offset,
> -							args->size);
> -	if (ret)
> -		goto out;
> +	if (obj->gtt_space &&
> +	    obj->map_and_fenceable &&
> +	    obj->cache_level == I915_CACHE_NONE &&
> +	    (obj->base.read_domains & I915_GEM_DOMAIN_CPU) == 0) {
> +		ret = i915_gem_object_pin(obj, 0, true);
> +		if (ret)
> +			goto out;
> +
> +		ret = i915_gem_object_set_to_gtt_domain(obj, false);
> +		if (ret)
> +			goto out_unpin;

So, previously if I pread a tiled object, I got the tiled data.  Now
you're giving me maybe the tiled data, maybe the data untiled by reading
through a fence.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20110323/368aaa66/attachment.sig>


More information about the Intel-gfx mailing list