All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: set interlaced bits for TRANSCONF
@ 2012-02-03 19:47 Paulo Zanoni
  2012-02-08 22:53 ` Jesse Barnes
  2012-02-08 22:58 ` Jesse Barnes
  0 siblings, 2 replies; 5+ messages in thread
From: Paulo Zanoni @ 2012-02-03 19:47 UTC (permalink / raw)
  To: intel-gfx; +Cc: Paulo Zanoni

From: Paulo Zanoni <paulo.r.zanoni@intel.com>

I'm not sure why they are needed (I didn't notice any difference in my
tests), but these bits are in our documentation and they are also set by
the Windows driver.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/i915_reg.h      |    2 ++
 drivers/gpu/drm/i915/intel_display.c |   12 ++++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

Apply on top of danvet's interlaced branch. This seems to be the last
 difference between Windows and Linux that is related to interlaced
modes.

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index bcd5cce..98494d6 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -3294,7 +3294,9 @@
 #define  TRANS_FSYNC_DELAY_HB4  (3<<27)
 #define  TRANS_DP_AUDIO_ONLY    (1<<26)
 #define  TRANS_DP_VIDEO_AUDIO   (0<<26)
+#define  TRANS_INTERLACE_MASK   (7<<21)
 #define  TRANS_PROGRESSIVE      (0<<21)
+#define  TRANS_INTERLACED       (3<<21)
 #define  TRANS_8BPC             (0<<5)
 #define  TRANS_10BPC            (1<<5)
 #define  TRANS_6BPC             (2<<5)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e842961..9d43866 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1262,7 +1262,7 @@ static void intel_enable_transcoder(struct drm_i915_private *dev_priv,
 				    enum pipe pipe)
 {
 	int reg;
-	u32 val;
+	u32 val, pipeconf_val;
 
 	/* PCH only available on ILK+ */
 	BUG_ON(dev_priv->info->gen < 5);
@@ -1276,6 +1276,7 @@ static void intel_enable_transcoder(struct drm_i915_private *dev_priv,
 
 	reg = TRANSCONF(pipe);
 	val = I915_READ(reg);
+	pipeconf_val = I915_READ(PIPECONF(pipe));
 
 	if (HAS_PCH_IBX(dev_priv->dev)) {
 		/*
@@ -1283,8 +1284,15 @@ static void intel_enable_transcoder(struct drm_i915_private *dev_priv,
 		 * that in pipeconf reg.
 		 */
 		val &= ~PIPE_BPC_MASK;
-		val |= I915_READ(PIPECONF(pipe)) & PIPE_BPC_MASK;
+		val |= pipeconf_val & PIPE_BPC_MASK;
 	}
+
+	val &= ~TRANS_INTERLACE_MASK;
+	if ((pipeconf_val & PIPECONF_INTERLACE_MASK) == PIPECONF_INTERLACED_ILK)
+		val |= TRANS_INTERLACED;
+	else
+		val |= TRANS_PROGRESSIVE;
+
 	I915_WRITE(reg, val | TRANS_ENABLE);
 	if (wait_for(I915_READ(reg) & TRANS_STATE_ENABLE, 100))
 		DRM_ERROR("failed to enable transcoder %d\n", pipe);
-- 
1.7.8.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] drm/i915: set interlaced bits for TRANSCONF
  2012-02-03 19:47 [PATCH 1/2] drm/i915: set interlaced bits for TRANSCONF Paulo Zanoni
@ 2012-02-08 22:53 ` Jesse Barnes
  2012-02-08 22:59   ` Daniel Vetter
  2012-02-10 16:45   ` Daniel Vetter
  2012-02-08 22:58 ` Jesse Barnes
  1 sibling, 2 replies; 5+ messages in thread
From: Jesse Barnes @ 2012-02-08 22:53 UTC (permalink / raw)
  To: Paulo Zanoni; +Cc: intel-gfx, Paulo Zanoni


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

On Fri,  3 Feb 2012 17:47:15 -0200
Paulo Zanoni <przanoni@gmail.com> wrote:

> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> 
> I'm not sure why they are needed (I didn't notice any difference in my
> tests), but these bits are in our documentation and they are also set by
> the Windows driver.
> 
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> ---

Do we pretend to support interlaced on SDVO?  If so, there's a bit for
that too, but only on IBX, not PPT or CPT.

Other than that,
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>

-- 
Jesse Barnes, Intel Open Source Technology Center

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] drm/i915: set interlaced bits for TRANSCONF
  2012-02-03 19:47 [PATCH 1/2] drm/i915: set interlaced bits for TRANSCONF Paulo Zanoni
  2012-02-08 22:53 ` Jesse Barnes
@ 2012-02-08 22:58 ` Jesse Barnes
  1 sibling, 0 replies; 5+ messages in thread
From: Jesse Barnes @ 2012-02-08 22:58 UTC (permalink / raw)
  To: Paulo Zanoni; +Cc: intel-gfx, Paulo Zanoni


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

On Fri,  3 Feb 2012 17:47:15 -0200
Paulo Zanoni <przanoni@gmail.com> wrote:

> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> 
> I'm not sure why they are needed (I didn't notice any difference in my
> tests), but these bits are in our documentation and they are also set by
> the Windows driver.
> 
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> ---

This makes me think we should really just split the PCH related stuff
into separate functions and headers with their own register and bit
definitions.  Duplicate code is better than fragility and having to
scour through multiple docs when shared code is modified.

But obviously that's a much bigger cleanup that can come after this
patch.

Ideally, anytime we had a register block with any different offsets or
bits than a previous generation, we'd fork it into its own reg
definition header and add function hooks for it.

-- 
Jesse Barnes, Intel Open Source Technology Center

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] drm/i915: set interlaced bits for TRANSCONF
  2012-02-08 22:53 ` Jesse Barnes
@ 2012-02-08 22:59   ` Daniel Vetter
  2012-02-10 16:45   ` Daniel Vetter
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2012-02-08 22:59 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: intel-gfx, Paulo Zanoni

On Wed, Feb 08, 2012 at 02:53:32PM -0800, Jesse Barnes wrote:
> On Fri,  3 Feb 2012 17:47:15 -0200
> Paulo Zanoni <przanoni@gmail.com> wrote:
> 
> > From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > 
> > I'm not sure why they are needed (I didn't notice any difference in my
> > tests), but these bits are in our documentation and they are also set by
> > the Windows driver.
> > 
> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > ---
> 
> Do we pretend to support interlaced on SDVO?  If so, there's a bit for
> that too, but only on IBX, not PPT or CPT.

Indeed, we do pretend. Paulo, can you whip together the follow up patch to
fix that magical sdvo interlaced bit on ilk?
-Daniel
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] drm/i915: set interlaced bits for TRANSCONF
  2012-02-08 22:53 ` Jesse Barnes
  2012-02-08 22:59   ` Daniel Vetter
@ 2012-02-10 16:45   ` Daniel Vetter
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2012-02-10 16:45 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: intel-gfx, Paulo Zanoni

On Wed, Feb 08, 2012 at 02:53:32PM -0800, Jesse Barnes wrote:
> On Fri,  3 Feb 2012 17:47:15 -0200
> Paulo Zanoni <przanoni@gmail.com> wrote:
> 
> > From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > 
> > I'm not sure why they are needed (I didn't notice any difference in my
> > tests), but these bits are in our documentation and they are also set by
> > the Windows driver.
> > 
> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > ---
> 
> Do we pretend to support interlaced on SDVO?  If so, there's a bit for
> that too, but only on IBX, not PPT or CPT.
> 
> Other than that,
> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>

Queued for -next, thanks for the patch and review.
-Daniel
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-02-10 16:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-03 19:47 [PATCH 1/2] drm/i915: set interlaced bits for TRANSCONF Paulo Zanoni
2012-02-08 22:53 ` Jesse Barnes
2012-02-08 22:59   ` Daniel Vetter
2012-02-10 16:45   ` Daniel Vetter
2012-02-08 22:58 ` Jesse Barnes

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.