public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Don't assume 60Hz when accounting for DSI pixel overlap
@ 2016-12-13 21:09 ville.syrjala
  2016-12-13 21:09 ` [PATCH 2/2] drm/i915: Dump the pclk and burst_mode_ratio for DSI ville.syrjala
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: ville.syrjala @ 2016-12-13 21:09 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Compute the increase in the DSI clock due to pixel overlap mode in
a way that's refresh rate agnostic. So far the computation assumed
a 60Hz refresh rate. And let's switch to round to closest here as
well since we would like to be as close to the target as possible.

Also toss in a decent comment explaining what we're actually doing
here.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
index 8f683b8b1816..3fd3bac5fccc 100644
--- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
+++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
@@ -603,13 +603,20 @@ struct drm_panel *vbt_panel_init(struct intel_dsi *intel_dsi, u16 panel_id)
 	if (intel_dsi->dual_link) {
 		pclk = pclk / 2;
 
-		/* we can enable pixel_overlap if needed by panel. In this
-		 * case we need to increase the pixelclock for extra pixels
+		/*
+		 * In front-back mode the display is split vertically
+		 * and the first half of pixels are transmitted by the
+		 * first port, the second half by the second port. An
+		 * overlapping strip of pixels is transmitted by both
+		 * ports. The way this is specified is the number of
+		 * pixels each half is extended horizontally (ie,
+		 * pixel_overlap==1 actually means an overlap of two
+		 * pixels). Thus we do this after the division by 2,
+		 * otherwise we'd have to multiply the extra by two.
 		 */
 		if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) {
-			pclk += DIV_ROUND_UP(mode->vtotal *
-						intel_dsi->pixel_overlap *
-						60, 1000);
+			pclk += DIV_ROUND_CLOSEST(intel_dsi->pixel_overlap *
+						  mode->clock, mode->htotal);
 		}
 	}
 
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2017-02-14 20:34 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-13 21:09 [PATCH 1/2] drm/i915: Don't assume 60Hz when accounting for DSI pixel overlap ville.syrjala
2016-12-13 21:09 ` [PATCH 2/2] drm/i915: Dump the pclk and burst_mode_ratio for DSI ville.syrjala
2016-12-14 16:24   ` Chris Wilson
2016-12-14 16:43     ` Ville Syrjälä
2016-12-14 17:14   ` [PATCH 2/2] drm/i915: Dump more configuration information " ville.syrjala
2016-12-16 17:37     ` Chris Wilson
2016-12-21 14:31   ` [PATCH v3 " ville.syrjala
2017-02-14 20:33     ` Ville Syrjälä
2016-12-13 23:45 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Don't assume 60Hz when accounting for DSI pixel overlap Patchwork
2016-12-14 16:22 ` [PATCH 1/2] " Chris Wilson
2016-12-14 16:42   ` Ville Syrjälä
2016-12-14 17:45 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Don't assume 60Hz when accounting for DSI pixel overlap (rev2) Patchwork
2016-12-21 15:22 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915: Don't assume 60Hz when accounting for DSI pixel overlap (rev3) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox