aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2013-09-04 11:25:28 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-09-16 17:36:49 -0400
commit37327abdfbb4e2d7c9033f450de5e36e401d6efc (patch)
tree70ffd4c8b97b0c54a14036efb46fa8b8e3a55f5f /drivers/gpu/drm/i915/intel_display.c
parenta74821454249d32ba5f63a7de22bd6187be1ebd8 (diff)
drm/i915: Add explicit pipe src size to pipe config
Rather that mess about with hdisplay/vdisplay from requested_mode, add explicit pipe src size information to pipe config. Now requested_mode is only really relevant for dvo/sdvo output timings. For everything else either adjusted_mode or pipe src size should be used. In many places where we end up using pipe source size, we should actually use the primary plane size, but we don't currently store that information explicitly. As long as we treat primaries as full screen only, we can get away with this. Eventually when we move primaries over to drm_plane, we need to fix it all up. v2: Add a comment to explain what pipe_src_{w,h} are Add a note about primary planes to commit message Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 234a77d0ee4e..b8d7ad6cab91 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4696,7 +4696,6 @@ static void intel_set_pipe_timings(struct intel_crtc *intel_crtc)
4696 enum transcoder cpu_transcoder = intel_crtc->config.cpu_transcoder; 4696 enum transcoder cpu_transcoder = intel_crtc->config.cpu_transcoder;
4697 struct drm_display_mode *adjusted_mode = 4697 struct drm_display_mode *adjusted_mode =
4698 &intel_crtc->config.adjusted_mode; 4698 &intel_crtc->config.adjusted_mode;
4699 struct drm_display_mode *mode = &intel_crtc->config.requested_mode;
4700 uint32_t vsyncshift, crtc_vtotal, crtc_vblank_end; 4699 uint32_t vsyncshift, crtc_vtotal, crtc_vblank_end;
4701 4700
4702 /* We need to be careful not to changed the adjusted mode, for otherwise 4701 /* We need to be careful not to changed the adjusted mode, for otherwise
@@ -4749,7 +4748,8 @@ static void intel_set_pipe_timings(struct intel_crtc *intel_crtc)
4749 * always be the user's requested size. 4748 * always be the user's requested size.
4750 */ 4749 */
4751 I915_WRITE(PIPESRC(pipe), 4750 I915_WRITE(PIPESRC(pipe),
4752 ((mode->hdisplay - 1) << 16) | (mode->vdisplay - 1)); 4751 ((intel_crtc->config.pipe_src_w - 1) << 16) |
4752 (intel_crtc->config.pipe_src_h - 1));
4753} 4753}
4754 4754
4755static void intel_get_pipe_timings(struct intel_crtc *crtc, 4755static void intel_get_pipe_timings(struct intel_crtc *crtc,
@@ -4787,8 +4787,11 @@ static void intel_get_pipe_timings(struct intel_crtc *crtc,
4787 } 4787 }
4788 4788
4789 tmp = I915_READ(PIPESRC(crtc->pipe)); 4789 tmp = I915_READ(PIPESRC(crtc->pipe));
4790 pipe_config->requested_mode.vdisplay = (tmp & 0xffff) + 1; 4790 pipe_config->pipe_src_h = (tmp & 0xffff) + 1;
4791 pipe_config->requested_mode.hdisplay = ((tmp >> 16) & 0xffff) + 1; 4791 pipe_config->pipe_src_w = ((tmp >> 16) & 0xffff) + 1;
4792
4793 pipe_config->requested_mode.vdisplay = pipe_config->pipe_src_h;
4794 pipe_config->requested_mode.hdisplay = pipe_config->pipe_src_w;
4792} 4795}
4793 4796
4794static void intel_crtc_mode_from_pipe_config(struct intel_crtc *intel_crtc, 4797static void intel_crtc_mode_from_pipe_config(struct intel_crtc *intel_crtc,
@@ -4884,7 +4887,6 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
4884 struct drm_device *dev = crtc->dev; 4887 struct drm_device *dev = crtc->dev;
4885 struct drm_i915_private *dev_priv = dev->dev_private; 4888 struct drm_i915_private *dev_priv = dev->dev_private;
4886 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 4889 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
4887 struct drm_display_mode *mode = &intel_crtc->config.requested_mode;
4888 int pipe = intel_crtc->pipe; 4890 int pipe = intel_crtc->pipe;
4889 int plane = intel_crtc->plane; 4891 int plane = intel_crtc->plane;
4890 int refclk, num_connectors = 0; 4892 int refclk, num_connectors = 0;
@@ -4983,8 +4985,8 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
4983 * which should always be the user's requested size. 4985 * which should always be the user's requested size.
4984 */ 4986 */
4985 I915_WRITE(DSPSIZE(plane), 4987 I915_WRITE(DSPSIZE(plane),
4986 ((mode->vdisplay - 1) << 16) | 4988 ((intel_crtc->config.pipe_src_h - 1) << 16) |
4987 (mode->hdisplay - 1)); 4989 (intel_crtc->config.pipe_src_w - 1));
4988 I915_WRITE(DSPPOS(plane), 0); 4990 I915_WRITE(DSPPOS(plane), 0);
4989 4991
4990 i9xx_set_pipeconf(intel_crtc); 4992 i9xx_set_pipeconf(intel_crtc);
@@ -8349,6 +8351,8 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
8349 DRM_DEBUG_KMS("adjusted mode:\n"); 8351 DRM_DEBUG_KMS("adjusted mode:\n");
8350 drm_mode_debug_printmodeline(&pipe_config->adjusted_mode); 8352 drm_mode_debug_printmodeline(&pipe_config->adjusted_mode);
8351 DRM_DEBUG_KMS("port clock: %d\n", pipe_config->port_clock); 8353 DRM_DEBUG_KMS("port clock: %d\n", pipe_config->port_clock);
8354 DRM_DEBUG_KMS("pipe src size: %dx%d\n",
8355 pipe_config->pipe_src_w, pipe_config->pipe_src_h);
8352 DRM_DEBUG_KMS("gmch pfit: control: 0x%08x, ratios: 0x%08x, lvds border: 0x%08x\n", 8356 DRM_DEBUG_KMS("gmch pfit: control: 0x%08x, ratios: 0x%08x, lvds border: 0x%08x\n",
8353 pipe_config->gmch_pfit.control, 8357 pipe_config->gmch_pfit.control,
8354 pipe_config->gmch_pfit.pgm_ratios, 8358 pipe_config->gmch_pfit.pgm_ratios,
@@ -8400,6 +8404,10 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
8400 8404
8401 drm_mode_copy(&pipe_config->adjusted_mode, mode); 8405 drm_mode_copy(&pipe_config->adjusted_mode, mode);
8402 drm_mode_copy(&pipe_config->requested_mode, mode); 8406 drm_mode_copy(&pipe_config->requested_mode, mode);
8407
8408 pipe_config->pipe_src_w = mode->hdisplay;
8409 pipe_config->pipe_src_h = mode->vdisplay;
8410
8403 pipe_config->cpu_transcoder = 8411 pipe_config->cpu_transcoder =
8404 (enum transcoder) to_intel_crtc(crtc)->pipe; 8412 (enum transcoder) to_intel_crtc(crtc)->pipe;
8405 pipe_config->shared_dpll = DPLL_ID_PRIVATE; 8413 pipe_config->shared_dpll = DPLL_ID_PRIVATE;
@@ -8756,8 +8764,8 @@ intel_pipe_config_compare(struct drm_device *dev,
8756 DRM_MODE_FLAG_NVSYNC); 8764 DRM_MODE_FLAG_NVSYNC);
8757 } 8765 }
8758 8766
8759 PIPE_CONF_CHECK_I(requested_mode.hdisplay); 8767 PIPE_CONF_CHECK_I(pipe_src_w);
8760 PIPE_CONF_CHECK_I(requested_mode.vdisplay); 8768 PIPE_CONF_CHECK_I(pipe_src_h);
8761 8769
8762 PIPE_CONF_CHECK_I(gmch_pfit.control); 8770 PIPE_CONF_CHECK_I(gmch_pfit.control);
8763 /* pfit ratios are autocomputed by the hw on gen4+ */ 8771 /* pfit ratios are autocomputed by the hw on gen4+ */