* [PATCH 1/3] drm/i915: No panel fitter on 830M or non-mobile gen2/3 platforms
2014-01-10 12:06 [PATCH 0/3] drm/i915: A few small fixes for older platforms ville.syrjala
@ 2014-01-10 12:06 ` ville.syrjala
2014-01-10 17:02 ` Daniel Vetter
2014-01-10 12:06 ` [PATCH 2/3] drm/i915: 830M doesn't have an LVDS port ville.syrjala
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: ville.syrjala @ 2014-01-10 12:06 UTC (permalink / raw)
To: intel-gfx
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
PFIT_CONTROL doesn't exist on 830M, so avoid reading it in
i9xx_get_pfit_config().
Also assume that only mobile gen2/3 chipsets have a panel fitter. This
matches the documentation, but I didn't have real hardware to verify.
Gen4 docmentation is a bit inconsistent, but experimenetation on my
LPT machine suggests that the panel fitter is available on non-mobile
gen4 platforms. At least on this machine panel fitter appears works
just fine even on VGA output.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 3 +++
drivers/gpu/drm/i915/intel_overlay.c | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a51e105..9f8c5b5 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -5428,6 +5428,9 @@ static void i9xx_get_pfit_config(struct intel_crtc *crtc,
struct drm_i915_private *dev_priv = dev->dev_private;
uint32_t tmp;
+ if (INTEL_INFO(dev)->gen <= 3 && (IS_I830(dev) || !IS_MOBILE(dev)))
+ return;
+
tmp = I915_READ(PFIT_CONTROL);
if (!(tmp & PFIT_ENABLE))
return;
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
index a1397b1..424f094 100644
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -1005,7 +1005,7 @@ static int intel_panel_fitter_pipe(struct drm_device *dev)
u32 pfit_control;
/* i830 doesn't have a panel fitter */
- if (IS_I830(dev))
+ if (INTEL_INFO(dev)->gen <= 3 && (IS_I830(dev) || !IS_MOBILE(dev)))
return -1;
pfit_control = I915_READ(PFIT_CONTROL);
--
1.8.3.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 1/3] drm/i915: No panel fitter on 830M or non-mobile gen2/3 platforms
2014-01-10 12:06 ` [PATCH 1/3] drm/i915: No panel fitter on 830M or non-mobile gen2/3 platforms ville.syrjala
@ 2014-01-10 17:02 ` Daniel Vetter
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Vetter @ 2014-01-10 17:02 UTC (permalink / raw)
To: ville.syrjala; +Cc: intel-gfx
On Fri, Jan 10, 2014 at 02:06:45PM +0200, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> PFIT_CONTROL doesn't exist on 830M, so avoid reading it in
> i9xx_get_pfit_config().
>
> Also assume that only mobile gen2/3 chipsets have a panel fitter. This
> matches the documentation, but I didn't have real hardware to verify.
>
> Gen4 docmentation is a bit inconsistent, but experimenetation on my
> LPT machine suggests that the panel fitter is available on non-mobile
> gen4 platforms. At least on this machine panel fitter appears works
> just fine even on VGA output.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 3 +++
> drivers/gpu/drm/i915/intel_overlay.c | 2 +-
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index a51e105..9f8c5b5 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -5428,6 +5428,9 @@ static void i9xx_get_pfit_config(struct intel_crtc *crtc,
> struct drm_i915_private *dev_priv = dev->dev_private;
> uint32_t tmp;
>
> + if (INTEL_INFO(dev)->gen <= 3 && (IS_I830(dev) || !IS_MOBILE(dev)))
> + return;
> +
> tmp = I915_READ(PFIT_CONTROL);
> if (!(tmp & PFIT_ENABLE))
> return;
> diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
> index a1397b1..424f094 100644
> --- a/drivers/gpu/drm/i915/intel_overlay.c
> +++ b/drivers/gpu/drm/i915/intel_overlay.c
> @@ -1005,7 +1005,7 @@ static int intel_panel_fitter_pipe(struct drm_device *dev)
> u32 pfit_control;
>
> /* i830 doesn't have a panel fitter */
> - if (IS_I830(dev))
> + if (INTEL_INFO(dev)->gen <= 3 && (IS_I830(dev) || !IS_MOBILE(dev)))
Hm, we could switch that code to the pipe config. Like we've already done
for the double-wide stuff. Like we've done for the double-wide checks
already ...
-Daniel
> return -1;
>
> pfit_control = I915_READ(PFIT_CONTROL);
> --
> 1.8.3.2
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/3] drm/i915: 830M doesn't have an LVDS port
2014-01-10 12:06 [PATCH 0/3] drm/i915: A few small fixes for older platforms ville.syrjala
2014-01-10 12:06 ` [PATCH 1/3] drm/i915: No panel fitter on 830M or non-mobile gen2/3 platforms ville.syrjala
@ 2014-01-10 12:06 ` ville.syrjala
2014-01-10 12:06 ` [PATCH 3/3] drm/i915: Fix 915GM self-refresh enable/disable ville.syrjala
2014-01-10 14:23 ` [PATCH 0/3] drm/i915: A few small fixes for older platforms Chris Wilson
3 siblings, 0 replies; 6+ messages in thread
From: ville.syrjala @ 2014-01-10 12:06 UTC (permalink / raw)
To: intel-gfx
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
There's no LVDS port on 830M so don't go reading the LVDS control
register.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 9f8c5b5..e29d24f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7963,7 +7963,7 @@ static void i9xx_crtc_clock_get(struct intel_crtc *crtc,
else
i9xx_clock(refclk, &clock);
} else {
- u32 lvds = I915_READ(LVDS);
+ u32 lvds = IS_I830(dev) ? 0 : I915_READ(LVDS);
bool is_lvds = (pipe == 1) && (lvds & LVDS_PORT_EN);
if (is_lvds) {
--
1.8.3.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 3/3] drm/i915: Fix 915GM self-refresh enable/disable
2014-01-10 12:06 [PATCH 0/3] drm/i915: A few small fixes for older platforms ville.syrjala
2014-01-10 12:06 ` [PATCH 1/3] drm/i915: No panel fitter on 830M or non-mobile gen2/3 platforms ville.syrjala
2014-01-10 12:06 ` [PATCH 2/3] drm/i915: 830M doesn't have an LVDS port ville.syrjala
@ 2014-01-10 12:06 ` ville.syrjala
2014-01-10 14:23 ` [PATCH 0/3] drm/i915: A few small fixes for older platforms Chris Wilson
3 siblings, 0 replies; 6+ messages in thread
From: ville.syrjala @ 2014-01-10 12:06 UTC (permalink / raw)
To: intel-gfx
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
INSTPM is a masked register so use the _MASKED_BIT_{ENABLE,DISABLE}
macros when enabling/disabling self-refresh on 915GM.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/intel_pm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 99d6550..c4e5e24 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -1563,7 +1563,7 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc)
if (IS_I945G(dev) || IS_I945GM(dev))
I915_WRITE(FW_BLC_SELF, FW_BLC_SELF_EN_MASK | 0);
else if (IS_I915GM(dev))
- I915_WRITE(INSTPM, I915_READ(INSTPM) & ~INSTPM_SELF_EN);
+ I915_WRITE(INSTPM, _MASKED_BIT_DISABLE(INSTPM_SELF_EN));
/* Calc sr entries for one plane configs */
if (HAS_FW_BLC(dev) && enabled) {
@@ -1615,7 +1615,7 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc)
I915_WRITE(FW_BLC_SELF,
FW_BLC_SELF_EN_MASK | FW_BLC_SELF_EN);
else if (IS_I915GM(dev))
- I915_WRITE(INSTPM, I915_READ(INSTPM) | INSTPM_SELF_EN);
+ I915_WRITE(INSTPM, _MASKED_BIT_ENABLE(INSTPM_SELF_EN));
DRM_DEBUG_KMS("memory self refresh enabled\n");
} else
DRM_DEBUG_KMS("memory self refresh disabled\n");
--
1.8.3.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 0/3] drm/i915: A few small fixes for older platforms
2014-01-10 12:06 [PATCH 0/3] drm/i915: A few small fixes for older platforms ville.syrjala
` (2 preceding siblings ...)
2014-01-10 12:06 ` [PATCH 3/3] drm/i915: Fix 915GM self-refresh enable/disable ville.syrjala
@ 2014-01-10 14:23 ` Chris Wilson
3 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2014-01-10 14:23 UTC (permalink / raw)
To: ville.syrjala; +Cc: intel-gfx
On Fri, Jan 10, 2014 at 02:06:44PM +0200, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> I spotted a few small issues while reading the code w/ older platforms
> in mind. The panel fitter/LVDS port patches probably have no real impact
> since it looks like those non-existing registers always return 0. But
> might as well avoid reading them.
>
> The 915GM SR fix is untested as I have no such hardware, but if the docs
> are correct it should affect something.
They all look self-consistent.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 6+ messages in thread