From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915: Fix scanline counter fixup on BDW
Date: Tue, 11 Mar 2014 15:46:25 +0200 [thread overview]
Message-ID: <87d2hsq24u.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <1394535526-20513-2-git-send-email-ville.syrjala@linux.intel.com>
ville.syrjala@linux.intel.com writes:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> The display interrupts changed on BDW, so the current ILK-HSW specific
> code in ilk_pipe_in_vblank_locked() doesn't work there. Add the required
> bits for BDW, and while at it, change the existing code to use nicer
> looking vblank status bit macros.
>
> Also remove the now stale __raw_i915_read16() definition which was
> left over from the failed gen2 ISR experiment.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73962
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Both patches,
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
With regards to changing raw reads to I915_READ:
I would rather keep the raw_reads here to
keep the same locking behaviour, for now. Referring to this
comment in i915_get_crtc_scanoutpos:
/*
* Lock uncore.lock, as we will do multiple timing critical raw
* register reads, potentially with preemption disabled, so the
* following code must not block on uncore.lock.
*/
-Mika
> drivers/gpu/drm/i915/i915_irq.c | 30 +++++++++++-------------------
> 1 file changed, 11 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index d4c952d..ec9b8a4 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -618,33 +618,25 @@ static u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe)
>
> /* raw reads, only for fast reads of display block, no need for forcewake etc. */
> #define __raw_i915_read32(dev_priv__, reg__) readl((dev_priv__)->regs + (reg__))
> -#define __raw_i915_read16(dev_priv__, reg__) readw((dev_priv__)->regs + (reg__))
>
> static bool ilk_pipe_in_vblank_locked(struct drm_device *dev, enum pipe pipe)
> {
> struct drm_i915_private *dev_priv = dev->dev_private;
> uint32_t status;
> -
> - if (INTEL_INFO(dev)->gen < 7) {
> - status = pipe == PIPE_A ?
> - DE_PIPEA_VBLANK :
> - DE_PIPEB_VBLANK;
> + int reg;
> +
> + if (INTEL_INFO(dev)->gen >= 8) {
> + status = GEN8_PIPE_VBLANK;
> + reg = GEN8_DE_PIPE_ISR(pipe);
> + } else if (INTEL_INFO(dev)->gen >= 7) {
> + status = DE_PIPE_VBLANK_IVB(pipe);
> + reg = DEISR;
> } else {
> - switch (pipe) {
> - default:
> - case PIPE_A:
> - status = DE_PIPEA_VBLANK_IVB;
> - break;
> - case PIPE_B:
> - status = DE_PIPEB_VBLANK_IVB;
> - break;
> - case PIPE_C:
> - status = DE_PIPEC_VBLANK_IVB;
> - break;
> - }
> + status = DE_PIPE_VBLANK(pipe);
> + reg = DEISR;
> }
>
> - return __raw_i915_read32(dev_priv, DEISR) & status;
> + return __raw_i915_read32(dev_priv, reg) & status;
> }
>
> static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,
> --
> 1.8.3.2
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2014-03-11 13:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-11 10:58 [PATCH v2 1/2] drm/i915: Add a workaround for HSW scanline counter weirdness ville.syrjala
2014-03-11 10:58 ` [PATCH 2/2] drm/i915: Fix scanline counter fixup on BDW ville.syrjala
2014-03-11 11:38 ` Daniel Vetter
2014-03-11 12:01 ` Ville Syrjälä
2014-03-11 13:46 ` Mika Kuoppala [this message]
2014-03-12 16:46 ` Jani Nikula
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=87d2hsq24u.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@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