diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2013-06-26 11:57:38 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-07-01 13:38:17 -0400 |
commit | babea61dfb82b4bdfdbc57ebf081ef6c16ffd524 (patch) | |
tree | 06e6a460b2c23b807d45d2d9302cb93f9f84b1aa /drivers/gpu/drm/i915/intel_display.c | |
parent | f1f644dc66cbaf5a4c7dcde683361536b41885b9 (diff) |
drm/i915: copy fetched mode state into crtc at setup_hw time v5
We already fetch and track other state into the main CRTC and encoder
structs, and for fastboot we need to do the same with the mode and clock
data we read out.
v2: fix debug print
v3: use fastboot param around state copy
v4: set clock and flags for crtc here instead of in setup_hw_state
v5: rename function to intel_crtc_mode_from_pipe_config for consistency (Chris)
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
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.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 9c05e57fb7ae..2e6fc4ce8ec9 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -4716,6 +4716,27 @@ static void intel_get_pipe_timings(struct intel_crtc *crtc, | |||
4716 | pipe_config->requested_mode.hdisplay = ((tmp >> 16) & 0xffff) + 1; | 4716 | pipe_config->requested_mode.hdisplay = ((tmp >> 16) & 0xffff) + 1; |
4717 | } | 4717 | } |
4718 | 4718 | ||
4719 | static void intel_crtc_mode_from_pipe_config(struct intel_crtc *intel_crtc, | ||
4720 | struct intel_crtc_config *pipe_config) | ||
4721 | { | ||
4722 | struct drm_crtc *crtc = &intel_crtc->base; | ||
4723 | |||
4724 | crtc->mode.hdisplay = pipe_config->adjusted_mode.crtc_hdisplay; | ||
4725 | crtc->mode.htotal = pipe_config->adjusted_mode.crtc_htotal; | ||
4726 | crtc->mode.hsync_start = pipe_config->adjusted_mode.crtc_hsync_start; | ||
4727 | crtc->mode.hsync_end = pipe_config->adjusted_mode.crtc_hsync_end; | ||
4728 | |||
4729 | crtc->mode.vdisplay = pipe_config->adjusted_mode.crtc_vdisplay; | ||
4730 | crtc->mode.vtotal = pipe_config->adjusted_mode.crtc_vtotal; | ||
4731 | crtc->mode.vsync_start = pipe_config->adjusted_mode.crtc_vsync_start; | ||
4732 | crtc->mode.vsync_end = pipe_config->adjusted_mode.crtc_vsync_end; | ||
4733 | |||
4734 | crtc->mode.flags = pipe_config->adjusted_mode.flags; | ||
4735 | |||
4736 | crtc->mode.clock = pipe_config->adjusted_mode.clock; | ||
4737 | crtc->mode.flags |= pipe_config->adjusted_mode.flags; | ||
4738 | } | ||
4739 | |||
4719 | static void i9xx_set_pipeconf(struct intel_crtc *intel_crtc) | 4740 | static void i9xx_set_pipeconf(struct intel_crtc *intel_crtc) |
4720 | { | 4741 | { |
4721 | struct drm_device *dev = intel_crtc->base.dev; | 4742 | struct drm_device *dev = intel_crtc->base.dev; |
@@ -9961,6 +9982,22 @@ void intel_modeset_setup_hw_state(struct drm_device *dev, | |||
9961 | 9982 | ||
9962 | intel_modeset_readout_hw_state(dev); | 9983 | intel_modeset_readout_hw_state(dev); |
9963 | 9984 | ||
9985 | /* | ||
9986 | * Now that we have the config, copy it to each CRTC struct | ||
9987 | * Note that this could go away if we move to using crtc_config | ||
9988 | * checking everywhere. | ||
9989 | */ | ||
9990 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, | ||
9991 | base.head) { | ||
9992 | if (crtc->active && i915_fastboot) { | ||
9993 | intel_crtc_mode_from_pipe_config(crtc, &crtc->config); | ||
9994 | |||
9995 | DRM_DEBUG_KMS("[CRTC:%d] found active mode: ", | ||
9996 | crtc->base.base.id); | ||
9997 | drm_mode_debug_printmodeline(&crtc->base.mode); | ||
9998 | } | ||
9999 | } | ||
10000 | |||
9964 | /* HW state is read out, now we need to sanitize this mess. */ | 10001 | /* HW state is read out, now we need to sanitize this mess. */ |
9965 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, | 10002 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, |
9966 | base.head) { | 10003 | base.head) { |