Repository navigation
decoder: Add reader-side DATA_SYNC() barriers after MB-map polls - #163
Merged
Merged
Conversation
Add DATA_SYNC() immediately after CHECK_MB_MAP_BYTE succeeds in ih264d_decode_recon_tfr_nmb_thread(), ih264d_decode_slice_thread(), ih264d_check_mb_map_deblk(), and both wait loops in ih264d_recon_deblk_slice(). The writer paths (ih264d_parse_tfr_nmb() and ih264d_decode_recon_tfr_nmb_thread()) already execute DATA_SYNC() before UPDATE_MB_MAP_MBNUM_BYTE to order MB metadata (pu2_slice_num_map, ps_frm_mb_info, slice info) and reconstructed pixels before setting the map flag. On weakly ordered architectures (ARMv8/ARMv7/RISC-V), a control dependency alone does not prevent speculative Load->Load reordering across the branch, allowing readers to observe stale payload data after seeing the flag set. The reader-side DATA_SYNC() completes the release/acquire pairing. Bug: 587588029 Test: ctest Change-Id: I1329d805415428559272d5258b51cf5759135454
… polls Add DATA_SYNC() immediately after CHECK_MB_MAP_BYTE succeeds in isvcd_decode_recon_tfr_nmb_thread() and isvcd_decode_slice_thread(), and after observing ps_dec->cur_dec_mb_num advance (bs_mb_grp > 0) in the 2-core BS/deblocking loop of isvcd_video_decode(). The writer paths (ih264d_parse_tfr_nmb() and isvcd_decode_recon_tfr_nmb_thread()) already execute DATA_SYNC() before updating pu1_dec_mb_map, pu1_recon_mb_map, and cur_dec_mb_num to order MB metadata (pu2_slice_num_map, ps_frm_mb_info, ps_svc_frm_mb_info, slice info), residual NNZ (pu2_frm_res_luma_csbp), and reconstructed pixels before publishing completion. On weakly ordered architectures (ARMv8/ARMv7/RISC-V), a control dependency alone does not prevent speculative Load->Load reordering across the branch, allowing readers to observe stale payload data after seeing the flag or counter updated. The reader-side DATA_SYNC() completes the release/acquire pairing. Bug: 587588029 Test: svcdec 1-core vs 2-core bit-exact check on 2-layer CAVLC/CABAC streams Change-Id: I8f3c6a9e2b4d7015a6c8e4f91b3d2075c9e1a4b8
Member
Author
|
This is verified by two different teams independently. So will go ahead and land this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add DATA_SYNC() immediately after CHECK_MB_MAP_BYTE succeeds in ih264d_decode_recon_tfr_nmb_thread(), ih264d_decode_slice_thread(), ih264d_check_mb_map_deblk(), and both wait loops in ih264d_recon_deblk_slice().
The writer paths (ih264d_parse_tfr_nmb() and
ih264d_decode_recon_tfr_nmb_thread()) already execute DATA_SYNC() before UPDATE_MB_MAP_MBNUM_BYTE to order MB metadata (pu2_slice_num_map, ps_frm_mb_info, slice info) and reconstructed pixels before setting the map flag. On weakly ordered architectures (ARMv8/ARMv7/RISC-V), a control dependency alone does not prevent speculative Load->Load reordering across the branch, allowing readers to observe stale payload data after seeing the flag set. The reader-side DATA_SYNC() completes the release/acquire pairing.
Bug: 587588029
Test: ctest