Skip to content

Commit d34b59d

Browse files
committed
drm/i915: Add skl_wm_plane_disable_noatomic()
Add skl_wm_plane_disable_noatomic() which will clear out all the ddb and wm state for the plane. And let's do this _before_ we call plane->disable_arm() so that it'll actually clear out the state in the hardware as well. Currently this won't do anything new for most of the intel_plane_disable_noatomic() calls since those are done before wm readout, and thus everything wm/ddb related in the state will still be zeroed anyway. The only difference will be for skl_dbuf_sanitize() is happens after wm readout. But I'll be reordering thigns so that wm readout happens earlier and at that point this will guarantee that we still clear out the old wm/ddb junk from the state. Reviewed-by: Vinod Govindapillai <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 1dc6076 commit d34b59d

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,8 @@ void intel_plane_disable_noatomic(struct intel_crtc *crtc,
678678
intel_set_plane_visible(crtc_state, plane_state, false);
679679
intel_plane_fixup_bitmasks(crtc_state);
680680

681+
skl_wm_plane_disable_noatomic(crtc, plane);
682+
681683
if ((crtc_state->active_planes & ~BIT(PLANE_CURSOR)) == 0 &&
682684
hsw_ips_disable(crtc_state)) {
683685
crtc_state->ips_enabled = false;

drivers/gpu/drm/i915/display/skl_watermark.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3867,6 +3867,28 @@ void skl_wm_crtc_disable_noatomic(struct intel_crtc *crtc)
38673867
memset(&crtc_state->wm.skl.ddb, 0, sizeof(crtc_state->wm.skl.ddb));
38683868
}
38693869

3870+
void skl_wm_plane_disable_noatomic(struct intel_crtc *crtc,
3871+
struct intel_plane *plane)
3872+
{
3873+
struct intel_display *display = to_intel_display(crtc);
3874+
struct intel_crtc_state *crtc_state =
3875+
to_intel_crtc_state(crtc->base.state);
3876+
3877+
if (DISPLAY_VER(display) < 9)
3878+
return;
3879+
3880+
skl_ddb_entry_init(&crtc_state->wm.skl.plane_ddb[plane->id], 0, 0);
3881+
skl_ddb_entry_init(&crtc_state->wm.skl.plane_ddb[plane->id], 0, 0);
3882+
3883+
crtc_state->wm.skl.plane_min_ddb[plane->id] = 0;
3884+
crtc_state->wm.skl.plane_interim_ddb[plane->id] = 0;
3885+
3886+
memset(&crtc_state->wm.skl.raw.planes[plane->id], 0,
3887+
sizeof(crtc_state->wm.skl.raw.planes[plane->id]));
3888+
memset(&crtc_state->wm.skl.optimal.planes[plane->id], 0,
3889+
sizeof(crtc_state->wm.skl.optimal.planes[plane->id]));
3890+
}
3891+
38703892
void intel_wm_state_verify(struct intel_atomic_state *state,
38713893
struct intel_crtc *crtc)
38723894
{

drivers/gpu/drm/i915/display/skl_watermark.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ void intel_wm_state_verify(struct intel_atomic_state *state,
4242
struct intel_crtc *crtc);
4343

4444
void skl_wm_crtc_disable_noatomic(struct intel_crtc *crtc);
45+
void skl_wm_plane_disable_noatomic(struct intel_crtc *crtc,
46+
struct intel_plane *plane);
4547

4648
void skl_watermark_ipc_init(struct drm_i915_private *i915);
4749
void skl_watermark_ipc_update(struct drm_i915_private *i915);

0 commit comments

Comments
 (0)