From: Paulo Zanoni <przanoni@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: arthur.j.runyan@intel.com, Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: [PATCH] drm/i915: enable trickle feed on Haswell
Date: Fri, 23 Aug 2013 19:51:28 -0300 [thread overview]
Message-ID: <1377298288-2830-1-git-send-email-przanoni@gmail.com> (raw)
From: Paulo Zanoni <paulo.r.zanoni@intel.com>
We shouldn't disable the trickle feed bits on Haswell. Our
documentation explicitly says the trickle feed bits of PRI_CTL and
CUR_CTL should not be programmed to 1, and the hardware engineer also
asked us to not program the SPR_CTL field to 1. Leaving the bits as 1
could cause underflows.
Reported-by: Arthur Runyan <arthur.j.runyan@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
drivers/gpu/drm/i915/i915_reg.h | 1 +
drivers/gpu/drm/i915/intel_display.c | 10 +++++++---
drivers/gpu/drm/i915/intel_pm.c | 2 --
drivers/gpu/drm/i915/intel_sprite.c | 7 +++++--
4 files changed, 13 insertions(+), 7 deletions(-)
Some side discussions:
1 - It seems we always do read-modify-write with the PRI/SPR/CUR registers. I
think this is dangerous since we may forget to disable something and keep our
code in a bugged state forever. Shouldn't we try to completely set the full
state of the bits from scratch every time we enable PRI/SPR/CUR?
2 - We also have code to enable the trickle feed bits at init_clock_gating.
Isn't this dangerous? Trickle fee changes the memory is read, my first guess
would be that it's probably not safe to change this bit when things are
enabled. Also, we lose the state of these bits when the power well is disabled,
so the code in init_clock_gating really makes no sense on Haswell.
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index bbbc177..e92bb47 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -3312,6 +3312,7 @@
#define MCURSOR_PIPE_A 0x00
#define MCURSOR_PIPE_B (1 << 28)
#define MCURSOR_GAMMA_ENABLE (1 << 26)
+#define CURSOR_TRICKLE_FEED_DISABLE (1 << 14)
#define _CURABASE (dev_priv->info->display_mmio_offset + 0x70084)
#define _CURAPOS (dev_priv->info->display_mmio_offset + 0x70088)
#define CURSOR_POS_MASK 0x007FF
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index c64631d..d5f038e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2077,8 +2077,10 @@ static int ironlake_update_plane(struct drm_crtc *crtc,
else
dspcntr &= ~DISPPLANE_TILED;
- /* must disable */
- dspcntr |= DISPPLANE_TRICKLE_FEED_DISABLE;
+ if (IS_HASWELL(dev))
+ dspcntr &= ~DISPPLANE_TRICKLE_FEED_DISABLE;
+ else
+ dspcntr |= DISPPLANE_TRICKLE_FEED_DISABLE;
I915_WRITE(reg, dspcntr);
@@ -6768,8 +6770,10 @@ static void ivb_update_cursor(struct drm_crtc *crtc, u32 base)
cntl &= ~(CURSOR_MODE | MCURSOR_GAMMA_ENABLE);
cntl |= CURSOR_MODE_DISABLE;
}
- if (IS_HASWELL(dev))
+ if (IS_HASWELL(dev)) {
cntl |= CURSOR_PIPE_CSC_ENABLE;
+ cntl &= ~CURSOR_TRICKLE_FEED_DISABLE;
+ }
I915_WRITE(CURCNTR_IVB(pipe), cntl);
intel_crtc->cursor_visible = visible;
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 4605682..3a5c0bb 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -4950,8 +4950,6 @@ static void haswell_init_clock_gating(struct drm_device *dev)
I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) |
GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB);
- g4x_disable_trickle_feed(dev);
-
/* WaVSRefCountFullforceMissDisable:hsw */
gen7_setup_fixed_func_scheduler(dev_priv);
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 78b621c..ad6ec4b 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -260,8 +260,11 @@ ivb_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
if (obj->tiling_mode != I915_TILING_NONE)
sprctl |= SPRITE_TILED;
- /* must disable */
- sprctl |= SPRITE_TRICKLE_FEED_DISABLE;
+ if (IS_HASWELL(dev))
+ sprctl &= ~SPRITE_TRICKLE_FEED_DISABLE;
+ else
+ sprctl |= SPRITE_TRICKLE_FEED_DISABLE;
+
sprctl |= SPRITE_ENABLE;
if (IS_HASWELL(dev))
--
1.8.1.2
next reply other threads:[~2013-08-23 22:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-23 22:51 Paulo Zanoni [this message]
2013-08-30 17:25 ` [PATCH] drm/i915: enable trickle feed on Haswell Ville Syrjälä
2013-09-02 6:01 ` Daniel Vetter
[not found] ` <29427_1378101775_52242A0E_29427_747_1_20130902060151.GE9374@phenom.ffwll.local>
2013-10-05 8:33 ` Questions on display pipes on 835GM Thomas Richter
2013-10-05 11:44 ` Ville Syrjälä
[not found] ` <29761_1380973482_524FFBA9_29761_4042_1_20131005114432.GE9395@intel.com>
2013-10-05 16:47 ` Thomas Richter
2013-10-05 19:24 ` Daniel Vetter
2013-10-05 19:39 ` Daniel Vetter
[not found] ` <29761_1381001928_52506AC8_29761_5606_1_20131005193904.GX31334@phenom.ffwll.local>
2013-10-05 23:09 ` Thomas Richter
2013-10-05 23:37 ` Daniel Vetter
[not found] ` <5132_1381149082_5252A99A_5132_80_1_CAKMK7uHkOJ=urFKCacocf_i+6YL9Azf5vK=Au-kRJMi=sNBP1Q@mail.gmail.com>
2013-10-07 21:58 ` Broken in 3.10.10 (was: Questions on display pipes on 835GM) Thomas Richter
2013-10-08 7:24 ` Daniel Vetter
2013-10-08 8:39 ` Daniel Vetter
2013-10-08 9:14 ` Chris Wilson
[not found] ` <26192_1381221546_5253C4A9_26192_7222_1_CAKMK7uGvk9vuNXunutyHjkGjvBWsv7ObN02EfbG2679MtQ5M=A@mail.gmail.com>
2013-10-08 17:06 ` Broken in 3.10.10 Thomas Richter
2013-10-05 23:04 ` [PATCH] 835GM DLL setup Thomas Richter
2013-10-05 23:46 ` Daniel Vetter
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=1377298288-2830-1-git-send-email-przanoni@gmail.com \
--to=przanoni@gmail.com \
--cc=arthur.j.runyan@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=paulo.r.zanoni@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