New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 844303 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Use vaMapBuffer() to avoid casting to non-cost pointer when calling VaapiWrapper::SubmitBuffer()

Project Member Reported by posciak@chromium.org, May 18 2018

Issue description

We are currently casting to non-cost when passing pointers to VaapiWrapper::SubmitBuffer(), as vaCreateBuffer() declares the buffer pointer passed to it as pointing to non-const data (the documentation of it however says that the data will be copied out, and the implementation does so as well).

We can avoid this by mapping server-side memory via the vaMapBuffer() call instead, similarly to what VaapiWrapper::SubmitVAEncMiscParamBuffer() does.
 
Cc: posciak@chromium.org
Owner: selcott@chromium.org
Status: Assigned (was: Untriaged)
Labels: videoshortlist
Status: Started (was: Assigned)

Comment 4 by mcasas@chromium.org, May 31 2018

Components: Internals>GPU>Video
Labels: GPU-Intel OS-Chrome
Project Member

Comment 5 by bugdroid1@chromium.org, Jun 6 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/dbb57509d78498db27327d20883b4175001d793d

commit dbb57509d78498db27327d20883b4175001d793d
Author: Sharif Elcott <selcott@chromium.org>
Date: Wed Jun 06 14:34:47 2018

Change Vaapi::SubmitBuffer() to accept a const buffer.

Previously we were casting away const at call sites because vaCreateBuffer
accepts a non-const buffer. However its documentation says that the data
will be copied out, and the implementation does so as well.
We can avoid this by mapping server-side memory via vaMapBuffer and copying
it ourselves, as VaapiWrapper::SubmitVAEncMiscParamBuffer does.

Bug:  844303 
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I4d66d0d6ee5e672d22a5dbe4073244515fa1b14d
Reviewed-on: https://chromium-review.googlesource.com/1080495
Commit-Queue: Sharif Elcott <selcott@chromium.org>
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#564878}
[modify] https://crrev.com/dbb57509d78498db27327d20883b4175001d793d/media/gpu/vaapi/vaapi_h264_accelerator.cc
[modify] https://crrev.com/dbb57509d78498db27327d20883b4175001d793d/media/gpu/vaapi/vaapi_video_encode_accelerator.cc
[modify] https://crrev.com/dbb57509d78498db27327d20883b4175001d793d/media/gpu/vaapi/vaapi_vp8_accelerator.cc
[modify] https://crrev.com/dbb57509d78498db27327d20883b4175001d793d/media/gpu/vaapi/vaapi_vp9_accelerator.cc
[modify] https://crrev.com/dbb57509d78498db27327d20883b4175001d793d/media/gpu/vaapi/vaapi_wrapper.cc
[modify] https://crrev.com/dbb57509d78498db27327d20883b4175001d793d/media/gpu/vaapi/vaapi_wrapper.h

Status: Fixed (was: Started)

Sign in to add a comment