@@ -2254,32 +2254,6 @@ static void intel_enable_primary_hw_plane(struct drm_plane *plane,
2254
2254
intel_wait_for_vblank (dev , intel_crtc -> pipe );
2255
2255
}
2256
2256
2257
- /**
2258
- * intel_disable_primary_hw_plane - disable the primary hardware plane
2259
- * @plane: plane to be disabled
2260
- * @crtc: crtc for the plane
2261
- *
2262
- * Disable @plane on @crtc, making sure that the pipe is running first.
2263
- */
2264
- static void intel_disable_primary_hw_plane (struct drm_plane * plane ,
2265
- struct drm_crtc * crtc )
2266
- {
2267
- struct drm_device * dev = plane -> dev ;
2268
- struct drm_i915_private * dev_priv = dev -> dev_private ;
2269
- struct intel_crtc * intel_crtc = to_intel_crtc (crtc );
2270
-
2271
- if (WARN_ON (!intel_crtc -> active ))
2272
- return ;
2273
-
2274
- if (!intel_crtc -> primary_enabled )
2275
- return ;
2276
-
2277
- intel_crtc -> primary_enabled = false;
2278
-
2279
- dev_priv -> display .update_primary_plane (crtc , plane -> fb ,
2280
- crtc -> x , crtc -> y );
2281
- }
2282
-
2283
2257
static bool need_vtd_wa (struct drm_device * dev )
2284
2258
{
2285
2259
#ifdef CONFIG_INTEL_IOMMU
@@ -4645,38 +4619,6 @@ static void intel_enable_sprite_planes(struct drm_crtc *crtc)
4645
4619
}
4646
4620
}
4647
4621
4648
- /*
4649
- * Disable a plane internally without actually modifying the plane's state.
4650
- * This will allow us to easily restore the plane later by just reprogramming
4651
- * its state.
4652
- */
4653
- static void disable_plane_internal (struct drm_plane * plane )
4654
- {
4655
- struct intel_plane * intel_plane = to_intel_plane (plane );
4656
- struct drm_plane_state * state =
4657
- plane -> funcs -> atomic_duplicate_state (plane );
4658
- struct intel_plane_state * intel_state = to_intel_plane_state (state );
4659
-
4660
- intel_state -> visible = false;
4661
- intel_plane -> commit_plane (plane , intel_state );
4662
-
4663
- intel_plane_destroy_state (plane , state );
4664
- }
4665
-
4666
- static void intel_disable_sprite_planes (struct drm_crtc * crtc )
4667
- {
4668
- struct drm_device * dev = crtc -> dev ;
4669
- enum pipe pipe = to_intel_crtc (crtc )-> pipe ;
4670
- struct drm_plane * plane ;
4671
- struct intel_plane * intel_plane ;
4672
-
4673
- drm_for_each_legacy_plane (plane , & dev -> mode_config .plane_list ) {
4674
- intel_plane = to_intel_plane (plane );
4675
- if (plane -> fb && intel_plane -> pipe == pipe )
4676
- disable_plane_internal (plane );
4677
- }
4678
- }
4679
-
4680
4622
void hsw_enable_ips (struct intel_crtc * crtc )
4681
4623
{
4682
4624
struct drm_device * dev = crtc -> base .dev ;
@@ -4830,6 +4772,7 @@ static void intel_crtc_disable_planes(struct drm_crtc *crtc)
4830
4772
struct drm_device * dev = crtc -> dev ;
4831
4773
struct drm_i915_private * dev_priv = dev -> dev_private ;
4832
4774
struct intel_crtc * intel_crtc = to_intel_crtc (crtc );
4775
+ struct intel_plane * intel_plane ;
4833
4776
int pipe = intel_crtc -> pipe ;
4834
4777
4835
4778
intel_crtc_wait_for_pending_flips (crtc );
@@ -4840,9 +4783,15 @@ static void intel_crtc_disable_planes(struct drm_crtc *crtc)
4840
4783
hsw_disable_ips (intel_crtc );
4841
4784
4842
4785
intel_crtc_dpms_overlay (intel_crtc , false);
4843
- intel_crtc_update_cursor (crtc , false);
4844
- intel_disable_sprite_planes (crtc );
4845
- intel_disable_primary_hw_plane (crtc -> primary , crtc );
4786
+ intel_crtc -> primary_enabled = false;
4787
+ for_each_intel_plane (dev , intel_plane ) {
4788
+ if (intel_plane -> pipe == pipe ) {
4789
+ struct drm_crtc * from = intel_plane -> base .crtc ;
4790
+
4791
+ intel_plane -> disable_plane (& intel_plane -> base ,
4792
+ from ?: crtc , true);
4793
+ }
4794
+ }
4846
4795
4847
4796
/*
4848
4797
* FIXME: Once we grow proper nuclear flip support out of this we need
@@ -13357,24 +13306,14 @@ intel_commit_primary_plane(struct drm_plane *plane,
13357
13306
crtc -> y = src -> y1 >> 16 ;
13358
13307
13359
13308
if (intel_crtc -> active ) {
13360
- if (state -> visible ) {
13309
+ intel_crtc -> primary_enabled = state -> visible ;
13310
+
13311
+ if (state -> visible )
13361
13312
/* FIXME: kill this fastboot hack */
13362
13313
intel_update_pipe_size (intel_crtc );
13363
13314
13364
- intel_crtc -> primary_enabled = true;
13365
-
13366
- dev_priv -> display .update_primary_plane (crtc , plane -> fb ,
13367
- crtc -> x , crtc -> y );
13368
- } else {
13369
- /*
13370
- * If clipping results in a non-visible primary plane,
13371
- * we'll disable the primary plane. Note that this is
13372
- * a bit different than what happens if userspace
13373
- * explicitly disables the plane by passing fb=0
13374
- * because plane->fb still gets set and pinned.
13375
- */
13376
- intel_disable_primary_hw_plane (plane , crtc );
13377
- }
13315
+ dev_priv -> display .update_primary_plane (crtc , plane -> fb ,
13316
+ crtc -> x , crtc -> y );
13378
13317
}
13379
13318
}
13380
13319
0 commit comments