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:51 +0300
committerJani Nikula <jani.nikula@intel.com>2024-09-23 09:54:16 +0300
commitb0e9af07cbfeee89dc4df21bb68c0c741d3b511a (patch)
treeae35a58a20279ffd2b0d6609fc06d725d1b72b8b /drivers/gpu/drm/i915/display/intel_dp_test.c
parent79228153adbb361d01590ed9a3b442e09e3cabb1 (diff)
drm/i915/dp: add intel_dp_test_reset() and intel_dp_test_short_pulse()
Abstract more DP test stuff. Now the only place touching intel_dp->compliance is intel_dp_test.c. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/ea2ad218bdba21be30bd15a3707663508518dfa5.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.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_dp_test.c b/drivers/gpu/drm/i915/display/intel_dp_test.c
index 8426c8ef947e..e05819300d77 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_test.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_test.c
@@ -6,6 +6,7 @@
#include <drm/display/drm_dp.h>
#include <drm/display/drm_dp_helper.h>
#include <drm/drm_edid.h>
+#include <drm/drm_probe_helper.h>
#include "i915_drv.h"
#include "i915_reg.h"
@@ -17,6 +18,15 @@
#include "intel_dp_mst.h"
#include "intel_dp_test.h"
+void intel_dp_test_reset(struct intel_dp *intel_dp)
+{
+ /*
+ * Clearing compliance test variables to allow capturing
+ * of values for next automated test request.
+ */
+ memset(&intel_dp->compliance, 0, sizeof(intel_dp->compliance));
+}
+
/* Adjust link config limits based on compliance test requests. */
void intel_dp_test_compute_config(struct intel_dp *intel_dp,
struct intel_crtc_state *pipe_config,
@@ -510,6 +520,33 @@ bool intel_dp_test_phy(struct intel_dp *intel_dp)
return true;
}
+bool intel_dp_test_short_pulse(struct intel_dp *intel_dp)
+{
+ struct intel_display *display = to_intel_display(intel_dp);
+ bool reprobe_needed = false;
+
+ switch (intel_dp->compliance.test_type) {
+ case DP_TEST_LINK_TRAINING:
+ drm_dbg_kms(display->drm,
+ "Link Training Compliance Test requested\n");
+ /* Send a Hotplug Uevent to userspace to start modeset */
+ drm_kms_helper_hotplug_event(display->drm);
+ break;
+ case DP_TEST_LINK_PHY_TEST_PATTERN:
+ drm_dbg_kms(display->drm,
+ "PHY test pattern Compliance Test requested\n");
+ /*
+ * Schedule long hpd to do the test
+ *
+ * FIXME get rid of the ad-hoc phy test modeset code
+ * and properly incorporate it into the normal modeset.
+ */
+ reprobe_needed = true;
+ }
+
+ return reprobe_needed;
+}
+
static ssize_t i915_displayport_test_active_write(struct file *file,
const char __user *ubuf,
size_t len, loff_t *offp)