Commit d50daf01 authored by Kristian H. Kristensen's avatar Kristian H. Kristensen Committed by Commit Bot

ozone/gbm_buffer: Always set format_modifier_

We only set the format_modifier_ field if the GBM_BO_USE_SCANOUT flags
was set. On platforms where we can't scanout NV12, we fall back to
allocating GbmBuffers without the scanout flag and consequently end up
assuming those are all linear. Except libva, which picks up the tiling
from the kernel bo and decodes with y-tiling enabled.

We need to always and unconditionally store the format modifier, it's
as much part of the buffer meta data as the pixel format. Move
assignment to initializers.

Bug: 845076
Test: crosvideo.appspot.com plays correctly on pre-KBL Intel chromebooks
Change-Id: I74c435807947afb60ea4417ace39751e213792bc
Reviewed-on: https://chromium-review.googlesource.com/1070995
Commit-Queue: Daniele Castagna <dcastagna@chromium.org>
Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561380}
parent b74c8557
......@@ -40,6 +40,7 @@ GbmBuffer::GbmBuffer(const scoped_refptr<GbmDevice>& gbm,
const std::vector<gfx::NativePixmapPlane>&& planes)
: drm_(gbm),
bo_(bo),
format_modifier_(modifier),
format_(format),
flags_(flags),
fds_(std::move(fds)),
......@@ -50,7 +51,6 @@ GbmBuffer::GbmBuffer(const scoped_refptr<GbmDevice>& gbm,
framebuffer_pixel_format_ = format;
opaque_framebuffer_pixel_format_ = GetFourCCFormatForOpaqueFramebuffer(
GetBufferFormatFromFourCCFormat(format));
format_modifier_ = modifier;
uint32_t handles[4] = {0};
uint32_t strides[4] = {0};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment