• Todd Previte's avatar
    drm: Add edid_corrupt flag for Displayport Link CTS 4.2.2.6 · 6ba2bd3d
    Todd Previte authored
    Displayport compliance test 4.2.2.6 requires that a source device be capable of
    detecting a corrupt EDID. The test specification states that the sink device
    sets up the EDID with an invalid checksum. To do this, the sink sets up an
    invalid EDID header, expecting the source device to generate the checksum and
    compare it to the value stored in the last byte of the block data.
    
    Unfortunately, the DRM EDID reading and parsing functions are actually too good
    in this case; the header is fixed before the checksum is computed and thus the
    test never sees the invalid checksum. This results in a failure to pass the
    compliance test.
    
    To correct this issue, when the EDID code detects that the header is invalid,
    a flag is set to indicate that the EDID is corrupted. In this case, it sets
    edid_corrupt flag and continues with its fix-up code. This flag is also set in
    the case of a more seriously damaged header (fixup score less than the
    threshold). For consistency, the edid_corrupt flag is also set when the
    checksum is invalid as well.
    
    V2:
    - Removed the static bool global
    - Added a bool to the drm_connector struct to reaplce the static one for
      holding the status of raw edid header corruption detection
    - Modified the function signature of the is_valid function to take an
      additional parameter to store the corruption detected value
    - Fixed the other callers of the above is_valid function
    V3:
    - Updated the commit message to be more clear about what and why this
      patch does what it does.
    - Added comment in code to clarify the operations there
    - Removed compliance variable and check_link_status update; those
      have been moved to a later patch
    - Removed variable assignment from the bottom of the test handler
    V4:
    - Removed i915 tag from subject line as the patch is not i915-specific
    V5:
    - Moved code causing a compilation error to this patch where the variable
      is actually declared
    - Maintained blank lines / spacing so as to not contaminate the patch
    V6:
    - Removed extra debug messages
    - Added documentation to for the added parameter on drm_edid_block_valid
    - Fixed more whitespace issues in check_link_status
    - Added a clear of the header_corrupt flag to the end of the test handler
      in intel_dp.c
    - Changed the usage of the new function prototype in several places to use
      NULL where it is not needed by compliance testing
    V7:
    - Updated to account for long_pulse flag propagation
    V8:
    - Removed clearing of header_corrupt flag from the test handler in intel_dp.c
    - Added clearing of header_corrupt flag in the drm_edid_block_valid function
    V9:
    - Renamed header_corrupt flag to edid_corrupt to more accurately reflect its
      value and purpose
    - Updated commit message
    V10:
    - Updated for versioning and patch swizzle
    - Revised the title to more accurately reflect the nature and contents of
      the patch
    - Fixed formatting/whitespace problems
    - Added set flag when computed checksum is invalid
    Signed-off-by: default avatarTodd Previte <tprevite@gmail.com>
    Cc: dri-devel@lists.freedesktop.org
    Acked-by: default avatarDave Airlie <airlied@redhat.com>
    Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    6ba2bd3d
drm_edid_load.c 9.61 KB