• Manasi Navare's avatar
    drm/i915: Add support for DP Video pattern compliance tests · 611032bf
    Manasi Navare authored
    The intel_dp_autotest_video_pattern() function gets invoked through the
    compliance test handler on a HPD short pulse if the test type is
    set to DP_TEST_VIDEO_PATTERN. This performs the DPCD registers
    reads to read the requested test pattern, video pattern resolution,
    frame rate and bits per color value. The results of this analysis
    are handed off to userspace so that the userspace app can set the
    video pattern mode appropriately for the test result/response.
    When the  test is requested with specific BPC value, we read the BPC
    value from the DPCD register. If this BPC value in intel_dp structure
    has a non-zero value and we're on a display port connector, then we use
    the value to calculate the bpp for the pipe. Also in this case if its
    a 18bpp video pattern request, then we force the dithering on pipe to be
    disabled since it causes CRC mismatches.
    
    The compliance_test_active flag is set at the end of the individual
    test handling functions. This is so that the kernel-side operations
    can be completed without the risk of interruption from the userspace
    app that is polling on that flag.
    
    v5:
    * Remove test_result variable
    * Populate the compliance test data at the end of the function (Jani Nikula)
    v4:
    *Return TEST_NAK on read failures and invalid values (Jani Nikula)
    * Address CRC mismatch errors
    v3:
    * Use the updated properly shifted bit definitions (Jani Nikula)
    * Force dithering to be disabled on 18bpp compliance
    test request (Manasi Navare)
    v2:
    * Updated the DPCD Register reads based on proper defines in header (Jani Nikula)
    * Squahsed the patch that forced the pipe bpp to compliance test bpp (Jani Nikula)
    Signed-off-by: default avatarManasi Navare <manasi.d.navare@intel.com>
    Cc: Jani Nikula <jani.nikula@linux.intel.com>
    Cc: Daniel Vetter <daniel.vetter@intel.com>
    Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
    Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
    Link: http://patchwork.freedesktop.org/patch/msgid/1485274909-17470-1-git-send-email-manasi.d.navare@intel.com
    611032bf
intel_dp.c 169 KB