Skip to contentSkip to conversation

drm/i915: fix lvds/dp panel fitter setting

PATCH Applied Imre Deak 3 participants 4 messages Aug 27, 2013 – Aug 28, 2013

Subsystems (2)
lore
Share & tools
lore

Imre Deak

author
#0 lore raw

PATCH 1/1 drm/i915: fix lvds/dp panel fitter setting

If need to enable the panel fitter, the crtc timings have to be programmed according to the panel's native (fixed) mode. This isn't the case atm, since after the encoder changes adjusted_mode to fixed mode the crtc_* timing fields of adjusted_mode will stay at their original non-native values that the user passed in. This results in a corrupted output.

One exception is when we have a second pass of computing encoder configs due to bandwidth limitation, since then we'll set adjusted_mode.crtc_* fields to the fixed mode values set in the first pass; so in this case things will work out.

Fix this by updating the adjusted_mode.crtc_* fields when we set the fixed panel mode.

---
 drivers/gpu/drm/i915/intel_panel.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_panel.c +2 -0
index a43c33b..913cb9d 100644
@@ -50,6 +50,8 @@ intel_fixed_panel_mode(struct drm_display_mode *fixed_mode,
 	adjusted_mode->vtotal = fixed_mode->vtotal;
 
 	adjusted_mode->clock = fixed_mode->clock;
+
+	drm_mode_set_crtcinfo(adjusted_mode, 0);
 }
 
 /* adjusted_mode has been preset to be the panel's fixed mode */
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 12 lines · Imre Deak

If need to enable the panel fitter, the crtc timings have to be programmed according to the panel's native (fixed) mode. This isn't the case atm, since after the encoder changes adjusted_mode to fixed mode the crtc_* timing fields of adjusted_mode will stay at their original non-native values that the user passed in. This results in a corrupted output.

One exception is when we have a second pass of computing encoder configs due to bandwidth limitation, since then we'll set adjusted_mode.crtc_* fields to the fixed mode values set in the first pass; so in this case things will work out.

Quoted 4 lines

Fix this by updating the adjusted_mode.crtc_* fields when we set the fixed panel mode.

This regression has been introduced in

commit 21d8a4756af5fdf4a42e79a77cf3b6f52678d443

Author: Daniel Vetter <[email protected]>
Date:   Fri Jul 12 08:07:30 2013 +0200

drm/i915: fix pfit regression for non-autoscaled resolutions

Quoted 24 lines
---
 drivers/gpu/drm/i915/intel_panel.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_panel.c +2 -0
index a43c33b..913cb9d 100644
@@ -50,6 +50,8 @@ intel_fixed_panel_mode(struct drm_display_mode *fixed_mode,
 	adjusted_mode->vtotal = fixed_mode->vtotal;
 
 	adjusted_mode->clock = fixed_mode->clock;
+
+	drm_mode_set_crtcinfo(adjusted_mode, 0);
 }
 
 /* adjusted_mode has been preset to be the panel's fixed mode */
Signature · 6 lines
1.8.3.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
Reviewed-by on v1 1/1
#2 lore raw
In reply to Imre Deak
Quoted 12 lines · Imre Deak

If need to enable the panel fitter, the crtc timings have to be programmed according to the panel's native (fixed) mode. This isn't the case atm, since after the encoder changes adjusted_mode to fixed mode the crtc_* timing fields of adjusted_mode will stay at their original non-native values that the user passed in. This results in a corrupted output.

One exception is when we have a second pass of computing encoder configs due to bandwidth limitation, since then we'll set adjusted_mode.crtc_* fields to the fixed mode values set in the first pass; so in this case things will work out.

Quoted 4 lines

Fix this by updating the adjusted_mode.crtc_* fields when we set the fixed panel mode.

Daniel, the commit that regressed seem to be 135c81b8c3c9a70d7b55758c9c2a247a4abb7b64 instead of 21d8a4756af5fdf4a42e79a77cf3b6f52678d443.

Quoted 24 lines
---
 drivers/gpu/drm/i915/intel_panel.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_panel.c +2 -0
index a43c33b..913cb9d 100644
@@ -50,6 +50,8 @@ intel_fixed_panel_mode(struct drm_display_mode *fixed_mode,
 	adjusted_mode->vtotal = fixed_mode->vtotal;
 
 	adjusted_mode->clock = fixed_mode->clock;
+
+	drm_mode_set_crtcinfo(adjusted_mode, 0);
 }
 
 /* adjusted_mode has been preset to be the panel's fixed mode */
Signature · 6 lines
1.8.3.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
Quoted 17 lines · Mika Kuoppala
Quoted 15 lines · Imre Deak

If need to enable the panel fitter, the crtc timings have to be programmed according to the panel's native (fixed) mode. This isn't the case atm, since after the encoder changes adjusted_mode to fixed mode the crtc_* timing fields of adjusted_mode will stay at their original non-native values that the user passed in. This results in a corrupted output.

One exception is when we have a second pass of computing encoder configs due to bandwidth limitation, since then we'll set adjusted_mode.crtc_* fields to the fixed mode values set in the first pass; so in this case things will work out.

Fix this by updating the adjusted_mode.crtc_* fields when we set the fixed panel mode.

Quoted 7 lines
Quoted 1 line

Daniel, the commit that regressed seem to be 135c81b8c3c9a70d7b55758c9c2a247a4abb7b64 instead of 21d8a4756af5fdf4a42e79a77cf3b6f52678d443.

Queued for -next, thanks for the patch.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch