All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shankar, Uma" <uma.shankar@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Srinivas, Vidya" <vidya.srinivas@intel.com>
Subject: Re: [PATCH] drm/i915: Enable scanline read for gen9 dsi
Date: Tue, 12 Sep 2017 09:32:13 +0000	[thread overview]
Message-ID: <E7C9878FBA1C6D42A1CA3F62AEB6945F7EFFAE3D@BGSMSX104.gar.corp.intel.com> (raw)
In-Reply-To: <20170911182101.GO4914@intel.com>



>-----Original Message-----
>From: Ville Syrjälä [mailto:ville.syrjala@linux.intel.com]
>Sent: Monday, September 11, 2017 11:51 PM
>To: Shankar, Uma <uma.shankar@intel.com>
>Cc: Daniel Vetter <daniel@ffwll.ch>; intel-gfx@lists.freedesktop.org; Srinivas,
>Vidya <vidya.srinivas@intel.com>
>Subject: Re: [Intel-gfx] [PATCH] drm/i915: Enable scanline read for gen9 dsi
>
>On Mon, Sep 11, 2017 at 01:19:15PM +0000, Shankar, Uma wrote:
>>
>>
>> >-----Original Message-----
>> >From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On
>> >Behalf Of Daniel Vetter
>> >Sent: Saturday, September 9, 2017 1:15 AM
>> >To: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> >Cc: intel-gfx@lists.freedesktop.org; Srinivas, Vidya
>> ><vidya.srinivas@intel.com>
>> >Subject: Re: [Intel-gfx] [PATCH] drm/i915: Enable scanline read for
>> >gen9 dsi
>> >
>> >On Fri, Sep 08, 2017 at 05:55:24PM +0300, Ville Syrjälä wrote:
>> >> On Fri, Sep 08, 2017 at 05:47:59PM +0300, Ville Syrjälä wrote:
>> >> > On Fri, Sep 08, 2017 at 07:18:55PM +0530, Vidya Srinivas wrote:
>> >> > > From: Uma Shankar <uma.shankar@intel.com>
>> >> > >
>> >> > > For gen9 platforms, dsi timings are driven from port instead of
>> >> > > pipe (unlike ddi). Thus, we can't rely on pipe registers to get
>> >> > > the timing information. Even scanline register read will not be functional.
>> >> > > This is causing vblank evasion logic to fail since it relies on
>> >> > > scanline, causing atomic update failure warnings.
>> >> > >
>> >> > > This patch uses pipe framestamp and current timestamp registers
>> >> > > to calculate scanline. This is an indirect way to get the scanline.
>> >> > > It helps resolve atomic update failure for gen9 dsi platforms.
>> >> > >
>> >> > > Signed-off-by: Uma Shankar <uma.shankar@intel.com>
>> >> > > Signed-off-by: Chandra Konduru <chandra.konduru@intel.com>
>> >> > > Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
>> >> > > ---
>> >> > >  drivers/gpu/drm/i915/i915_drv.h  |  2 ++
>> >> > > drivers/gpu/drm/i915/i915_irq.c  |  5 +++++
>> >> > > drivers/gpu/drm/i915/i915_reg.h  |  3 +++
>> >> > > drivers/gpu/drm/i915/intel_dsi.c | 46
>> >> > > ++++++++++++++++++++++++++++++++++++++++
>> >> > >  4 files changed, 56 insertions(+)
>> >> > >
>> >> > > diff --git a/drivers/gpu/drm/i915/i915_drv.h
>> >> > > b/drivers/gpu/drm/i915/i915_drv.h index d07d110..4213b54 100644
>> >> > > --- a/drivers/gpu/drm/i915/i915_drv.h
>> >> > > +++ b/drivers/gpu/drm/i915/i915_drv.h
>> >> > > @@ -4077,6 +4077,8 @@ void intel_sbi_write(struct
>> >> > > drm_i915_private *dev_priv, u16 reg, u32 value,
>> >> > >  u32 vlv_flisdsi_read(struct drm_i915_private *dev_priv, u32
>> >> > > reg); void vlv_flisdsi_write(struct drm_i915_private *dev_priv,
>> >> > > u32 reg,
>> >> > > u32 val);
>> >> > >
>> >> > > +u32 bxt_dsi_get_scanline(struct intel_crtc *crtc);
>> >> > > +
>> >> > >  /* intel_dpio_phy.c */
>> >> > >  void bxt_port_to_phy_channel(struct drm_i915_private
>> >> > > *dev_priv, enum
>> >port port,
>> >> > >  			     enum dpio_phy *phy, enum dpio_channel
>*ch); diff --
>> >git
>> >> > > a/drivers/gpu/drm/i915/i915_irq.c
>> >> > > b/drivers/gpu/drm/i915/i915_irq.c index 5d391e6..31aa7f0 100644
>> >> > > --- a/drivers/gpu/drm/i915/i915_irq.c
>> >> > > +++ b/drivers/gpu/drm/i915/i915_irq.c
>> >> > > @@ -781,6 +781,7 @@ static int __intel_get_crtc_scanline(struct
>> >> > > intel_crtc
>> >*crtc)
>> >> > >  	struct drm_vblank_crtc *vblank;
>> >> > >  	enum pipe pipe = crtc->pipe;
>> >> > >  	int position, vtotal;
>> >> > > +	enum transcoder cpu_transcoder;
>> >> > >
>> >> > >  	if (!crtc->active)
>> >> > >  		return -1;
>> >> > > @@ -792,6 +793,10 @@ static int
>> >> > > __intel_get_crtc_scanline(struct
>> >intel_crtc *crtc)
>> >> > >  	if (mode->flags & DRM_MODE_FLAG_INTERLACE)
>> >> > >  		vtotal /= 2;
>> >> > >
>> >> > > +	cpu_transcoder = crtc->config->cpu_transcoder;
>> >> >
>> >> > Humm. Would be nice to be able to do this without adding more
>> >> > crtc->config uses. We're pretty much trying to get rid of that guy.
>> >> >
>> >> > > +	if (IS_BROXTON(dev_priv) && transcoder_is_dsi(cpu_transcoder))
>> >> > > +		return bxt_dsi_get_scanline(crtc);
>> >> > > +
>> >> > >  	if (IS_GEN2(dev_priv))
>> >> > >  		position = I915_READ_FW(PIPEDSL(pipe)) &
>> >DSL_LINEMASK_GEN2;
>> >> > >  	else
>> >> > > diff --git a/drivers/gpu/drm/i915/i915_reg.h
>> >> > > b/drivers/gpu/drm/i915/i915_reg.h index 9a73ea0..54582de 100644
>> >> > > --- a/drivers/gpu/drm/i915/i915_reg.h
>> >> > > +++ b/drivers/gpu/drm/i915/i915_reg.h
>> >> > > @@ -8802,6 +8802,9 @@ enum skl_power_gate {
>> >> > >  #define MIPIO_TXESC_CLK_DIV2
>	_MMIO(0x160008)
>> >> > >  #define  GLK_TX_ESC_CLK_DIV2_MASK			0x3FF
>> >> > >
>> >> > > +#define BXT_TIMESTAMP_CTR	_MMIO(0x44070)
>> >> > > +#define BXT_PIPE_FRMTMSTMP_A	_MMIO(0x70048)
>> >> >
>> >> > Please add proper parametrized define that works for all pipes.
>> >>
>> >> Oh, and these shouldn't be called BXT_something. I don't recall
>> >> when they got added to the hardware, but I'm pretty sure it was way
>> >> before BXT came out.
>> >
>> >gen5 or maybe gen4.5 iirc.
>> >
>>
>> As per spec, it says BDW+. Will rename them using BDW as prefix.
>
>You're not looking at the right spec then. Looks like ctg/elk is the right answer
>indeed. The gen4 spec is a bit confused in that it doesn't correctly state whether
>some of the regs apply to gen4 or ctg/elk. But testing on actual gen4 hardware
>gives me 0s from all the pipe timestamp registers, whereas elk gives sane looking
>value. The TIMESTAMP register did exist on gen4 already.
>
>There have been some changes in the TIMESTAMP register(s) throughout the
>years though. I'll try to summarize below:
>
>bw/cl: TIMESTAMP/0x2358. 64bit register that increments every 16 hclks
>ctg/elk: TIMESTAMP/0x2358. 64bit register where the upper 32 bits increment
>         every 1.024us, the lower part has more 12 bits which means the whole
>         value increments every 1/4 ns
>ilk/snb: TIMESTAMP/0x2358 "64bit" register where the upprt 32 bits increment
>         every 1 us. Lower part is documented as MBZ. The upprt part is
>         aliased as TIMESTAMP_HI high at offset 0x70070
>ivb+: TIMESTAMP_HI got renamed to TIMESTAMP_CTR and moved to 0x44070
>
>The pipe flip/frame timestamp registers seem to have remained unchanged ever
>since ctg/elk.
>

Thanks Ville for this info. Will update the Current Timestamp register for Gen4 and Gen7 (declare
as separate macros). Also will define Frame Timestamp  generically.

>--
>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-12  9:32 UTC|newest]

Thread overview: 33+ 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 [this message]
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ä
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
2017-09-18 13:41 [PATCH] drm/i915: Enable scanline read for gen9 dsi Vidya Srinivas
2017-09-19  2:31 ` kbuild test robot

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=E7C9878FBA1C6D42A1CA3F62AEB6945F7EFFAE3D@BGSMSX104.gar.corp.intel.com \
    --to=uma.shankar@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=vidya.srinivas@intel.com \
    --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 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.