aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_drv.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-07-05 16:34:27 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-09-06 02:02:57 -0400
commit9a935856992d68b9194f825ce6e115df7ecc5bca (patch)
treed8e207abfb1c9c5baef03e6b209d4b75eb2213ae /drivers/gpu/drm/i915/intel_drv.h
parent1aa4b628ee63f55db96c7e820257b6e4948abb74 (diff)
drm/i915: stage modeset output changes
This is the core of the new modeset logic. The current code which is based upon the crtc helper code first updates all the link of the new display pipeline and then calls the lower-level set_mode function to execute the required callbacks to get there. The issue with this approach is that for disabling we need to know the _current_ display pipe state, not the new one. Hence we need to stage the new state of the display pipe and only update it once we have disabled the current configuration and before we start to update the hw registers with the new configuration. This patch here just prepares the ground by switching the new output state computation to these staging pointers. To make it clearer, rename the old update_output_state function to stage_output_state. A few peculiarities: - We're also calling the set_mode function at various places to update properties. Hence after a successfule modeset we need to stage the current configuration (for otherwise we might fall back again). This happens automatically because as part of the (successful) modeset we need to copy the staged state to the real one. But for the hw readout code we need to make sure that this happens, too. - Teach the new staged output state computation code the required smarts to handle the disabling of outputs. The current code handles this in a special case, but to better handle global modeset changes covering more than one crtc, we want to do this all in the same low-level modeset code. - The actual modeset code is still a bit ugly and wants to know the new crtc->enabled state a bit early. Follow-on patches will clean that up, for now we have to apply the staged output configuration early, outside of the set_mode functions. - Improve/add comments in stage_output_state. Essentially all that is left to do now is move the disabling code into set_mode and then move the staged state update code also into set_mode, at the right place between disabling things and calling the mode_set callbacks for the new configuration. v2: Disabling a crtc works by passing in a NULL mode or fb, userspace doesn't hand in the list of connectors. We therefore need to detect this case manually and tear down all the output links. v3: Properly update the output staging pointers after having read out the hw state. v4: Simplify the code, add more DRM_DEBUG_KMS output and check a few assumptions with WARN_ON. Essentially all things that I've noticed while debugging issues in other places of the code. v4: Correctly disable the old set of connectors when enabling an already enabled crtc on a new set of crtc. Reported by Paulo Zanoni. Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_drv.h')
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 4946282bd324..ae807afc5fbf 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -133,6 +133,12 @@ struct intel_fbdev {
133 133
134struct intel_encoder { 134struct intel_encoder {
135 struct drm_encoder base; 135 struct drm_encoder base;
136 /*
137 * The new crtc this encoder will be driven from. Only differs from
138 * base->crtc while a modeset is in progress.
139 */
140 struct intel_crtc *new_crtc;
141
136 int type; 142 int type;
137 bool needs_tv_clock; 143 bool needs_tv_clock;
138 /* 144 /*
@@ -153,7 +159,17 @@ struct intel_encoder {
153 159
154struct intel_connector { 160struct intel_connector {
155 struct drm_connector base; 161 struct drm_connector base;
162 /*
163 * The fixed encoder this connector is connected to.
164 */
156 struct intel_encoder *encoder; 165 struct intel_encoder *encoder;
166
167 /*
168 * The new encoder this connector will be driven. Only differs from
169 * encoder while a modeset is in progress.
170 */
171 struct intel_encoder *new_encoder;
172
157 /* Reads out the current hw, returning true if the connector is enabled 173 /* Reads out the current hw, returning true if the connector is enabled
158 * and active (i.e. dpms ON state). */ 174 * and active (i.e. dpms ON state). */
159 bool (*get_hw_state)(struct intel_connector *); 175 bool (*get_hw_state)(struct intel_connector *);