Re: [Intel-gfx] [PATCH] drm/i915: Add i915.dp_limit_max_lane_count driver option.

2013-04-02 Thread Michal Srb
On Tuesday 26 of March 2013 16:49:30 Daniel Vetter wrote:
 On Tue, Mar 26, 2013 at 4:40 PM, Michal Srb m...@suse.com wrote:
  I have IBM POS machine (4852-570 Truman) that has internal monitor
  connected over display port. It reports to have 2 lanes, but only 1
  lane works reliably. With 2 lanes used, the monitor sometimes doesn't
  turn on. It seems that this is hardware issue specific for this model.
  
  From discussion that was around the
  2514bc510d0c3aadcc5204056bb440fa36845147 commit I understand there are
  more machines that have similar problems. This option can be used to
  solve them.
 
 It sounds like we need to start with a DPCD quirk database ... Ajax?
 -Daniel

Any update?
DPCD of this monitor is 10 0a 82 40 00 00 01 00 02 00 00 00 10 01 00 by the 
way.

Is the i915.dp_limit_max_lane_count unacceptable even as temporary workaround?

Michal Srb

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH] drm/i915: Add i915.dp_limit_max_lane_count driver option.

2013-03-26 Thread Michal Srb
Since 2514bc510d0c3aadcc5204056bb440fa36845147, the intel_dp_mode_fixup
function prefers lane count over frequency. That causes problems on
hardware that has less working lanes than it reports. This option allows
to workaround such hardware bugs.

Signed-off-by: Michal Srb m...@suse.com
---
This is workaround for hardware issues uncovered by this commit:

  commit 2514bc510d0c3aadcc5204056bb440fa36845147
  Author: Jesse Barnes jbar...@virtuousgeek.org
  Date:   Thu Jun 21 15:13:50 2012 -0700

  drm/i915: prefer wide  slow to fast  narrow in DP configs

  High frequency link configurations have the potential to cause trouble
  with long and/or cheap cables, so prefer slow and wide configurations
  instead.  This patch has the potential to cause trouble for eDP
  configurations that lie about available lanes, so if we run into that we
  can make it conditional on eDP.

I have IBM POS machine (4852-570 Truman) that has internal monitor
connected over display port. It reports to have 2 lanes, but only 1
lane works reliably. With 2 lanes used, the monitor sometimes doesn't
turn on. It seems that this is hardware issue specific for this model.

From discussion that was around the 2514bc510d0c3aadcc5204056bb440fa36845147
commit I understand there are more machines that have similar problems.
This option can be used to solve them.
---

 drivers/gpu/drm/i915/i915_drv.c |6 ++
 drivers/gpu/drm/i915/i915_drv.h |1 +
 drivers/gpu/drm/i915/intel_dp.c |   15 +--
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 6c4b13c..5949d7c 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -123,6 +123,12 @@ module_param_named(preliminary_hw_support, 
i915_preliminary_hw_support, int, 060
 MODULE_PARM_DESC(preliminary_hw_support,
Enable preliminary hardware support. (default: false));
 
+int i915_dp_limit_max_lane_count __read_mostly = -1;
+module_param_named(dp_limit_max_lane_count, i915_dp_limit_max_lane_count, 
int, 0600);
+MODULE_PARM_DESC(dp_limit_max_lane_count,
+   Limit the maximal number of used display port lanes. 
+   (default: -1 (no limit)));
+
 static struct drm_driver driver;
 extern int intel_agp_enabled;
 
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 1657d873..646e400 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1398,6 +1398,7 @@ extern int i915_enable_fbc __read_mostly;
 extern bool i915_enable_hangcheck __read_mostly;
 extern int i915_enable_ppgtt __read_mostly;
 extern unsigned int i915_preliminary_hw_support __read_mostly;
+extern int i915_dp_limit_max_lane_count __read_mostly;
 
 extern int i915_suspend(struct drm_device *dev, pm_message_t state);
 extern int i915_resume(struct drm_device *dev);
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 662a185..3812773 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -132,6 +132,17 @@ intel_edp_target_clock(struct intel_encoder 
*intel_encoder,
return mode-clock;
 }
 
+static inline u8
+intel_dp_max_lane_count(u8 dpcd[DP_RECEIVER_CAP_SIZE])
+{
+   u8 max_lane_count = drm_dp_max_lane_count(dpcd);
+
+   if(i915_dp_limit_max_lane_count != -1  max_lane_count  
i915_dp_limit_max_lane_count)
+   max_lane_count = i915_dp_limit_max_lane_count;
+
+   return max_lane_count;
+}
+
 static int
 intel_dp_max_link_bw(struct intel_dp *intel_dp)
 {
@@ -184,7 +195,7 @@ intel_dp_adjust_dithering(struct intel_dp *intel_dp,
 {
int max_link_clock =
drm_dp_bw_code_to_link_rate(intel_dp_max_link_bw(intel_dp));
-   int max_lanes = drm_dp_max_lane_count(intel_dp-dpcd);
+   int max_lanes = intel_dp_max_lane_count(intel_dp-dpcd);
int max_rate, mode_rate;
 
mode_rate = intel_dp_link_required(mode-clock, 24);
@@ -697,7 +708,7 @@ intel_dp_mode_fixup(struct drm_encoder *encoder,
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
struct intel_connector *intel_connector = intel_dp-attached_connector;
int lane_count, clock;
-   int max_lane_count = drm_dp_max_lane_count(intel_dp-dpcd);
+   int max_lane_count = intel_dp_max_lane_count(intel_dp-dpcd);
int max_clock = intel_dp_max_link_bw(intel_dp) == DP_LINK_BW_2_7 ? 1 : 
0;
int bpp, mode_rate;
static int bws[2] = { DP_LINK_BW_1_62, DP_LINK_BW_2_7 };
-- 
1.7.7


___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] Issue after drm/i915: prefer wide slow to fast narrow in DP configs.

2013-03-20 Thread Michal Srb
Hi,

I am debugging an issue with IBM POS machine (4852-570, Truman), with 
8086:0102 Intel Sandybridge graphic card and internal monitor connected over 
display port.

The issue is that sporadically, after mode change, the monitor remains blank.
There is no difference in drm.debug=0xe level log or content of debugfs/dri 
between the state when monitor displays image and the state when it remains 
blank.

(The monitor supports only 1024x768, so every mode change is into this 
resolution. It happens when the intel driver switches resolution during boot, 
when X starts, X ends, modetest starts or modetest ends.)

I've bisected the cause to this commit:

  commit 2514bc510d0c3aadcc5204056bb440fa36845147
  Author: Jesse Barnes jbar...@virtuousgeek.org
  Date:   Thu Jun 21 15:13:50 2012 -0700

  drm/i915: prefer wide  slow to fast  narrow in DP configs

  High frequency link configurations have the potential to cause trouble
  with long and/or cheap cables, so prefer slow and wide configurations
  instead.  This patch has the potential to cause trouble for eDP
  configurations that lie about available lanes, so if we run into that we
  can make it conditional on eDP.


The machine reports to have 2 lanes available and that seems to be correct.
One lane was used before the commit and the screen used to show picture after 
every mode change:

  [drm:intel_dp_mode_fixup], DP ink computation with max lane count 2 max bw 
0a pixel clock 65000KHz
  [drm:intel_dp_mode_fixup], DP link bw 0a lane count 1 clock 27 bpp 24
  [drm:intel_dp_mode_fixup], DP link bw required 156000 available 216000

Two lanes are used after the commit and the screen occasionally remains blank 
after mode change:

  [drm:intel_dp_mode_fixup], DP link computation with max lane count 2 max bw 
0a pixel clock 65000KHz
  [drm:intel_dp_mode_fixup], DP link bw 06 lane count 2 clock 162000 bpp 24
  [drm:intel_dp_mode_fixup], DP link bw required 156000 available 259200


Could you advise me where to look further? Could this be a hardware bug? 
Reverting the commit works as a workaround, but doesn't look like correct way 
to fix this...

Thank you,
Michal Srb

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx