Index: media/gpu/vaapi_drm_picture.cc |
diff --git a/media/gpu/vaapi_drm_picture.cc b/media/gpu/vaapi_drm_picture.cc |
index b6e1f13731f76f636ec235ec48e8b0a81207506b..6220f134616be58b4b42b43beaf44ad80c491278 100644 |
--- a/media/gpu/vaapi_drm_picture.cc |
+++ b/media/gpu/vaapi_drm_picture.cc |
@@ -50,6 +50,9 @@ static unsigned BufferFormatToInternalFormat(gfx::BufferFormat format) { |
case gfx::BufferFormat::YVU_420: |
return GL_RGB_YCRCB_420_CHROMIUM; |
+ case gfx::BufferFormat::YUV_420_BIPLANAR: |
+ return GL_RGB_YCBCR_420V_CHROMIUM; |
+ |
default: |
NOTREACHED(); |
return GL_BGRA_EXT; |
@@ -104,8 +107,11 @@ bool VaapiDrmPicture::Initialize() { |
bool VaapiDrmPicture::Allocate(gfx::BufferFormat format) { |
ui::OzonePlatform* platform = ui::OzonePlatform::GetInstance(); |
ui::SurfaceFactoryOzone* factory = platform->GetSurfaceFactoryOzone(); |
- pixmap_ = factory->CreateNativePixmap(gfx::kNullAcceleratedWidget, size_, |
- format, gfx::BufferUsage::SCANOUT); |
+ // TODO(dshwang): make it scanout when cros kernel supports NV12 overlay. |
+ // crbug.com/683347 |
gurchetansingh
2017/06/22 23:31:59
Shouldn't you be able to query drm plane resources
dshwang
2017/06/23 01:07:05
there is good news and bad news.
bad news: There i
gurchetansingh
2017/06/23 03:18:33
I don't understand. drmModeGetPlaneResources shou
dshwang
2017/06/23 23:25:14
Oh, that's good to know. It works. I'll make Clien
gurchetansingh
2017/06/24 01:50:48
If NV12 is not overlay-able yet, that's fine. Let
Daniele Castagna
2017/06/26 18:06:43
I'm not sure we want to dynamically pick the decod
dshwang
2017/06/28 02:08:34
In my opinion, we should choose NV12 always becaus
|
+ pixmap_ = |
+ factory->CreateNativePixmap(gfx::kNullAcceleratedWidget, size_, format, |
+ gfx::BufferUsage::GPU_READ_CPU_READ_WRITE); |
gurchetansingh
2017/06/22 23:31:59
What GBM use flags is the NV12 buffer allocated wi
dshwang
2017/06/23 01:07:05
gfx::BufferUsage::GPU_READ_CPU_READ_WRITE is conve
gurchetansingh
2017/06/23 03:18:33
That's incorrect. NV12 is Y-tiled in the upstream
dshwang
2017/06/23 23:25:14
Does "NV12 is Y-tiled in the upstream kernel" mean
gurchetansingh
2017/06/24 01:50:48
So the buffer is
1) imported into VAAPI,
2) a v
dshwang
2017/06/28 02:08:34
I could not reproduce glitch anymore after repo sy
|
if (!pixmap_) { |
DVLOG(1) << "Failed allocating a pixmap"; |
return false; |
@@ -137,7 +143,9 @@ bool VaapiDrmPicture::DownloadFromSurface( |
} |
bool VaapiDrmPicture::AllowOverlay() const { |
- return true; |
+ // TODO(dshwang): make it true when cros kernel supports NV12 overlay. |
gurchetansingh
2017/06/24 01:50:48
Should be a runtime decision based on plane resour
Daniele Castagna
2017/06/26 18:06:43
This is really just some metadata that ends up in
dshwang
2017/06/28 02:08:34
new patch set remove this change. as usage is chos
|
+ // crbug.com/683347 |
+ return false; |
} |
} // namespace media |