Skip to content

Commit 85bb289

Browse files
vsyrjalatursulin
authored andcommitted
drm/i915: Populate pipe dbuf slices more accurately during readout
During readout we cannot assume the planes are actually using the slices they are supposed to use. The BIOS may have misprogrammed things and put the planes onto the wrong dbuf slices. So let's do the readout more carefully to make sure we really know which dbuf slices are actually in use by the pipe at the time. Cc: <[email protected]> # v5.14+ Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Stanislav Lisovskiy <[email protected]> (cherry picked from commit b3dcc6d) Signed-off-by: Tvrtko Ursulin <[email protected]>
1 parent 8fd5a26 commit 85bb289

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6651,6 +6651,7 @@ void skl_wm_get_hw_state(struct drm_i915_private *dev_priv)
66516651
enum pipe pipe = crtc->pipe;
66526652
unsigned int mbus_offset;
66536653
enum plane_id plane_id;
6654+
u8 slices;
66546655

66556656
skl_pipe_wm_get_hw_state(crtc, &crtc_state->wm.skl.optimal);
66566657
crtc_state->wm.skl.raw = crtc_state->wm.skl.optimal;
@@ -6670,20 +6671,22 @@ void skl_wm_get_hw_state(struct drm_i915_private *dev_priv)
66706671
skl_ddb_entry_union(&dbuf_state->ddb[pipe], ddb_uv);
66716672
}
66726673

6673-
dbuf_state->slices[pipe] =
6674-
skl_compute_dbuf_slices(crtc, dbuf_state->active_pipes,
6675-
dbuf_state->joined_mbus);
6676-
66776674
dbuf_state->weight[pipe] = intel_crtc_ddb_weight(crtc_state);
66786675

66796676
/*
66806677
* Used for checking overlaps, so we need absolute
66816678
* offsets instead of MBUS relative offsets.
66826679
*/
6683-
mbus_offset = mbus_ddb_offset(dev_priv, dbuf_state->slices[pipe]);
6680+
slices = skl_compute_dbuf_slices(crtc, dbuf_state->active_pipes,
6681+
dbuf_state->joined_mbus);
6682+
mbus_offset = mbus_ddb_offset(dev_priv, slices);
66846683
crtc_state->wm.skl.ddb.start = mbus_offset + dbuf_state->ddb[pipe].start;
66856684
crtc_state->wm.skl.ddb.end = mbus_offset + dbuf_state->ddb[pipe].end;
66866685

6686+
/* The slices actually used by the planes on the pipe */
6687+
dbuf_state->slices[pipe] =
6688+
skl_ddb_dbuf_slice_mask(dev_priv, &crtc_state->wm.skl.ddb);
6689+
66876690
drm_dbg_kms(&dev_priv->drm,
66886691
"[CRTC:%d:%s] dbuf slices 0x%x, ddb (%d - %d), active pipes 0x%x, mbus joined: %s\n",
66896692
crtc->base.base.id, crtc->base.name,

0 commit comments

Comments
 (0)