From: Zhenyu Wang Subject: Re: [PATCH] drm/i915: set scan-buffer as uncached on Sandybridge Date: Mon, 25 Oct 2010 22:52:25 +0800 Message-ID: <20101025145225.GA27687@zhen-devel.sh.intel.com> References: <1287970951-3677-1-git-send-email-zhenyuw@linux.intel.com> <849307$a48ipo@azsmga001.ch.intel.com> Reply-To: Zhenyu Wang Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1291360883==" Return-path: Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by gabe.freedesktop.org (Postfix) with ESMTP id E56B89ECC6 for ; Mon, 25 Oct 2010 07:52:27 -0700 (PDT) In-Reply-To: <849307$a48ipo@azsmga001.ch.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Chris Wilson Cc: intel-gfx@lists.freedesktop.org, stable team List-Id: intel-gfx@lists.freedesktop.org --===============1291360883== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/04w6evG8XlLl3ft" Content-Disposition: inline --/04w6evG8XlLl3ft Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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. >=20 > int i915_gem_object_enable_scanout(struct drm_i915_gem_object *obj) > { > int type =3D IS_GEN6(dev) ? AGP_USER_UNCACHED_MEMORY : AGP_USER_MEMORY; > /* 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. > */ >=20 > if (obj->agp_type =3D=3D type) > return 0; >=20 > if (obj->gtt_space) { > int ret =3D i915_gem_object_unbind(&obj->base); > if (ret) > return ret; > } >=20 > obj->agp_type =3D type; > return 0; > } >=20 > [And the additional bit of insight...] >=20 > 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?=20 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 >=20 --=20 Open Source Technology Center, Intel ltd. $gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827 --/04w6evG8XlLl3ft Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkzFmakACgkQsQQaM014GCcSfACfflTyX+CfT+iLk8VVSQzlMzLo 6V4An1p5qDmSsxZY/Z6hvKz04hHWsXQe =5tic -----END PGP SIGNATURE----- --/04w6evG8XlLl3ft-- --===============1291360883== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============1291360883==--