v4l2_stateful_decoder: make --mmap work on devices without video cards

The argument --mmap changes the decoder to use V4L2_MEMORY_MMAP buffers
instead of the default V4L2_MEMORY_DMABUF buffers which are created by
minigbm. When using --mmap, we do not need to open DRM or minigbm file
descriptor.

This moves the code which opens the DRM file descriptor into a
conditional based on the memory buffer type.

BUG=b:234170487
TEST=v4l2_stateful_decoder --mmap on herobrine IDP2

Change-Id: I5ca00e8a8e8ff0673b78dd645219a5540f0a41d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/drm-tests/+/3674002
Auto-Submit: Nathan Hebert <nhebert@chromium.org>
Reviewed-by: Fritz Koenig <frkoenig@chromium.org>
Commit-Queue: Nathan Hebert <nhebert@chromium.org>
Tested-by: Nathan Hebert <nhebert@chromium.org>
1 file changed