All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Runyan, Arthur J" <arthur.j.runyan@intel.com>
Cc: intel-gfx@lists.freedesktop.org,
	Vidya Srinivas <vidya.srinivas@intel.com>
Subject: Re: [PATCH 2/2] drm/i915: Control Vblank through IER instead of IMR
Date: Thu, 14 Sep 2017 15:23:52 +0300	[thread overview]
Message-ID: <20170914122352.GW4914@intel.com> (raw)
In-Reply-To: <1505391122-9437-2-git-send-email-vidya.srinivas@intel.com>

On Thu, Sep 14, 2017 at 05:42:02PM +0530, Vidya Srinivas wrote:
> From: Uma Shankar <uma.shankar@intel.com>
> 
> Frame timestamp register is not updated if the vblank
> inteerupts are not unmasked.

Art,

Do you know if there's some other way we could coax the hardware to
update the frame timestamp? I see that on non-DSI the timestamp seems to
update even with vblank irq masked in IMR, but DSI seems to be special.

Or even better if we could get the scanline counter to tick on DSI, but
I presume that simply can't be done.

And if we just have to do the IMR unmasking trick, any idea what the cost
of keeping vblank irqs always unmasked would be? I assume it has some
very slight power cost, but not sure if it's small enough to be meaningless.

> This is needed to calculate
> scanlines for DSI encoders. This patch changes the
> vblank enable/disable logic by controlling it through
> Pipe IER register instead of IMR. Pipe IMR will be unmasked
> permanently and IER will be toggled based on need.
> 
> Credits-to: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Uma Shankar <uma.shankar@intel.com>
> Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_irq.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 47668dd..a417cea 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -498,15 +498,14 @@ void bdw_update_pipe_irq(struct drm_i915_private *dev_priv,
>  	if (WARN_ON(!intel_irqs_enabled(dev_priv)))
>  		return;
>  
> -	new_val = dev_priv->de_irq_mask[pipe];
> -	new_val &= ~interrupt_mask;
> -	new_val |= (~enabled_irq_mask & interrupt_mask);
> +	new_val = I915_READ(GEN8_DE_PIPE_IER(pipe));
> +	if (enabled_irq_mask)
> +		new_val |= enabled_irq_mask;
> +	else
> +		new_val &= ~interrupt_mask;
>  
> -	if (new_val != dev_priv->de_irq_mask[pipe]) {
> -		dev_priv->de_irq_mask[pipe] = new_val;
> -		I915_WRITE(GEN8_DE_PIPE_IMR(pipe), dev_priv->de_irq_mask[pipe]);
> -		POSTING_READ(GEN8_DE_PIPE_IMR(pipe));
> -	}
> +	I915_WRITE(GEN8_DE_PIPE_IER(pipe), new_val);
> +	POSTING_READ(GEN8_DE_PIPE_IER(pipe));
>  }
>  
>  /**
> @@ -3450,8 +3449,9 @@ static void gen8_de_irq_postinstall(struct drm_i915_private *dev_priv)
>  				  GEN8_DE_PIPE_IRQ_FAULT_ERRORS;
>  	}
>  
> -	de_pipe_enables = de_pipe_masked | GEN8_PIPE_VBLANK |
> -					   GEN8_PIPE_FIFO_UNDERRUN;
> +	de_pipe_enables = de_pipe_masked | GEN8_PIPE_FIFO_UNDERRUN;
> +
> +	de_pipe_masked |= GEN8_PIPE_VBLANK;
>  
>  	de_port_enables = de_port_masked;
>  	if (IS_GEN9_LP(dev_priv))
> -- 
> 1.9.1

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-09-14 12:23 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-08 13:48 [PATCH] drm/i915: Enable scanline read for gen9 dsi Vidya Srinivas
2017-09-08 14:41 ` ✗ Fi.CI.BAT: failure for " Patchwork
2017-09-08 14:47 ` [PATCH] " Ville Syrjälä
2017-09-08 14:55   ` Ville Syrjälä
2017-09-08 15:25     ` Saarinen, Jani
2017-09-08 19:45     ` Daniel Vetter
2017-09-08 19:55       ` Chris Wilson
2017-09-11  8:52         ` Maarten Lankhorst
2017-09-11 12:21           ` Ville Syrjälä
2017-09-11 13:19       ` Shankar, Uma
2017-09-11 18:21         ` Ville Syrjälä
2017-09-12  9:32           ` Shankar, Uma
2017-09-11 13:04   ` Shankar, Uma
2017-09-11 17:50     ` Ville Syrjälä
2017-09-12  9:50       ` Shankar, Uma
2017-09-12 13:23         ` Shankar, Uma
2017-09-12 13:33           ` Ville Syrjälä
2017-09-12 13:40             ` Shankar, Uma
2017-09-12 13:55               ` Vidya Srinivas
2017-09-12 14:12               ` Ville Syrjälä
2017-09-12 14:21                 ` Shankar, Uma
2017-09-12 15:06                   ` Ville Syrjälä
2017-09-13  8:24                     ` Shankar, Uma
2017-09-13 17:36                       ` Ville Syrjälä
2017-09-14 11:47                         ` Shankar, Uma
2017-09-14 12:12                           ` [PATCH 1/2] " Vidya Srinivas
2017-09-14 12:12                             ` [PATCH 2/2] drm/i915: Control Vblank through IER instead of IMR Vidya Srinivas
2017-09-14 12:23                               ` Ville Syrjälä [this message]
2017-09-15 10:25                             ` [PATCH 1/2] drm/i915: Enable scanline read for gen9 dsi Chauhan, Madhav
2017-09-12 15:00 ` ✓ Fi.CI.BAT: success for drm/i915: Enable scanline read for gen9 dsi (rev2) Patchwork
2017-09-12 18:40 ` ✗ Fi.CI.IGT: warning " 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=20170914122352.GW4914@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=arthur.j.runyan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=vidya.srinivas@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.