public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: "Bhat, Gajanan" <gajanan.bhat@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/i915: Add sprite watermark programming for VLV and CHV
Date: Thu, 07 Aug 2014 12:51:51 +0300	[thread overview]
Message-ID: <1407405111.32060.16.camel@intelbox> (raw)
In-Reply-To: <53E31517.6090204@intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 4329 bytes --]

On Thu, 2014-08-07 at 11:26 +0530, Bhat, Gajanan wrote:
> On 7/31/2014 7:14 PM, Imre Deak wrote:
> > On Wed, 2014-07-16 at 18:24 +0530, Gajanan Bhat wrote:
> >> Program DDL register as part sprite watermark programming for CHV and VLV.
> >>
> >> Signed-off-by: Gajanan Bhat <gajanan.bhat@intel.com>
> > This looks ok, but could you confirm, ideally referencing some document,
> > that we don't need to program any of the sprite watermark level
> > registers along with the DDL values? Specifically I mean the FW7, FW8
> > registers.
> >
> I have looked at the B-spec to again confirm my understanding. The
> chicken bit in CBR1 specifies which mechanism (PND or watermark) to be
> used. In our case we are using only the PND with DDL. I couldn't find
> any reference which explicitly tells that both DDL and watermarks
> should be programmed together. Also we have tested this code and so far
> it has not caused any problem.

Thanks for clarifying this, the docs on this are fuzzy to me. Earlier
Cesar and Ville also pointed out that the PND mechanism depends on the
MI_ARB[trickle feed] flag being enabled, which is afaics disabled on
VLV. But based on what you say I understand that the DDL values are not
used in the 'watermark mode', so I'm ok with your change. Perhaps a
comment about this could be added.

--Imre

> -Gajanan
> 
> >> ---
> >>   drivers/gpu/drm/i915/intel_pm.c |   44 +++++++++++++++++++++++++++++++++++++++
> >>   1 file changed, 44 insertions(+)
> >>
> >> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> >> index f3a3e90..0f439f7 100644
> >> --- a/drivers/gpu/drm/i915/intel_pm.c
> >> +++ b/drivers/gpu/drm/i915/intel_pm.c
> >> @@ -1405,6 +1405,48 @@ static void valleyview_update_wm(struct drm_crtc *crtc)
> >>   		intel_set_memory_cxsr(dev_priv, true);
> >>   }
> >>   
> >> +static void valleyview_update_sprite_wm(struct drm_plane *plane,
> >> +					struct drm_crtc *crtc,
> >> +					uint32_t sprite_width,
> >> +					uint32_t sprite_height,
> >> +					int pixel_size,
> >> +					bool enabled, bool scaled)
> >> +{
> >> +	struct drm_device *dev = crtc->dev;
> >> +	struct drm_i915_private *dev_priv = dev->dev_private;
> >> +	int pipe = to_intel_plane(plane)->pipe;
> >> +	int drain_latency;
> >> +	int plane_prec;
> >> +	int sprite_dl;
> >> +	int prec_mult;
> >> +
> >> +	if (to_intel_plane(plane)->plane == 0)
> >> +		sprite_dl = I915_READ(VLV_DDL(pipe)) & ~DDL_SPRITE0_PRECISION_64 &
> >> +			    ~(DRAIN_LATENCY_MAX << DDL_SPRITE0_SHIFT);
> >> +	else
> >> +		sprite_dl = I915_READ(VLV_DDL(pipe)) & ~DDL_SPRITE1_PRECISION_64 &
> >> +			    ~(DRAIN_LATENCY_MAX << DDL_SPRITE1_SHIFT);
> >> +
> >> +	if (enabled && vlv_compute_drain_latency(crtc, pixel_size, &prec_mult,
> >> +						 &drain_latency)) {
> >> +		if (to_intel_plane(plane)->plane == 0) {
> >> +			plane_prec = (prec_mult == DRAIN_LATENCY_PRECISION_64) ?
> >> +						   DDL_SPRITE0_PRECISION_64 :
> >> +						   DDL_SPRITE0_PRECISION_32;
> >> +			sprite_dl = sprite_dl | plane_prec |
> >> +				    drain_latency << DDL_SPRITE0_SHIFT;
> >> +		} else {
> >> +			plane_prec = (prec_mult == DRAIN_LATENCY_PRECISION_64) ?
> >> +						   DDL_SPRITE1_PRECISION_64 :
> >> +						   DDL_SPRITE1_PRECISION_32;
> >> +			sprite_dl = sprite_dl | plane_prec |
> >> +				    drain_latency << DDL_SPRITE1_SHIFT;
> >> +		}
> >> +	}
> >> +
> >> +	I915_WRITE(VLV_DDL(pipe), sprite_dl);
> >> +}
> >> +
> >>   static void g4x_update_wm(struct drm_crtc *crtc)
> >>   {
> >>   	struct drm_device *dev = crtc->dev;
> >> @@ -6851,10 +6893,12 @@ void intel_init_pm(struct drm_device *dev)
> >>   			dev_priv->display.init_clock_gating = gen8_init_clock_gating;
> >>   	} else if (IS_CHERRYVIEW(dev)) {
> >>   		dev_priv->display.update_wm = valleyview_update_wm;
> >> +		dev_priv->display.update_sprite_wm = valleyview_update_sprite_wm;
> >>   		dev_priv->display.init_clock_gating =
> >>   			cherryview_init_clock_gating;
> >>   	} else if (IS_VALLEYVIEW(dev)) {
> >>   		dev_priv->display.update_wm = valleyview_update_wm;
> >> +		dev_priv->display.update_sprite_wm = valleyview_update_sprite_wm;
> >>   		dev_priv->display.init_clock_gating =
> >>   			valleyview_init_clock_gating;
> >>   	} else if (IS_PINEVIEW(dev)) {
> 


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2014-08-07  9:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16 12:54 [PATCH 0/3] Update DDL code to support sprite watermarks Gajanan Bhat
2014-07-16 12:54 ` [PATCH 1/3] drm/i915: Update DDL only for current CRTC Gajanan Bhat
2014-07-31 12:53   ` Imre Deak
2014-07-16 12:54 ` [PATCH 2/3] drm/i915: Generalize drain latency computation Gajanan Bhat
2014-07-31 13:33   ` Imre Deak
2014-08-04 14:41   ` Ville Syrjälä
2014-08-05 17:45     ` [PATCH v2 1/2] " Gajanan Bhat
2014-08-05 12:56       ` Ville Syrjälä
2014-08-06 20:28         ` [PATCH v3] " Gajanan Bhat
2014-08-06 15:07           ` Ville Syrjälä
2014-08-06 19:49             ` Daniel Vetter
2014-08-05 17:45       ` [PATCH 2/2] drm/i915: Round-up clock and limit drain latency Gajanan Bhat
2014-08-05 12:46         ` Ville Syrjälä
2014-07-16 12:54 ` [PATCH 3/3] drm/i915: Add sprite watermark programming for VLV and CHV Gajanan Bhat
2014-07-31 13:44   ` Imre Deak
2014-08-07  5:56     ` Bhat, Gajanan
2014-08-07  9:51       ` Imre Deak [this message]

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=1407405111.32060.16.camel@intelbox \
    --to=imre.deak@intel.com \
    --cc=gajanan.bhat@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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