aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_dsi.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-14 03:39:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-14 03:39:08 -0400
commit2d65a9f48fcdf7866aab6457bc707ca233e0c791 (patch)
treef93e5838d6ac2e59434367f4ff905f7d9c45fc2b /drivers/gpu/drm/i915/intel_dsi.c
parentda92da3638a04894afdca8b99e973ddd20268471 (diff)
parentdfda0df3426483cf5fc7441f23f318edbabecb03 (diff)
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Pull drm updates from Dave Airlie: "This is the main git pull for the drm, I pretty much froze major pulls at -rc5/6 time, and haven't had much fallout, so will probably continue doing that. Lots of changes all over, big internal header cleanup to make it clear drm features are legacy things and what are things that modern KMS drivers should be using. Also big move to use the new generic fences in all the TTM drivers. core: atomic prep work, vblank rework changes, allows immediate vblank disables major header reworking and cleanups to better delinate legacy interfaces from what KMS drivers should be using. cursor planes locking fixes ttm: move to generic fences (affects all TTM drivers) ppc64 caching fixes radeon: userptr support, uvd for old asics, reset rework for fence changes better buffer placement changes, dpm feature enablement hdmi audio support fixes intel: Cherryview work, 180 degree rotation, skylake prep work, execlist command submission full ppgtt prep work cursor improvements edid caching, vdd handling improvements nouveau: fence reworking kepler memory clock work gt21x clock work fan control improvements hdmi infoframe fixes DP audio ast: ppc64 fixes caching fix rcar: rcar-du DT support ipuv3: prep work for capture support msm: LVDS support for mdp4, new panel, gpu refactoring exynos: exynos3250 SoC support, drop bad mmap interface, mipi dsi changes, and component match support" * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (640 commits) drm/mst: rework payload table allocation to conform better. drm/ast: Fix HW cursor image drm/radeon/kv: add uvd/vce info to dpm debugfs output drm/radeon/ci: add uvd/vce info to dpm debugfs output drm/radeon: export reservation_object from dmabuf to ttm drm/radeon: cope with foreign fences inside the reservation object drm/radeon: cope with foreign fences inside display drm/core: use helper to check driver features drm/radeon/cik: write gfx ucode version to ucode addr reg drm/radeon/si: print full CS when we hit a packet 0 drm/radeon: remove unecessary includes drm/radeon/combios: declare legacy_connector_convert as static drm/radeon/atombios: declare connector convert tables as static drm/radeon: drop btc_get_max_clock_from_voltage_dependency_table drm/radeon/dpm: drop clk/voltage dependency filters for BTC drm/radeon/dpm: drop clk/voltage dependency filters for CI drm/radeon/dpm: drop clk/voltage dependency filters for SI drm/radeon/dpm: drop clk/voltage dependency filters for NI drm/radeon: disable audio when we disable hdmi (v2) drm/radeon: split audio enable between eg and r600 (v2) ...
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dsi.c')
-rw-r--r--drivers/gpu/drm/i915/intel_dsi.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index 670c29a7b5dd..5bd9e09ad3c5 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -184,7 +184,7 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder)
184 184
185 /* update the hw state for DPLL */ 185 /* update the hw state for DPLL */
186 intel_crtc->config.dpll_hw_state.dpll = DPLL_INTEGRATED_CLOCK_VLV | 186 intel_crtc->config.dpll_hw_state.dpll = DPLL_INTEGRATED_CLOCK_VLV |
187 DPLL_REFA_CLK_ENABLE_VLV; 187 DPLL_REFA_CLK_ENABLE_VLV;
188 188
189 tmp = I915_READ(DSPCLK_GATE_D); 189 tmp = I915_READ(DSPCLK_GATE_D);
190 tmp |= DPOUNIT_CLOCK_GATE_DISABLE; 190 tmp |= DPOUNIT_CLOCK_GATE_DISABLE;
@@ -259,8 +259,8 @@ static void intel_dsi_disable(struct intel_encoder *encoder)
259 temp = I915_READ(MIPI_CTRL(pipe)); 259 temp = I915_READ(MIPI_CTRL(pipe));
260 temp &= ~ESCAPE_CLOCK_DIVIDER_MASK; 260 temp &= ~ESCAPE_CLOCK_DIVIDER_MASK;
261 I915_WRITE(MIPI_CTRL(pipe), temp | 261 I915_WRITE(MIPI_CTRL(pipe), temp |
262 intel_dsi->escape_clk_div << 262 intel_dsi->escape_clk_div <<
263 ESCAPE_CLOCK_DIVIDER_SHIFT); 263 ESCAPE_CLOCK_DIVIDER_SHIFT);
264 264
265 I915_WRITE(MIPI_EOT_DISABLE(pipe), CLOCKSTOP); 265 I915_WRITE(MIPI_EOT_DISABLE(pipe), CLOCKSTOP);
266 266
@@ -297,7 +297,7 @@ static void intel_dsi_clear_device_ready(struct intel_encoder *encoder)
297 usleep_range(2000, 2500); 297 usleep_range(2000, 2500);
298 298
299 if (wait_for(((I915_READ(MIPI_PORT_CTRL(pipe)) & AFE_LATCHOUT) 299 if (wait_for(((I915_READ(MIPI_PORT_CTRL(pipe)) & AFE_LATCHOUT)
300 == 0x00000), 30)) 300 == 0x00000), 30))
301 DRM_ERROR("DSI LP not going Low\n"); 301 DRM_ERROR("DSI LP not going Low\n");
302 302
303 val = I915_READ(MIPI_PORT_CTRL(pipe)); 303 val = I915_READ(MIPI_PORT_CTRL(pipe));
@@ -423,9 +423,11 @@ static u16 txclkesc(u32 divider, unsigned int us)
423} 423}
424 424
425/* return pixels in terms of txbyteclkhs */ 425/* return pixels in terms of txbyteclkhs */
426static u16 txbyteclkhs(u16 pixels, int bpp, int lane_count) 426static u16 txbyteclkhs(u16 pixels, int bpp, int lane_count,
427 u16 burst_mode_ratio)
427{ 428{
428 return DIV_ROUND_UP(DIV_ROUND_UP(pixels * bpp, 8), lane_count); 429 return DIV_ROUND_UP(DIV_ROUND_UP(pixels * bpp * burst_mode_ratio,
430 8 * 100), lane_count);
429} 431}
430 432
431static void set_dsi_timings(struct drm_encoder *encoder, 433static void set_dsi_timings(struct drm_encoder *encoder,
@@ -451,10 +453,12 @@ static void set_dsi_timings(struct drm_encoder *encoder,
451 vbp = mode->vtotal - mode->vsync_end; 453 vbp = mode->vtotal - mode->vsync_end;
452 454
453 /* horizontal values are in terms of high speed byte clock */ 455 /* horizontal values are in terms of high speed byte clock */
454 hactive = txbyteclkhs(hactive, bpp, lane_count); 456 hactive = txbyteclkhs(hactive, bpp, lane_count,
455 hfp = txbyteclkhs(hfp, bpp, lane_count); 457 intel_dsi->burst_mode_ratio);
456 hsync = txbyteclkhs(hsync, bpp, lane_count); 458 hfp = txbyteclkhs(hfp, bpp, lane_count, intel_dsi->burst_mode_ratio);
457 hbp = txbyteclkhs(hbp, bpp, lane_count); 459 hsync = txbyteclkhs(hsync, bpp, lane_count,
460 intel_dsi->burst_mode_ratio);
461 hbp = txbyteclkhs(hbp, bpp, lane_count, intel_dsi->burst_mode_ratio);
458 462
459 I915_WRITE(MIPI_HACTIVE_AREA_COUNT(pipe), hactive); 463 I915_WRITE(MIPI_HACTIVE_AREA_COUNT(pipe), hactive);
460 I915_WRITE(MIPI_HFP_COUNT(pipe), hfp); 464 I915_WRITE(MIPI_HFP_COUNT(pipe), hfp);
@@ -541,12 +545,14 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder)
541 intel_dsi->video_mode_format == VIDEO_MODE_BURST) { 545 intel_dsi->video_mode_format == VIDEO_MODE_BURST) {
542 I915_WRITE(MIPI_HS_TX_TIMEOUT(pipe), 546 I915_WRITE(MIPI_HS_TX_TIMEOUT(pipe),
543 txbyteclkhs(adjusted_mode->htotal, bpp, 547 txbyteclkhs(adjusted_mode->htotal, bpp,
544 intel_dsi->lane_count) + 1); 548 intel_dsi->lane_count,
549 intel_dsi->burst_mode_ratio) + 1);
545 } else { 550 } else {
546 I915_WRITE(MIPI_HS_TX_TIMEOUT(pipe), 551 I915_WRITE(MIPI_HS_TX_TIMEOUT(pipe),
547 txbyteclkhs(adjusted_mode->vtotal * 552 txbyteclkhs(adjusted_mode->vtotal *
548 adjusted_mode->htotal, 553 adjusted_mode->htotal,
549 bpp, intel_dsi->lane_count) + 1); 554 bpp, intel_dsi->lane_count,
555 intel_dsi->burst_mode_ratio) + 1);
550 } 556 }
551 I915_WRITE(MIPI_LP_RX_TIMEOUT(pipe), intel_dsi->lp_rx_timeout); 557 I915_WRITE(MIPI_LP_RX_TIMEOUT(pipe), intel_dsi->lp_rx_timeout);
552 I915_WRITE(MIPI_TURN_AROUND_TIMEOUT(pipe), intel_dsi->turn_arnd_val); 558 I915_WRITE(MIPI_TURN_AROUND_TIMEOUT(pipe), intel_dsi->turn_arnd_val);
@@ -576,7 +582,7 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder)
576 * XXX: write MIPI_STOP_STATE_STALL? 582 * XXX: write MIPI_STOP_STATE_STALL?
577 */ 583 */
578 I915_WRITE(MIPI_HIGH_LOW_SWITCH_COUNT(pipe), 584 I915_WRITE(MIPI_HIGH_LOW_SWITCH_COUNT(pipe),
579 intel_dsi->hs_to_lp_count); 585 intel_dsi->hs_to_lp_count);
580 586
581 /* XXX: low power clock equivalence in terms of byte clock. the number 587 /* XXX: low power clock equivalence in terms of byte clock. the number
582 * of byte clocks occupied in one low power clock. based on txbyteclkhs 588 * of byte clocks occupied in one low power clock. based on txbyteclkhs
@@ -601,10 +607,10 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder)
601 * 64 like 1366 x 768. Enable RANDOM resolution support for such 607 * 64 like 1366 x 768. Enable RANDOM resolution support for such
602 * panels by default */ 608 * panels by default */
603 I915_WRITE(MIPI_VIDEO_MODE_FORMAT(pipe), 609 I915_WRITE(MIPI_VIDEO_MODE_FORMAT(pipe),
604 intel_dsi->video_frmt_cfg_bits | 610 intel_dsi->video_frmt_cfg_bits |
605 intel_dsi->video_mode_format | 611 intel_dsi->video_mode_format |
606 IP_TG_CONFIG | 612 IP_TG_CONFIG |
607 RANDOM_DPI_DISPLAY_RESOLUTION); 613 RANDOM_DPI_DISPLAY_RESOLUTION);
608} 614}
609 615
610static void intel_dsi_pre_pll_enable(struct intel_encoder *encoder) 616static void intel_dsi_pre_pll_enable(struct intel_encoder *encoder)