virtio-gpu: Allocate buffers with shared bind flag using gbm.

BUG=chromium:972237
TEST=eglgears_wayland

Change-Id: If5a09c1ad95dfdbd47e7810c466c127c53413f21
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1657291
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: David Riley <davidriley@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
This commit is contained in:
David Riley 2019-06-12 16:35:32 -07:00 committed by Commit Bot
parent aa36a2923a
commit 996beb6499
2 changed files with 3 additions and 1 deletions

View file

@ -21,6 +21,7 @@ use gpu_display::*;
use gpu_renderer::{
format_fourcc as renderer_fourcc, Box3, Context as RendererContext, Image as RendererImage,
Renderer, Resource as GpuRendererResource, ResourceCreateArgs, VIRGL_RES_BIND_SCANOUT,
VIRGL_RES_BIND_SHARED,
};
use super::protocol::{
@ -704,7 +705,7 @@ impl Backend {
}
pub fn allocate_using_minigbm(args: ResourceCreateArgs) -> bool {
args.bind & VIRGL_RES_BIND_SCANOUT != 0
args.bind & (VIRGL_RES_BIND_SCANOUT | VIRGL_RES_BIND_SHARED) != 0
&& args.depth == 1
&& args.array_size == 1
&& args.last_level == 0

View file

@ -39,6 +39,7 @@ use crate::generated::virglrenderer::*;
pub use crate::command_buffer::CommandBufferBuilder;
pub use crate::generated::virglrenderer::{
virgl_renderer_resource_create_args, virgl_renderer_resource_info, VIRGL_RES_BIND_SCANOUT,
VIRGL_RES_BIND_SHARED,
};
pub use crate::pipe_format_fourcc::pipe_format_fourcc as format_fourcc;