[Intel-gfx] [PATCH] drm/i915: set scan-buffer as uncached on Sandybridge

Zhenyu Wang zhenyuw at linux.intel.com
Mon Oct 25 16:52:25 CEST 2010

On 2010.10.25 09:22:41 +0100, Chris Wilson wrote:
> You can't do this here, changing the AGP type of a potentially bound
> object without any locking.
> Move this into intel_pin_and_fence_fb_obj(), give it a decent name and
> make it robust.

oh, right, thanks for point this out.

> int i915_gem_object_enable_scanout(struct drm_i915_gem_object *obj)
> {
> /* These names are absolutely terrible. we should have just made
>  * AGR_USER_CACHED_MEMORY the default on gen6 and kept the AGP_USER_MEMORY
>  * as uncached on all generations, rather than mixing up the cacheability
>  * status of common enums.
>  */
> 	if (obj->agp_type == type)
> 		return 0;
> 	if (obj->gtt_space) {
> 		int ret = i915_gem_object_unbind(&obj->base);
> 		if (ret)
> 			return ret;
> 	}
> 	obj->agp_type = type;
> 	return 0;
> }
> [And the additional bit of insight...]
> Also add a call from intel_user_framebuffer_create, as being the earliest
> opportunity to avoid the unbind penalty. What is the performance impact of
> rendering to an uncached buffer on Sandybridge? 

I also did another way to fix this by using new GFDT flag for each PTE.
Now every flush method for any ring has the ability to sync pages with
GFDT bit set, so scan-buffer could be set with GFDT and ensure it's got
flush out in time and synced. But we've been told uncached display buffer
setting on sandybridge is the plan to go..

> Should we only be changing
> the caching status whilst pinned as the framebuffer? Rather than
> unbinding/rebinding, should we introduce a function [once we have a native
> GTT interface, Daniel!] to simply update the flags on the PTEs for an
> object (obviously with suitable flushing).
> -Chris

Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20101025/66c7d678/attachment.sig>

More information about the Intel-gfx mailing list