• Guido Urdaneta's avatar
    RELAND 3: media/gpu/vaapi_video_decoder: keep allocated VASurfaces alive · ea81f708
    Guido Urdaneta authored
    This reverts commit f97ca58f.
    
    Reason for revert: While the bot got green, the revert did not seem to be the cause. Reverting to confirm.
    
    Original change's description:
    > Revert "Reland "RELAND 2: media/gpu/vaapi_video_decoder: keep allocated VASurfaces alive""
    > 
    > This reverts commit 49422e89.
    > 
    > Reason for revert: Speculative revert.
    > Suspect of causing some failures that report Gpu issues with Wayland.
    > https://ci.chromium.org/p/chromium/builders/ci/linux-lacros-tester-rel/1109
    > Will reland if the revert does not fix the bot.
    > 
    > Original change's description:
    > > Reland "RELAND 2: media/gpu/vaapi_video_decoder: keep allocated VASurfaces alive"
    > > 
    > > This is a reland of 02aec841
    > > 
    > > Speculative revert was incorrect
    > > 
    > > Original change's description:
    > > > RELAND 2: media/gpu/vaapi_video_decoder: keep allocated VASurfaces alive
    > > >
    > > > The relanded CL was reverted due to crashes when used from ARC++:
    > > > Video Frames coming from this path are not GpuMemoryBuffers, so there's
    > > > a DCHECK not verified, and then a crash. This CL addresses that
    > > > situation, fixing `video_decode_accelerator_tests --use_vd_vda`:
    > > > see crrev.com/c/2359734/1..3.
    > > >
    > > > Bug: b:163920993
    > > >
    > > > Original RELAND description -------------------------------------------
    > > >
    > > > The original CL was reverted due to crashes in betty initialization:
    > > > betty is a VM which doesn't support VA, so the VideoDecoderPipeline
    > > > constructed-destructed a VaapiVideoDecoder, hitting an unprotected
    > > > nullptr |vaapi_wrapper_| in dtor. Fix in crrev.com/c/2339494/2..3.
    > > >
    > > > TBR=andrescj@chromium.org
    > > >
    > > > Original CL description -----------------------------------------------
    > > >
    > > > Certain platforms and codecs suffer from horrible artifacts (Intel BYT,
    > > > H264) or crashes (Intel BSW/BDW, VP9). This was traced to some kind of
    > > > error in the tracking of the VASurfaces lifetime in the driver: every
    > > > time we get a new resource from the pool to decode onto, this is
    > > > imported into libva as a VASurface: this works fine almost everywhere
    > > > but doesn't play well in these old platforms (see CreateSurface() body).
    > > >
    > > > This CL adds a map that keeps the ref-counted VASurfaces alive and
    > > > indexed by the unique GpuMemoryBufferId until the VA Context is
    > > > destroyed. In so doing, we're basically observing the "contract" of
    > > > va.h vaDestroySurfaces() [1] "Surfaces can only be destroyed after all
    > > > contexts using these surfaces have been destroyed".
    > > >
    > > > [1] https://github.com/intel/libva/blob/libva-2.0.0/va/va.h#L1134
    > > >
    > > > Bug: b:142019786 b:143323596
    > > > Change-Id: I16e74eb2b483b892961eca27aed30112240aa8ba
    > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2339494
    > > > Reviewed-by: Miguel Casas <mcasas@chromium.org>
    > > > Commit-Queue: Miguel Casas <mcasas@chromium.org>
    > > > Cr-Original-Commit-Position: refs/heads/master@{#795026}
    > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2359734
    > > > Reviewed-by: Andres Calderon Jaramillo <andrescj@chromium.org>
    > > > Commit-Queue: Andres Calderon Jaramillo <andrescj@chromium.org>
    > > > Auto-Submit: Miguel Casas <mcasas@chromium.org>
    > > > Cr-Commit-Position: refs/heads/master@{#798931}
    > > 
    > > TBR=mcasas@chromium.org,andrescj@chromium.org
    > > 
    > > Bug: b:163920993
    > > Bug: b:142019786 b:143323596
    > > No-Presubmit: true
    > > No-Tree-Checks: true
    > > No-Try: true
    > > Change-Id: I6124e960d93f6985dbf9a546bc9d34372815e002
    > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2359975
    > > Reviewed-by: Fergus Dall <sidereal@google.com>
    > > Commit-Queue: Fergus Dall <sidereal@google.com>
    > > Cr-Commit-Position: refs/heads/master@{#798968}
    > 
    > TBR=mcasas@chromium.org,andrescj@chromium.org,sidereal@google.com
    > 
    > Change-Id: I5a6c92e18abcfd4d16f67942fa882fdb6cbe4001
    > No-Presubmit: true
    > No-Tree-Checks: true
    > No-Try: true
    > Bug: b:163920993
    > Bug: b:142019786 b:143323596
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2362247
    > Reviewed-by: Guido Urdaneta <guidou@chromium.org>
    > Commit-Queue: Guido Urdaneta <guidou@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#799038}
    
    TBR=mcasas@chromium.org,guidou@chromium.org,andrescj@chromium.org,sidereal@google.com
    
    # Not skipping CQ checks because this is a reland.
    
    Bug: b:163920993
    Bug: b:142019786 b:143323596
    Change-Id: I17db054c9f09739a3b9486b53bad3bec42af40ce
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2362747Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
    Commit-Queue: Miguel Casas <mcasas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#799078}
    ea81f708
vaapi_video_decoder.h 6.98 KB