From: Eric Anholt Subject: Re: [PATCH 04/11] drm/i915/context: CXT_SIZE register offsets added Date: Wed, 15 Feb 2012 11:39:47 -0800 Message-ID: <87boozevi4.fsf@eliezer.anholt.net> References: <1329253758-24943-1-git-send-email-ben@bwidawsk.net> <1329253758-24943-5-git-send-email-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1388223804==" Return-path: In-Reply-To: <1329253758-24943-5-git-send-email-ben@bwidawsk.net> 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: intel-gfx@lists.freedesktop.org Cc: Ben Widawsky List-Id: intel-gfx@lists.freedesktop.org --===============1388223804== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Transfer-Encoding: quoted-printable On Tue, 14 Feb 2012 22:09:11 +0100, Ben Widawsky wrote: > From: Ben Widawsky >=20 > The GPUs can have different default context layouts, and the sizes could > vary based on platform or BIOS. In order to back the context object with > a properly sized BO, we must read this register in order to find out a > sufficient size. >=20 > Thankfully (sarcarm!), the register moves and changes meanings > throughout generations. >=20 > CTX and CXT differences are intentional as that is how it is in the > documentation (prior to GEN6 it was CXT). >=20 > Signed-off-by: Ben Widawsky > --- > drivers/gpu/drm/i915/i915_reg.h | 13 +++++++++++++ > 1 files changed, 13 insertions(+), 0 deletions(-) >=20 > diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_= reg.h > index 0c785af..5e61e79 100644 > --- a/drivers/gpu/drm/i915/i915_reg.h > +++ b/drivers/gpu/drm/i915/i915_reg.h > @@ -1361,6 +1361,19 @@ > */ > #define CCID 0x2180 > #define CCID_EN (1<<0) > +#define CXT_SIZE 0x21a0 > +#define GEN6_CXT_RENDER_SIZE ((I915_READ(CXT_SIZE) >> 12) & 0x3f) > +#define GEN6_CXT_EXTENDED_SIZE ((I915_READ(CXT_SIZE) >> 6) & 0x3f) > +#define GEN6_CXT_PIPELINE_SIZE ((I915_READ(CXT_SIZE) >> 0) & 0x3f) > +#define GEN6_CXT_TOTAL_SIZE (GEN6_CXT_RENDER_SIZE + GEN6_CXT_EXTENDED_SI= ZE + GEN6_CXT_PIPELINE_SIZE) > +#define GEN7_CTX_SIZE 0x21a8 > +#define GEN7_CTX_RENDER_SIZE ((I915_READ(GEN7_CTX_SIZE) >> 16) & 0x3f) > +#define GEN7_CTX_EXTENDED_SIZE ((I915_READ(GEN7_CTX_SIZE) >> 9) & 0x7f) > +#define GEN7_CTX_GT1_SIZE ((I915_READ(GEN7_CTX_SIZE) >> 6) & 0x7) > +#define GEN7_CTX_VFSTATE_SIZE ((I915_READ(GEN7_CTX_SIZE) >> 0) & 0x3f) > +#define GEN7_CTX_TOTAL_SIZE (GEN7_CTX_RENDER_SIZE + GEN7_CTX_EXTENDED_SI= ZE \ > + + GEN7_CTX_GT1_SIZE + GEN7_CTX_VFSTATE_SIZE) > + I was surprised to see register reads in i915_reg.h definitions. I'd rather see this folded into the one callsite, and just the reg numbers in i915_reg.h. There's a bit of a discrepancy here -- CXT vs CTX. The docs appear to actually use CXT, which I will probably never type successfully since contexts are "ctx" all over my other code. Still, consistently using the docs' spelling is probably better than inconsistently using it :) --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk88CgMACgkQHUdvYGzw6veM4QCfVpPiXwuNWnnaQgkabBlA9bb2 I7cAn2o7xLIP5zQ5yzHlPLsgZAH7xm1l =heI8 -----END PGP SIGNATURE----- --=-=-=-- --===============1388223804== 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 --===============1388223804==--