Skip to content

Commit abe1cd9

Browse files
gmitulaknautiyal
authored andcommitted
drm/i915/display: Add state checker for Adaptive Sync SDP
Enable infoframe and add state checker for Adaptive Sync SDP enablement. --v1: - crtc_state->infoframes.enable, to add on correct place holder. Signed-off-by: Mitul Golani <[email protected]> Reviewed-by: Ankit Nautiyal <[email protected]> Signed-off-by: Ankit Nautiyal <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent a5bd599 commit abe1cd9

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

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

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4820,6 +4820,17 @@ intel_compare_dp_vsc_sdp(const struct drm_dp_vsc_sdp *a,
48204820
a->content_type == b->content_type;
48214821
}
48224822

4823+
static bool
4824+
intel_compare_dp_as_sdp(const struct drm_dp_as_sdp *a,
4825+
const struct drm_dp_as_sdp *b)
4826+
{
4827+
return a->vtotal == b->vtotal &&
4828+
a->target_rr == b->target_rr &&
4829+
a->duration_incr_ms == b->duration_incr_ms &&
4830+
a->duration_decr_ms == b->duration_decr_ms &&
4831+
a->mode == b->mode;
4832+
}
4833+
48234834
static bool
48244835
intel_compare_buffer(const u8 *a, const u8 *b, size_t len)
48254836
{
@@ -4890,6 +4901,30 @@ pipe_config_dp_vsc_sdp_mismatch(struct drm_printer *p, bool fastset,
48904901
drm_dp_vsc_sdp_log(p, b);
48914902
}
48924903

4904+
static void
4905+
pipe_config_dp_as_sdp_mismatch(struct drm_i915_private *i915,
4906+
bool fastset, const char *name,
4907+
const struct drm_dp_as_sdp *a,
4908+
const struct drm_dp_as_sdp *b)
4909+
{
4910+
struct drm_printer p;
4911+
4912+
if (fastset) {
4913+
p = drm_dbg_printer(&i915->drm, DRM_UT_KMS, NULL);
4914+
4915+
drm_printf(&p, "fastset requirement not met in %s dp sdp\n", name);
4916+
} else {
4917+
p = drm_err_printer(&i915->drm, NULL);
4918+
4919+
drm_printf(&p, "mismatch in %s dp sdp\n", name);
4920+
}
4921+
4922+
drm_printf(&p, "expected:\n");
4923+
drm_dp_as_sdp_log(&p, a);
4924+
drm_printf(&p, "found:\n");
4925+
drm_dp_as_sdp_log(&p, b);
4926+
}
4927+
48934928
/* Returns the length up to and including the last differing byte */
48944929
static size_t
48954930
memcmp_diff_len(const u8 *a, const u8 *b, size_t len)
@@ -5107,6 +5142,16 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
51075142
} \
51085143
} while (0)
51095144

5145+
#define PIPE_CONF_CHECK_DP_AS_SDP(name) do { \
5146+
if (!intel_compare_dp_as_sdp(&current_config->infoframes.name, \
5147+
&pipe_config->infoframes.name)) { \
5148+
pipe_config_dp_as_sdp_mismatch(dev_priv, fastset, __stringify(name), \
5149+
&current_config->infoframes.name, \
5150+
&pipe_config->infoframes.name); \
5151+
ret = false; \
5152+
} \
5153+
} while (0)
5154+
51105155
#define PIPE_CONF_CHECK_BUFFER(name, len) do { \
51115156
BUILD_BUG_ON(sizeof(current_config->name) != (len)); \
51125157
BUILD_BUG_ON(sizeof(pipe_config->name) != (len)); \
@@ -5288,6 +5333,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
52885333
PIPE_CONF_CHECK_INFOFRAME(hdmi);
52895334
PIPE_CONF_CHECK_INFOFRAME(drm);
52905335
PIPE_CONF_CHECK_DP_VSC_SDP(vsc);
5336+
PIPE_CONF_CHECK_DP_AS_SDP(as_sdp);
52915337

52925338
PIPE_CONF_CHECK_X(sync_mode_slaves_mask);
52935339
PIPE_CONF_CHECK_I(master_transcoder);

0 commit comments

Comments
 (0)