Skipping the first frame will prevent uncoooked values most of the time.
However, in some unlikely cases, the second frame will be uncooked as
well.
Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
struct drm_crtc_state base;
struct dc_stream_state *stream;
struct drm_crtc_state base;
struct dc_stream_state *stream;
- bool crc_first_skipped;
- /* Reset crc_skipped flag on dm state */
- crtc_state->crc_first_skipped = false;
+ /* Reset crc_skipped on dm state */
+ crtc_state->crc_skip_count = 0;
/*
* Since flipping and crc enablement happen asynchronously, we - more
* often than not - will be returning an 'uncooked' crc on first frame.
/*
* Since flipping and crc enablement happen asynchronously, we - more
* often than not - will be returning an 'uncooked' crc on first frame.
- * Probably because hw isn't ready yet. Simply skip the first crc
- * value.
+ * Probably because hw isn't ready yet. For added security, skip the
+ * first two CRC values.
- if (!crtc_state->crc_first_skipped) {
- crtc_state->crc_first_skipped = true;
+ if (crtc_state->crc_skip_count < 2) {
+ crtc_state->crc_skip_count += 1;