Skip to content

Commit ecce87e

Browse files
mlankhorstdanvet
authored andcommitted
drm/i915: Remove implicitly disabling primary plane for now
Some of the flags that were used are still useful when transitioning to atomic, so keep those around for now. This removes some of the complications of crtc->primary_enabled, making it easier to remove. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent eb3394f commit ecce87e

File tree

2 files changed

+1
-50
lines changed

2 files changed

+1
-50
lines changed

drivers/gpu/drm/i915/intel_drv.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,6 @@ struct intel_plane_state {
248248
struct drm_rect clip;
249249
bool visible;
250250

251-
/*
252-
* used only for sprite planes to determine when to implicitly
253-
* enable/disable the primary plane
254-
*/
255-
bool hides_primary;
256-
257251
/*
258252
* scaler_id
259253
* = -1 : not using a scaler

drivers/gpu/drm/i915/intel_sprite.c

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -166,17 +166,6 @@ void intel_pipe_update_end(struct intel_crtc *crtc, u32 start_vbl_count)
166166
pipe_name(pipe), start_vbl_count, end_vbl_count);
167167
}
168168

169-
static void intel_update_primary_plane(struct intel_crtc *crtc)
170-
{
171-
struct drm_i915_private *dev_priv = crtc->base.dev->dev_private;
172-
int reg = DSPCNTR(crtc->plane);
173-
174-
if (crtc->primary_enabled)
175-
I915_WRITE(reg, I915_READ(reg) | DISPLAY_PLANE_ENABLE);
176-
else
177-
I915_WRITE(reg, I915_READ(reg) & ~DISPLAY_PLANE_ENABLE);
178-
}
179-
180169
static void
181170
skl_update_plane(struct drm_plane *drm_plane, struct drm_crtc *crtc,
182171
struct drm_framebuffer *fb,
@@ -438,8 +427,6 @@ vlv_update_plane(struct drm_plane *dplane, struct drm_crtc *crtc,
438427
linear_offset += src_h * fb->pitches[0] + src_w * pixel_size;
439428
}
440429

441-
intel_update_primary_plane(intel_crtc);
442-
443430
if (key->flags) {
444431
I915_WRITE(SPKEYMINVAL(pipe, plane), key->min_value);
445432
I915_WRITE(SPKEYMAXVAL(pipe, plane), key->max_value);
@@ -480,8 +467,6 @@ vlv_disable_plane(struct drm_plane *dplane, struct drm_crtc *crtc)
480467
int pipe = intel_plane->pipe;
481468
int plane = intel_plane->plane;
482469

483-
intel_update_primary_plane(intel_crtc);
484-
485470
I915_WRITE(SPCNTR(pipe, plane), 0);
486471

487472
/* Activate double buffered register update */
@@ -585,8 +570,6 @@ ivb_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
585570
}
586571
}
587572

588-
intel_update_primary_plane(intel_crtc);
589-
590573
if (key->flags) {
591574
I915_WRITE(SPRKEYVAL(pipe), key->min_value);
592575
I915_WRITE(SPRKEYMAX(pipe), key->max_value);
@@ -629,8 +612,6 @@ ivb_disable_plane(struct drm_plane *plane, struct drm_crtc *crtc)
629612
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
630613
int pipe = intel_plane->pipe;
631614

632-
intel_update_primary_plane(intel_crtc);
633-
634615
I915_WRITE(SPRCTL(pipe), I915_READ(SPRCTL(pipe)) & ~SPRITE_ENABLE);
635616
/* Can't leave the scaler enabled... */
636617
if (intel_plane->can_scale)
@@ -725,8 +706,6 @@ ilk_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
725706
linear_offset += src_h * fb->pitches[0] + src_w * pixel_size;
726707
}
727708

728-
intel_update_primary_plane(intel_crtc);
729-
730709
if (key->flags) {
731710
I915_WRITE(DVSKEYVAL(pipe), key->min_value);
732711
I915_WRITE(DVSKEYMAX(pipe), key->max_value);
@@ -764,8 +743,6 @@ ilk_disable_plane(struct drm_plane *plane, struct drm_crtc *crtc)
764743
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
765744
int pipe = intel_plane->pipe;
766745

767-
intel_update_primary_plane(intel_crtc);
768-
769746
I915_WRITE(DVSCNTR(pipe), 0);
770747
/* Disable the scaler */
771748
I915_WRITE(DVSSCALE(pipe), 0);
@@ -818,7 +795,7 @@ intel_post_enable_primary(struct drm_crtc *crtc)
818795
* @crtc: the CRTC whose primary plane is to be disabled
819796
*
820797
* Performs potentially sleeping operations that must be done before the
821-
* primary plane is enabled, such as updating FBC and IPS. Note that this may
798+
* primary plane is disabled, such as updating FBC and IPS. Note that this may
822799
* be called due to an explicit primary plane update, or due to an implicit
823800
* disable that is caused when a sprite plane completely hides the primary
824801
* plane.
@@ -844,11 +821,6 @@ intel_pre_disable_primary(struct drm_crtc *crtc)
844821
hsw_disable_ips(intel_crtc);
845822
}
846823

847-
static bool colorkey_enabled(struct intel_plane *intel_plane)
848-
{
849-
return intel_plane->ckey.flags != I915_SET_COLORKEY_NONE;
850-
}
851-
852824
static int
853825
intel_check_sprite_plane(struct drm_plane *plane,
854826
struct intel_plane_state *state)
@@ -1022,23 +994,10 @@ intel_check_sprite_plane(struct drm_plane *plane,
1022994
* If the sprite is completely covering the primary plane,
1023995
* we can disable the primary and save power.
1024996
*/
1025-
state->hides_primary = fb != NULL && drm_rect_equals(dst, clip) &&
1026-
!colorkey_enabled(intel_plane);
1027-
WARN_ON(state->hides_primary && !state->visible && intel_crtc->active);
1028-
1029997
if (intel_crtc->active) {
1030-
if (intel_crtc->primary_enabled == state->hides_primary)
1031-
intel_crtc->atomic.wait_for_flips = true;
1032-
1033-
if (intel_crtc->primary_enabled && state->hides_primary)
1034-
intel_crtc->atomic.pre_disable_primary = true;
1035-
1036998
intel_crtc->atomic.fb_bits |=
1037999
INTEL_FRONTBUFFER_SPRITE(intel_crtc->pipe);
10381000

1039-
if (!intel_crtc->primary_enabled && !state->hides_primary)
1040-
intel_crtc->atomic.post_enable_primary = true;
1041-
10421001
if (intel_wm_need_update(plane, &state->base))
10431002
intel_crtc->atomic.update_wm = true;
10441003

@@ -1081,8 +1040,6 @@ intel_commit_sprite_plane(struct drm_plane *plane,
10811040
plane->fb = fb;
10821041

10831042
if (intel_crtc->active) {
1084-
intel_crtc->primary_enabled = !state->hides_primary;
1085-
10861043
if (state->visible) {
10871044
crtc_x = state->dst.x1;
10881045
crtc_y = state->dst.y1;

0 commit comments

Comments
 (0)