From: Daniel Vetter <daniel@ffwll.ch>
To: Todd Previte <tprevite@gmail.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/6] drm/i915: Implement basic Displayport automated testing function for EDID operations
Date: Mon, 7 Jul 2014 17:37:38 +0200 [thread overview]
Message-ID: <20140707153738.GI5821@phenom.ffwll.local> (raw)
In-Reply-To: <1403647974-42377-4-git-send-email-tprevite@gmail.com>
On Tue, Jun 24, 2014 at 03:12:51PM -0700, Todd Previte wrote:
> Implements some of the basic EDID tests for Displayport compliance. These tests
> include reading the EDID, verifying the checksum and writing the test responses
> back to the sink device.
>
> Signed-off-by: Todd Previte <tprevite@gmail.com>
> ---
> drivers/gpu/drm/i915/intel_dp.c | 36 +++++++++++++++++++++++++++++++++++-
> 1 file changed, 35 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 43fcabe..d060853 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -3352,8 +3352,42 @@ intel_dp_autotest_video_pattern(struct intel_dp *intel_dp)
> static uint8_t
> intel_dp_autotest_edid(struct intel_dp *intel_dp)
> {
> + struct drm_connector *connector = &intel_dp->attached_connector->base;
> + struct i2c_adapter *adapter = &intel_dp->aux.ddc;
> + struct edid *edid_read = NULL;
> + uint8_t *edid_data = NULL;
> uint8_t test_result = DP_TEST_NAK;
> - return test_result;
> + uint32_t i = 0, ret = 0, checksum = 0;
> + struct drm_display_mode *use_mode = NULL;
> + dp_compliance_mode comp_mode_type = DP_COMPLIANCE_MODE_PREFERRED;
> + int mode_count = 0;
> +
> + edid_read = drm_get_edid(connector, adapter);
> +
> + DRM_DEBUG_KMS("Displayport: EDID automated test\n");
> +
> + if (edid_read) {
> + test_result = true;
> + edid_data = (uint8_t*) edid_read;
> + // Compute checksum
Checkpatch isn't approving of // style comments, and there's other issues.
-Daniel
> + for (i = 0; i < 128; i++)
> + checksum += edid_data[i];
> +
> + DRM_DEBUG_KMS("Displayport: EDID test - computed byte sum = %02x\n", checksum);
> + // Verify EDID checksum
> + if (checksum % 256 == 0) {
> + /* Write the checksum to EDID checksum register */
> + ret = drm_dp_dpcd_write(&intel_dp->aux, DP_TEST_EDID_CHECKSUM, &edid_read->checksum, 1);
> + // Reponse is ACK and and checksum written
> + test_result = DP_TEST_ACK | DP_TEST_EDID_CHECKSUM_WRITE;
> + DRM_DEBUG_KMS("Displayport: EDID test - checksum = %02x\n", edid_read->checksum);
> + }
> + else {
> + // Invalid checksum, set for failsafe mode
> + comp_mode_type = DP_COMPLIANCE_MODE_FAILSAFE;
> + }
> + }
> + return test_result;
> }
>
> /* Displayport compliance testing - PHY pattern testing */
> --
> 1.9.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
next prev parent reply other threads:[~2014-07-07 15:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-24 22:12 i915 Displayport Compliance Testing Todd Previte
2014-06-24 22:12 ` [PATCH 1/6] drm/i915: Add automated testing support for Displayport compliance testing Todd Previte
2014-06-24 22:12 ` [PATCH 2/6] drm/i915: Add a delay in Displayport AUX transactions for " Todd Previte
2014-06-25 6:45 ` Chris Wilson
2014-06-24 22:12 ` [PATCH 3/6] drm/i915: Implement basic Displayport automated testing function for EDID operations Todd Previte
2014-06-25 7:57 ` Jani Nikula
2014-07-07 15:37 ` Daniel Vetter [this message]
2014-06-24 22:12 ` [PATCH 4/6] drm/i915: Update Displayport compliance test " Todd Previte
2014-06-24 22:12 ` [PATCH 5/6] drm/i915: Update Displayport compliance testing for link training Todd Previte
2014-06-24 22:12 ` [PATCH 6/6] drm/i915: Update intel_dp_check_link_status() for Displayport compliance testing Todd Previte
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140707153738.GI5821@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=tprevite@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox