@@ -107,6 +107,8 @@ static void skl_init_scalers(struct drm_device *dev, struct intel_crtc *intel_cr
107
107
struct intel_crtc_state * crtc_state );
108
108
static int i9xx_get_refclk (const struct intel_crtc_state * crtc_state ,
109
109
int num_connectors );
110
+ static void intel_crtc_enable_planes (struct drm_crtc * crtc );
111
+ static void intel_crtc_disable_planes (struct drm_crtc * crtc );
110
112
111
113
static struct intel_encoder * intel_find_encoder (struct intel_connector * connector , int pipe )
112
114
{
@@ -3206,6 +3208,19 @@ static void intel_update_primary_planes(struct drm_device *dev)
3206
3208
}
3207
3209
}
3208
3210
3211
+ void intel_crtc_reset (struct intel_crtc * crtc )
3212
+ {
3213
+ struct drm_i915_private * dev_priv = to_i915 (crtc -> base .dev );
3214
+
3215
+ if (!crtc -> active )
3216
+ return ;
3217
+
3218
+ intel_crtc_disable_planes (& crtc -> base );
3219
+ dev_priv -> display .crtc_disable (& crtc -> base );
3220
+ dev_priv -> display .crtc_enable (& crtc -> base );
3221
+ intel_crtc_enable_planes (& crtc -> base );
3222
+ }
3223
+
3209
3224
void intel_prepare_reset (struct drm_device * dev )
3210
3225
{
3211
3226
struct drm_i915_private * dev_priv = to_i915 (dev );
@@ -3226,8 +3241,11 @@ void intel_prepare_reset(struct drm_device *dev)
3226
3241
* g33 docs say we should at least disable all the planes.
3227
3242
*/
3228
3243
for_each_intel_crtc (dev , crtc ) {
3229
- if (crtc -> active )
3230
- dev_priv -> display .crtc_disable (& crtc -> base );
3244
+ if (!crtc -> active )
3245
+ continue ;
3246
+
3247
+ intel_crtc_disable_planes (& crtc -> base );
3248
+ dev_priv -> display .crtc_disable (& crtc -> base );
3231
3249
}
3232
3250
}
3233
3251
@@ -4842,8 +4860,6 @@ intel_pre_disable_primary(struct drm_crtc *crtc)
4842
4860
4843
4861
static void intel_crtc_enable_planes (struct drm_crtc * crtc )
4844
4862
{
4845
- struct intel_crtc * intel_crtc = to_intel_crtc (crtc );
4846
-
4847
4863
intel_enable_primary_hw_plane (crtc -> primary , crtc );
4848
4864
intel_enable_sprite_planes (crtc );
4849
4865
intel_crtc_update_cursor (crtc , true);
@@ -4949,8 +4965,6 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
4949
4965
4950
4966
if (HAS_PCH_CPT (dev ))
4951
4967
cpt_verify_modeset (dev , intel_crtc -> pipe );
4952
-
4953
- intel_crtc_enable_planes (crtc );
4954
4968
}
4955
4969
4956
4970
/* IPS only exists on ULT machines and is tied to pipe A. */
@@ -5074,7 +5088,6 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
5074
5088
/* If we change the relative order between pipe/planes enabling, we need
5075
5089
* to change the workaround. */
5076
5090
haswell_mode_set_planes_workaround (intel_crtc );
5077
- intel_crtc_enable_planes (crtc );
5078
5091
}
5079
5092
5080
5093
static void ironlake_pfit_disable (struct intel_crtc * crtc )
@@ -5104,8 +5117,6 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
5104
5117
if (!intel_crtc -> active )
5105
5118
return ;
5106
5119
5107
- intel_crtc_disable_planes (crtc );
5108
-
5109
5120
for_each_encoder_on_crtc (dev , crtc , encoder )
5110
5121
encoder -> disable (encoder );
5111
5122
@@ -5168,8 +5179,6 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
5168
5179
if (!intel_crtc -> active )
5169
5180
return ;
5170
5181
5171
- intel_crtc_disable_planes (crtc );
5172
-
5173
5182
for_each_encoder_on_crtc (dev , crtc , encoder ) {
5174
5183
intel_opregion_notify_encoder (encoder , false);
5175
5184
encoder -> disable (encoder );
@@ -5917,8 +5926,6 @@ static void valleyview_crtc_enable(struct drm_crtc *crtc)
5917
5926
5918
5927
for_each_encoder_on_crtc (dev , crtc , encoder )
5919
5928
encoder -> enable (encoder );
5920
-
5921
- intel_crtc_enable_planes (crtc );
5922
5929
}
5923
5930
5924
5931
static void i9xx_set_pll_dividers (struct intel_crtc * crtc )
@@ -5975,8 +5982,6 @@ static void i9xx_crtc_enable(struct drm_crtc *crtc)
5975
5982
5976
5983
for_each_encoder_on_crtc (dev , crtc , encoder )
5977
5984
encoder -> enable (encoder );
5978
-
5979
- intel_crtc_enable_planes (crtc );
5980
5985
}
5981
5986
5982
5987
static void i9xx_pfit_disable (struct intel_crtc * crtc )
@@ -6005,8 +6010,6 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
6005
6010
if (!intel_crtc -> active )
6006
6011
return ;
6007
6012
6008
- intel_crtc_disable_planes (crtc );
6009
-
6010
6013
/*
6011
6014
* On gen2 planes are double buffered but the pipe isn't, so we must
6012
6015
* wait for planes to fully turn off before disabling the pipe.
@@ -6070,9 +6073,11 @@ void intel_crtc_control(struct drm_crtc *crtc, bool enable)
6070
6073
intel_crtc -> enabled_power_domains = domains ;
6071
6074
6072
6075
dev_priv -> display .crtc_enable (crtc );
6076
+ intel_crtc_enable_planes (crtc );
6073
6077
}
6074
6078
} else {
6075
6079
if (intel_crtc -> active ) {
6080
+ intel_crtc_disable_planes (crtc );
6076
6081
dev_priv -> display .crtc_disable (crtc );
6077
6082
6078
6083
domains = intel_crtc -> enabled_power_domains ;
@@ -6107,6 +6112,7 @@ static void intel_crtc_disable(struct drm_crtc *crtc)
6107
6112
/* crtc should still be enabled when we disable it. */
6108
6113
WARN_ON (!crtc -> state -> enable );
6109
6114
6115
+ intel_crtc_disable_planes (crtc );
6110
6116
dev_priv -> display .crtc_disable (crtc );
6111
6117
dev_priv -> display .off (crtc );
6112
6118
@@ -12346,8 +12352,10 @@ static int __intel_set_mode(struct drm_crtc *crtc,
12346
12352
intel_crtc_disable (& intel_crtc -> base );
12347
12353
12348
12354
for_each_intel_crtc_masked (dev , prepare_pipes , intel_crtc ) {
12349
- if (intel_crtc -> base .state -> enable )
12355
+ if (intel_crtc -> base .state -> enable ) {
12356
+ intel_crtc_disable_planes (& intel_crtc -> base );
12350
12357
dev_priv -> display .crtc_disable (& intel_crtc -> base );
12358
+ }
12351
12359
}
12352
12360
12353
12361
/* crtc->mode is already used by the ->mode_set callbacks, hence we need
@@ -12395,6 +12403,7 @@ static int __intel_set_mode(struct drm_crtc *crtc,
12395
12403
update_scanline_offset (intel_crtc );
12396
12404
12397
12405
dev_priv -> display .crtc_enable (& intel_crtc -> base );
12406
+ intel_crtc_enable_planes (& intel_crtc -> base );
12398
12407
}
12399
12408
12400
12409
/* FIXME: add subpixel order */
@@ -14839,6 +14848,7 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)
14839
14848
plane = crtc -> plane ;
14840
14849
to_intel_plane_state (crtc -> base .primary -> state )-> visible = true;
14841
14850
crtc -> plane = !plane ;
14851
+ intel_crtc_disable_planes (& crtc -> base );
14842
14852
dev_priv -> display .crtc_disable (& crtc -> base );
14843
14853
crtc -> plane = plane ;
14844
14854
0 commit comments