Commit 545f05e8 authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2ip: fail when trying to build an IP with USERPTR storage type

The V4L2 IP only supports MMAP and DMABUF as storage types for
output buffers. Make sure to fail building the IP if the client
requests output storage to be user memory, so we can fall back
to another IP in this case.

Bug: None
Test: image_processor_test on Kukui and Hana falls back to libyuvIP
instead of failing to queue the USERPTR output buffer.

Change-Id: I3c66d6eb8aecaf4240b4ceac516d3c43b4d6e141
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2123498Reviewed-by: default avatarChih-Yu Huang <akahuang@chromium.org>
Reviewed-by: default avatarJeffrey Kardatzke <jkardatzke@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812560}
parent 4c77bb64
......@@ -146,6 +146,7 @@ V4L2ImageProcessorBackend::V4L2ImageProcessorBackend(
base::SingleThreadTaskRunnerThreadMode::DEDICATED)) {
DVLOGF(2);
DETACH_FROM_SEQUENCE(poll_sequence_checker_);
DCHECK_NE(output_memory_type_, V4L2_MEMORY_USERPTR);
backend_weak_this_ = backend_weak_this_factory_.GetWeakPtr();
poll_weak_this_ = poll_weak_this_factory_.GetWeakPtr();
......@@ -284,7 +285,7 @@ V4L2ImageProcessorBackend::CreateWithOutputMode(
VideoFrame::StorageType output_storage_type = VideoFrame::STORAGE_UNKNOWN;
for (auto output_type : output_config.preferred_storage_types) {
v4l2_memory v4l2_memory_type = InputStorageTypeToV4L2Memory(output_type);
if (v4l2_memory_type == V4L2_MEMORY_USERPTR ||
if (v4l2_memory_type == V4L2_MEMORY_MMAP ||
v4l2_memory_type == V4L2_MEMORY_DMABUF) {
output_storage_type = output_type;
break;
......
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