aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>2015-03-20 10:18:07 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-03-26 12:49:51 -0400
commit944b0c76575753da5a332aab0a1d8c6df65a076b (patch)
treecc9700bd6003dcf72d329ff7b02232a2e434f308 /drivers/gpu
parentd29b2f9dce3e53ed3d5ada9d42f0edcca72fbfcd (diff)
drm/i915: Copy the staged connector config to the legacy atomic state
With this in place, we can start converting pieces of the modeset code to look at the connector atomic state instead of the staged config. v2: Handle the load detect staged config changes too. (Ander) Remove unnecessary blank line. (Daniel) Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c52
1 files changed, 45 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index de2ab2d9574b..c0fa9df51008 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8909,6 +8909,7 @@ bool intel_get_load_detect_pipe(struct drm_connector *connector,
8909 struct drm_framebuffer *fb; 8909 struct drm_framebuffer *fb;
8910 struct drm_mode_config *config = &dev->mode_config; 8910 struct drm_mode_config *config = &dev->mode_config;
8911 struct drm_atomic_state *state = NULL; 8911 struct drm_atomic_state *state = NULL;
8912 struct drm_connector_state *connector_state;
8912 int ret, i = -1; 8913 int ret, i = -1;
8913 8914
8914 DRM_DEBUG_KMS("[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n", 8915 DRM_DEBUG_KMS("[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n",
@@ -8996,6 +8997,15 @@ retry:
8996 8997
8997 state->acquire_ctx = ctx; 8998 state->acquire_ctx = ctx;
8998 8999
9000 connector_state = drm_atomic_get_connector_state(state, connector);
9001 if (IS_ERR(connector_state)) {
9002 ret = PTR_ERR(connector_state);
9003 goto fail;
9004 }
9005
9006 connector_state->crtc = crtc;
9007 connector_state->best_encoder = &intel_encoder->base;
9008
8999 if (!mode) 9009 if (!mode)
9000 mode = &load_detect_mode; 9010 mode = &load_detect_mode;
9001 9011
@@ -9061,6 +9071,7 @@ void intel_release_load_detect_pipe(struct drm_connector *connector,
9061 struct drm_crtc *crtc = encoder->crtc; 9071 struct drm_crtc *crtc = encoder->crtc;
9062 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 9072 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
9063 struct drm_atomic_state *state; 9073 struct drm_atomic_state *state;
9074 struct drm_connector_state *connector_state;
9064 9075
9065 DRM_DEBUG_KMS("[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n", 9076 DRM_DEBUG_KMS("[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n",
9066 connector->base.id, connector->name, 9077 connector->base.id, connector->name,
@@ -9068,17 +9079,23 @@ void intel_release_load_detect_pipe(struct drm_connector *connector,
9068 9079
9069 if (old->load_detect_temp) { 9080 if (old->load_detect_temp) {
9070 state = drm_atomic_state_alloc(dev); 9081 state = drm_atomic_state_alloc(dev);
9071 if (!state) { 9082 if (!state)
9072 DRM_DEBUG_KMS("can't release load detect pipe\n"); 9083 goto fail;
9073 return;
9074 }
9075 9084
9076 state->acquire_ctx = ctx; 9085 state->acquire_ctx = ctx;
9077 9086
9087 connector_state = drm_atomic_get_connector_state(state, connector);
9088 if (IS_ERR(connector_state))
9089 goto fail;
9090
9078 to_intel_connector(connector)->new_encoder = NULL; 9091 to_intel_connector(connector)->new_encoder = NULL;
9079 intel_encoder->new_crtc = NULL; 9092 intel_encoder->new_crtc = NULL;
9080 intel_crtc->new_enabled = false; 9093 intel_crtc->new_enabled = false;
9081 intel_crtc->new_config = NULL; 9094 intel_crtc->new_config = NULL;
9095
9096 connector_state->best_encoder = NULL;
9097 connector_state->crtc = NULL;
9098
9082 intel_set_mode(crtc, NULL, 0, 0, NULL, state); 9099 intel_set_mode(crtc, NULL, 0, 0, NULL, state);
9083 9100
9084 drm_atomic_state_free(state); 9101 drm_atomic_state_free(state);
@@ -9094,6 +9111,11 @@ void intel_release_load_detect_pipe(struct drm_connector *connector,
9094 /* Switch crtc and encoder back off if necessary */ 9111 /* Switch crtc and encoder back off if necessary */
9095 if (old->dpms_mode != DRM_MODE_DPMS_ON) 9112 if (old->dpms_mode != DRM_MODE_DPMS_ON)
9096 connector->funcs->dpms(connector, old->dpms_mode); 9113 connector->funcs->dpms(connector, old->dpms_mode);
9114
9115 return;
9116fail:
9117 DRM_DEBUG_KMS("Couldn't release load detect pipe.\n");
9118 drm_atomic_state_free(state);
9097} 9119}
9098 9120
9099static int i9xx_pll_refclk(struct drm_device *dev, 9121static int i9xx_pll_refclk(struct drm_device *dev,
@@ -11777,9 +11799,11 @@ intel_set_config_compute_mode_changes(struct drm_mode_set *set,
11777static int 11799static int
11778intel_modeset_stage_output_state(struct drm_device *dev, 11800intel_modeset_stage_output_state(struct drm_device *dev,
11779 struct drm_mode_set *set, 11801 struct drm_mode_set *set,
11780 struct intel_set_config *config) 11802 struct intel_set_config *config,
11803 struct drm_atomic_state *state)
11781{ 11804{
11782 struct intel_connector *connector; 11805 struct intel_connector *connector;
11806 struct drm_connector_state *connector_state;
11783 struct intel_encoder *encoder; 11807 struct intel_encoder *encoder;
11784 struct intel_crtc *crtc; 11808 struct intel_crtc *crtc;
11785 int ro; 11809 int ro;
@@ -11843,6 +11867,14 @@ intel_modeset_stage_output_state(struct drm_device *dev,
11843 } 11867 }
11844 connector->new_encoder->new_crtc = to_intel_crtc(new_crtc); 11868 connector->new_encoder->new_crtc = to_intel_crtc(new_crtc);
11845 11869
11870 connector_state =
11871 drm_atomic_get_connector_state(state, &connector->base);
11872 if (IS_ERR(connector_state))
11873 return PTR_ERR(connector_state);
11874
11875 connector_state->crtc = new_crtc;
11876 connector_state->best_encoder = &connector->new_encoder->base;
11877
11846 DRM_DEBUG_KMS("[CONNECTOR:%d:%s] to [CRTC:%d]\n", 11878 DRM_DEBUG_KMS("[CONNECTOR:%d:%s] to [CRTC:%d]\n",
11847 connector->base.base.id, 11879 connector->base.base.id,
11848 connector->base.name, 11880 connector->base.name,
@@ -11875,9 +11907,15 @@ intel_modeset_stage_output_state(struct drm_device *dev,
11875 } 11907 }
11876 /* Now we've also updated encoder->new_crtc for all encoders. */ 11908 /* Now we've also updated encoder->new_crtc for all encoders. */
11877 for_each_intel_connector(dev, connector) { 11909 for_each_intel_connector(dev, connector) {
11878 if (connector->new_encoder) 11910 connector_state =
11911 drm_atomic_get_connector_state(state, &connector->base);
11912
11913 if (connector->new_encoder) {
11879 if (connector->new_encoder != connector->encoder) 11914 if (connector->new_encoder != connector->encoder)
11880 connector->encoder = connector->new_encoder; 11915 connector->encoder = connector->new_encoder;
11916 } else {
11917 connector_state->crtc = NULL;
11918 }
11881 } 11919 }
11882 for_each_intel_crtc(dev, crtc) { 11920 for_each_intel_crtc(dev, crtc) {
11883 crtc->new_enabled = false; 11921 crtc->new_enabled = false;
@@ -11986,7 +12024,7 @@ static int intel_crtc_set_config(struct drm_mode_set *set)
11986 12024
11987 state->acquire_ctx = dev->mode_config.acquire_ctx; 12025 state->acquire_ctx = dev->mode_config.acquire_ctx;
11988 12026
11989 ret = intel_modeset_stage_output_state(dev, set, config); 12027 ret = intel_modeset_stage_output_state(dev, set, config, state);
11990 if (ret) 12028 if (ret)
11991 goto fail; 12029 goto fail;
11992 12030