From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/6] drm/i915: Reorder gen3/4 swizzle detection logic
Date: Tue, 19 Mar 2019 13:15:49 +0000 [thread overview]
Message-ID: <84c6ab05-63cb-0477-4bfd-a482c4e0fd8c@linux.intel.com> (raw)
In-Reply-To: <20190318165633.28924-1-ville.syrjala@linux.intel.com>
On 18/03/2019 16:56, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> g33/i964g/g45 are the exceptional cases when it comes to
> the swizzle detectiong. Let's reorder the code to handle
> them first and let everything else be handled by the
> else branch. This allows us to unset .is_mobile for the
> desktop PNV variant (which supposedly must follow the
> "mobile" path here).
>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem_fence_reg.c | 65 +++++++++++------------
> 1 file changed, 32 insertions(+), 33 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_fence_reg.c b/drivers/gpu/drm/i915/i915_gem_fence_reg.c
> index 65624b8e4d15..9418ad499b7e 100644
> --- a/drivers/gpu/drm/i915/i915_gem_fence_reg.c
> +++ b/drivers/gpu/drm/i915/i915_gem_fence_reg.c
> @@ -585,8 +585,38 @@ i915_gem_detect_bit_6_swizzle(struct drm_i915_private *dev_priv)
> */
> swizzle_x = I915_BIT_6_SWIZZLE_NONE;
> swizzle_y = I915_BIT_6_SWIZZLE_NONE;
> - } else if (IS_MOBILE(dev_priv) ||
> - IS_I915G(dev_priv) || IS_I945G(dev_priv)) {
> + } else if (IS_G45(dev_priv) || IS_I965G(dev_priv) || IS_G33(dev_priv)) {
> + /* The 965, G33, and newer, have a very flexible memory
> + * configuration. It will enable dual-channel mode
> + * (interleaving) on as much memory as it can, and the GPU
> + * will additionally sometimes enable different bit 6
> + * swizzling for tiled objects from the CPU.
> + *
> + * Here's what I found on the G965:
> + * slot fill memory size swizzling
> + * 0A 0B 1A 1B 1-ch 2-ch
> + * 512 0 0 0 512 0 O
> + * 512 0 512 0 16 1008 X
> + * 512 0 0 512 16 1008 X
> + * 0 512 0 512 16 1008 X
> + * 1024 1024 1024 0 2048 1024 O
> + *
> + * We could probably detect this based on either the DRB
> + * matching, which was the case for the swizzling required in
> + * the table above, or from the 1-ch value being less than
> + * the minimum size of a rank.
> + *
> + * Reports indicate that the swizzling actually
> + * varies depending upon page placement inside the
> + * channels, i.e. we see swizzled pages where the
> + * banks of memory are paired and unswizzled on the
> + * uneven portion, so leave that as unknown.
> + */
> + if (I915_READ16(C0DRB3) == I915_READ16(C1DRB3)) {
> + swizzle_x = I915_BIT_6_SWIZZLE_9_10;
> + swizzle_y = I915_BIT_6_SWIZZLE_9;
> + }
> + } else {
> u32 dcc;
>
> /* On 9xx chipsets, channel interleave by the CPU is
> @@ -636,37 +666,6 @@ i915_gem_detect_bit_6_swizzle(struct drm_i915_private *dev_priv)
> swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN;
> swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN;
> }
> - } else {
> - /* The 965, G33, and newer, have a very flexible memory
> - * configuration. It will enable dual-channel mode
> - * (interleaving) on as much memory as it can, and the GPU
> - * will additionally sometimes enable different bit 6
> - * swizzling for tiled objects from the CPU.
> - *
> - * Here's what I found on the G965:
> - * slot fill memory size swizzling
> - * 0A 0B 1A 1B 1-ch 2-ch
> - * 512 0 0 0 512 0 O
> - * 512 0 512 0 16 1008 X
> - * 512 0 0 512 16 1008 X
> - * 0 512 0 512 16 1008 X
> - * 1024 1024 1024 0 2048 1024 O
> - *
> - * We could probably detect this based on either the DRB
> - * matching, which was the case for the swizzling required in
> - * the table above, or from the 1-ch value being less than
> - * the minimum size of a rank.
> - *
> - * Reports indicate that the swizzling actually
> - * varies depending upon page placement inside the
> - * channels, i.e. we see swizzled pages where the
> - * banks of memory are paired and unswizzled on the
> - * uneven portion, so leave that as unknown.
> - */
> - if (I915_READ16(C0DRB3) == I915_READ16(C1DRB3)) {
> - swizzle_x = I915_BIT_6_SWIZZLE_9_10;
> - swizzle_y = I915_BIT_6_SWIZZLE_9;
> - }
> }
>
> if (swizzle_x == I915_BIT_6_SWIZZLE_UNKNOWN ||
>
Old/new/future behaviour checks out as far as I can see.
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-03-19 13:15 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-18 16:56 [PATCH 1/6] drm/i915: Reorder gen3/4 swizzle detection logic Ville Syrjala
2019-03-18 16:56 ` [PATCH 2/6] drm/i915: Introduce i9xx_has_pfit() Ville Syrjala
2019-03-19 13:24 ` Tvrtko Ursulin
2019-03-19 14:14 ` Ville Syrjälä
2019-03-19 14:23 ` [PATCH v2 " Ville Syrjala
2019-03-20 7:19 ` Tvrtko Ursulin
2019-03-18 16:56 ` [PATCH 3/6] drm/i915: Introduce i9xx_has_pps() Ville Syrjala
2019-03-19 13:26 ` Tvrtko Ursulin
2019-03-18 16:56 ` [PATCH 4/6] drm/i915: Introduce i915_has_asle() Ville Syrjala
2019-03-19 13:27 ` Tvrtko Ursulin
2019-03-18 16:56 ` [PATCH 5/6] drm/i915: Use HPLLVCO_MOBILE for all PNVs Ville Syrjala
2019-03-19 13:29 ` Tvrtko Ursulin
2019-03-20 15:27 ` Ville Syrjälä
2019-03-18 16:56 ` [PATCH 6/6] drm/i915: Clean up gen2 DPLL readout Ville Syrjala
2019-03-19 13:34 ` Tvrtko Ursulin
2019-03-19 14:17 ` Ville Syrjälä
2019-03-18 23:35 ` ✓ Fi.CI.BAT: success for series starting with [1/6] drm/i915: Reorder gen3/4 swizzle detection logic Patchwork
2019-03-19 13:06 ` ✓ Fi.CI.IGT: " Patchwork
2019-03-19 13:15 ` Tvrtko Ursulin [this message]
2019-03-19 15:50 ` ✓ Fi.CI.BAT: success for series starting with [1/6] drm/i915: Reorder gen3/4 swizzle detection logic (rev2) Patchwork
2019-03-20 0:40 ` ✓ Fi.CI.IGT: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=84c6ab05-63cb-0477-4bfd-a482c4e0fd8c@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox