Skip to content

Commit 8fd5a26

Browse files
vsyrjalatursulin
authored andcommitted
drm/i915: Allow !join_mbus cases for adlp+ dbuf configuration
Reintroduce the !join_mbus single pipe cases for adlp+. Due to the mbus relative dbuf offsets in PLANE_BUF_CFG we need to know the actual slices used by the pipe when doing readout, even when mbus joining isn't enabled. Accurate readout will be needed to properly sanitize invalid BIOS dbuf configurations. This will also make it much easier to play around with the !join_mbus configs for testin/workaround purposes. 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 eef1739) Signed-off-by: Tvrtko Ursulin <[email protected]>
1 parent 9d7516b commit 8fd5a26

File tree

1 file changed

+46
-20
lines changed

1 file changed

+46
-20
lines changed

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 46 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4717,6 +4717,10 @@ static const struct dbuf_slice_conf_entry dg2_allowed_dbufs[] = {
47174717
};
47184718

47194719
static const struct dbuf_slice_conf_entry adlp_allowed_dbufs[] = {
4720+
/*
4721+
* Keep the join_mbus cases first so check_mbus_joined()
4722+
* will prefer them over the !join_mbus cases.
4723+
*/
47204724
{
47214725
.active_pipes = BIT(PIPE_A),
47224726
.dbuf_mask = {
@@ -4731,6 +4735,20 @@ static const struct dbuf_slice_conf_entry adlp_allowed_dbufs[] = {
47314735
},
47324736
.join_mbus = true,
47334737
},
4738+
{
4739+
.active_pipes = BIT(PIPE_A),
4740+
.dbuf_mask = {
4741+
[PIPE_A] = BIT(DBUF_S1) | BIT(DBUF_S2),
4742+
},
4743+
.join_mbus = false,
4744+
},
4745+
{
4746+
.active_pipes = BIT(PIPE_B),
4747+
.dbuf_mask = {
4748+
[PIPE_B] = BIT(DBUF_S3) | BIT(DBUF_S4),
4749+
},
4750+
.join_mbus = false,
4751+
},
47344752
{
47354753
.active_pipes = BIT(PIPE_A) | BIT(PIPE_B),
47364754
.dbuf_mask = {
@@ -4847,13 +4865,14 @@ static bool adlp_check_mbus_joined(u8 active_pipes)
48474865
return check_mbus_joined(active_pipes, adlp_allowed_dbufs);
48484866
}
48494867

4850-
static u8 compute_dbuf_slices(enum pipe pipe, u8 active_pipes,
4868+
static u8 compute_dbuf_slices(enum pipe pipe, u8 active_pipes, bool join_mbus,
48514869
const struct dbuf_slice_conf_entry *dbuf_slices)
48524870
{
48534871
int i;
48544872

48554873
for (i = 0; i < dbuf_slices[i].active_pipes; i++) {
4856-
if (dbuf_slices[i].active_pipes == active_pipes)
4874+
if (dbuf_slices[i].active_pipes == active_pipes &&
4875+
dbuf_slices[i].join_mbus == join_mbus)
48574876
return dbuf_slices[i].dbuf_mask[pipe];
48584877
}
48594878
return 0;
@@ -4864,7 +4883,7 @@ static u8 compute_dbuf_slices(enum pipe pipe, u8 active_pipes,
48644883
* returns correspondent DBuf slice mask as stated in BSpec for particular
48654884
* platform.
48664885
*/
4867-
static u8 icl_compute_dbuf_slices(enum pipe pipe, u8 active_pipes)
4886+
static u8 icl_compute_dbuf_slices(enum pipe pipe, u8 active_pipes, bool join_mbus)
48684887
{
48694888
/*
48704889
* FIXME: For ICL this is still a bit unclear as prev BSpec revision
@@ -4878,37 +4897,41 @@ static u8 icl_compute_dbuf_slices(enum pipe pipe, u8 active_pipes)
48784897
* still here - we will need it once those additional constraints
48794898
* pop up.
48804899
*/
4881-
return compute_dbuf_slices(pipe, active_pipes, icl_allowed_dbufs);
4900+
return compute_dbuf_slices(pipe, active_pipes, join_mbus,
4901+
icl_allowed_dbufs);
48824902
}
48834903

4884-
static u8 tgl_compute_dbuf_slices(enum pipe pipe, u8 active_pipes)
4904+
static u8 tgl_compute_dbuf_slices(enum pipe pipe, u8 active_pipes, bool join_mbus)
48854905
{
4886-
return compute_dbuf_slices(pipe, active_pipes, tgl_allowed_dbufs);
4906+
return compute_dbuf_slices(pipe, active_pipes, join_mbus,
4907+
tgl_allowed_dbufs);
48874908
}
48884909

4889-
static u32 adlp_compute_dbuf_slices(enum pipe pipe, u32 active_pipes)
4910+
static u8 adlp_compute_dbuf_slices(enum pipe pipe, u8 active_pipes, bool join_mbus)
48904911
{
4891-
return compute_dbuf_slices(pipe, active_pipes, adlp_allowed_dbufs);
4912+
return compute_dbuf_slices(pipe, active_pipes, join_mbus,
4913+
adlp_allowed_dbufs);
48924914
}
48934915

4894-
static u32 dg2_compute_dbuf_slices(enum pipe pipe, u32 active_pipes)
4916+
static u8 dg2_compute_dbuf_slices(enum pipe pipe, u8 active_pipes, bool join_mbus)
48954917
{
4896-
return compute_dbuf_slices(pipe, active_pipes, dg2_allowed_dbufs);
4918+
return compute_dbuf_slices(pipe, active_pipes, join_mbus,
4919+
dg2_allowed_dbufs);
48974920
}
48984921

4899-
static u8 skl_compute_dbuf_slices(struct intel_crtc *crtc, u8 active_pipes)
4922+
static u8 skl_compute_dbuf_slices(struct intel_crtc *crtc, u8 active_pipes, bool join_mbus)
49004923
{
49014924
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
49024925
enum pipe pipe = crtc->pipe;
49034926

49044927
if (IS_DG2(dev_priv))
4905-
return dg2_compute_dbuf_slices(pipe, active_pipes);
4928+
return dg2_compute_dbuf_slices(pipe, active_pipes, join_mbus);
49064929
else if (IS_ALDERLAKE_P(dev_priv))
4907-
return adlp_compute_dbuf_slices(pipe, active_pipes);
4930+
return adlp_compute_dbuf_slices(pipe, active_pipes, join_mbus);
49084931
else if (DISPLAY_VER(dev_priv) == 12)
4909-
return tgl_compute_dbuf_slices(pipe, active_pipes);
4932+
return tgl_compute_dbuf_slices(pipe, active_pipes, join_mbus);
49104933
else if (DISPLAY_VER(dev_priv) == 11)
4911-
return icl_compute_dbuf_slices(pipe, active_pipes);
4934+
return icl_compute_dbuf_slices(pipe, active_pipes, join_mbus);
49124935
/*
49134936
* For anything else just return one slice yet.
49144937
* Should be extended for other platforms.
@@ -6127,11 +6150,16 @@ skl_compute_ddb(struct intel_atomic_state *state)
61276150
return ret;
61286151
}
61296152

6153+
if (IS_ALDERLAKE_P(dev_priv))
6154+
new_dbuf_state->joined_mbus =
6155+
adlp_check_mbus_joined(new_dbuf_state->active_pipes);
6156+
61306157
for_each_intel_crtc(&dev_priv->drm, crtc) {
61316158
enum pipe pipe = crtc->pipe;
61326159

61336160
new_dbuf_state->slices[pipe] =
6134-
skl_compute_dbuf_slices(crtc, new_dbuf_state->active_pipes);
6161+
skl_compute_dbuf_slices(crtc, new_dbuf_state->active_pipes,
6162+
new_dbuf_state->joined_mbus);
61356163

61366164
if (old_dbuf_state->slices[pipe] == new_dbuf_state->slices[pipe])
61376165
continue;
@@ -6143,9 +6171,6 @@ skl_compute_ddb(struct intel_atomic_state *state)
61436171

61446172
new_dbuf_state->enabled_slices = intel_dbuf_enabled_slices(new_dbuf_state);
61456173

6146-
if (IS_ALDERLAKE_P(dev_priv))
6147-
new_dbuf_state->joined_mbus = adlp_check_mbus_joined(new_dbuf_state->active_pipes);
6148-
61496174
if (old_dbuf_state->enabled_slices != new_dbuf_state->enabled_slices ||
61506175
old_dbuf_state->joined_mbus != new_dbuf_state->joined_mbus) {
61516176
ret = intel_atomic_serialize_global_state(&new_dbuf_state->base);
@@ -6646,7 +6671,8 @@ void skl_wm_get_hw_state(struct drm_i915_private *dev_priv)
66466671
}
66476672

66486673
dbuf_state->slices[pipe] =
6649-
skl_compute_dbuf_slices(crtc, dbuf_state->active_pipes);
6674+
skl_compute_dbuf_slices(crtc, dbuf_state->active_pipes,
6675+
dbuf_state->joined_mbus);
66506676

66516677
dbuf_state->weight[pipe] = intel_crtc_ddb_weight(crtc_state);
66526678

0 commit comments

Comments
 (0)