summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/display/intel_dp_test.c
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2024-09-20 14:56:46 +0300
committerJani Nikula <jani.nikula@intel.com>2024-09-23 09:54:16 +0300
commitc617b5f34c9ef0ba35c3f1d76e7e813f4944aeea (patch)
tree2a032be5781ce36aa2cf4ce22a9c9292b67fe75f /drivers/gpu/drm/i915/display/intel_dp_test.c
parent2783bb2a67270da3359c1b6dc9df8918877c18aa (diff)
drm/i915/dp: clean up intel_dp_test.[ch] interface
Conform to uniform function naming. Use intel_dp. Hide checks on intel_dp->compliance within intel_dp_test.[ch]. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/c2905006d2d47040032153ca69052898529a95d5.1726833193.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_dp_test.c')
-rw-r--r--drivers/gpu/drm/i915/display/intel_dp_test.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_dp_test.c b/drivers/gpu/drm/i915/display/intel_dp_test.c
index efdf25dfef51..4608aa34df42 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_test.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_test.c
@@ -16,8 +16,7 @@
#include "intel_dp_test.h"
/* Adjust link config limits based on compliance test requests. */
-void
-intel_dp_adjust_compliance_config(struct intel_dp *intel_dp,
+void intel_dp_test_compute_config(struct intel_dp *intel_dp,
struct intel_crtc_state *pipe_config,
struct link_config_limits *limits)
{
@@ -339,7 +338,7 @@ static u8 intel_dp_autotest_phy_pattern(struct intel_dp *intel_dp)
return DP_TEST_ACK;
}
-void intel_dp_handle_test_request(struct intel_dp *intel_dp)
+void intel_dp_test_request(struct intel_dp *intel_dp)
{
struct intel_display *display = to_intel_display(intel_dp);
u8 response = DP_TEST_NAK;
@@ -477,11 +476,17 @@ static int intel_dp_do_phy_test(struct intel_encoder *encoder,
return 0;
}
-void intel_dp_phy_test(struct intel_encoder *encoder)
+bool intel_dp_test_phy(struct intel_dp *intel_dp)
{
+ struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
+ struct intel_encoder *encoder = &dig_port->base;
struct drm_modeset_acquire_ctx ctx;
int ret;
+ if (!intel_dp->compliance.test_active ||
+ intel_dp->compliance.test_type != DP_TEST_LINK_PHY_TEST_PATTERN)
+ return false;
+
drm_modeset_acquire_init(&ctx, 0);
for (;;) {
@@ -499,4 +504,6 @@ void intel_dp_phy_test(struct intel_encoder *encoder)
drm_modeset_acquire_fini(&ctx);
drm_WARN(encoder->base.dev, ret,
"Acquiring modeset locks failed with %i\n", ret);
+
+ return true;
}