summaryrefslogtreecommitdiffstats
path: root/cros_gralloc
diff options
context:
space:
mode:
authorKristian H. Kristensen <hoegsberg@chromium.org>2018-04-04 16:10:42 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-05-30 12:50:33 -0700
commit3cb5bbacc5c8a79105c868875222696f6b9d8296 (patch)
tree5cf290e5846a016efb0f79476ddc8db005650d95 /cros_gralloc
parent2b682fde2d2fe12b95b434a47466bc69aa08b6bd (diff)
downloadplatform_external_minigbm-3cb5bbacc5c8a79105c868875222696f6b9d8296.tar.gz
platform_external_minigbm-3cb5bbacc5c8a79105c868875222696f6b9d8296.tar.bz2
platform_external_minigbm-3cb5bbacc5c8a79105c868875222696f6b9d8296.zip
Reland "i915: Add GBM_BO_USE_HW_VIDEO_DECODER use flag"
This is a reland of 1bd7b04a3ae68c0314bdee06c559093de9e5a304 We've landed CL:1070995 which fixes the missing modifier that caused tiling corruption on pre-KBL Intel devices and CL:1072638 which makes the failing vda unittests use SCANOUT_VDA_WRITE as they were supposed to. Original change's description: > i915: Add GBM_BO_USE_HW_VIDEO_DECODER use flag > > This flag is used to indicate that the platform video decoder will be > writing into this buffer and that it should be allocated > accordingly. On Intel, this means that we have to allocate y-tiled > NV12 for libva to be able to decode to the buffer. > > We force gralloc NV12 allocations to be linear for now, since ARC++ > doesn't properly pass modifiers to ChromeOS. > > BUG=822346 > TEST=test_that graphics_Gbm > > Change-Id: I840c30d22355d26816df718b49717407e2e4620f > Reviewed-on: https://chromium-review.googlesource.com/996648 > Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> > Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org> > Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org> Bug: 822346 Change-Id: Icf0921dc91ac422da26371bffea34b26550b8234 Reviewed-on: https://chromium-review.googlesource.com/1073877 Commit-Ready: Kristian H. Kristensen <hoegsberg@chromium.org> Tested-by: Kristian H. Kristensen <hoegsberg@chromium.org> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Diffstat (limited to 'cros_gralloc')
-rw-r--r--cros_gralloc/cros_gralloc_driver.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/cros_gralloc/cros_gralloc_driver.cc b/cros_gralloc/cros_gralloc_driver.cc
index a68023e..31282bc 100644
--- a/cros_gralloc/cros_gralloc_driver.cc
+++ b/cros_gralloc/cros_gralloc_driver.cc
@@ -91,13 +91,23 @@ int32_t cros_gralloc_driver::allocate(const struct cros_gralloc_buffer_descripto
size_t num_planes;
uint32_t resolved_format;
uint32_t bytes_per_pixel;
+ uint64_t use_flags;
struct bo *bo;
struct cros_gralloc_handle *hnd;
resolved_format = drv_resolve_format(drv_, descriptor->drm_format, descriptor->use_flags);
+ use_flags = descriptor->use_flags;
+ /*
+ * TODO(b/79682290): ARC++ assumes NV12 is always linear and doesn't
+ * send modifiers across Wayland protocol, so we or in the
+ * BO_USE_LINEAR flag here. We need to fix ARC++ to allocate and work
+ * with tiled buffers.
+ */
+ if (resolved_format == DRM_FORMAT_NV12)
+ use_flags |= BO_USE_LINEAR;
bo = drv_bo_create(drv_, descriptor->width, descriptor->height, resolved_format,
- descriptor->use_flags);
+ use_flags);
if (!bo) {
drv_log("Failed to create bo.\n");
return -ENOMEM;