Commit graph

8 commits

Author SHA1 Message Date
Chia-I Wu
186908d641 virgl: use virgl_renderer_context_create_with_flags
When context_init is non-zero, pass it to virglrenderer by calling
virgl_renderer_context_create_with_flags.

BUG=b:176158397
TEST=vkcube

Change-Id: If9b8c60be7e6f1ef643077bd6a94aed0235a30f0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2634992
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: David Riley <davidriley@chromium.org>
Tested-by: Chia-I Wu <olv@google.com>
Commit-Queue: Chia-I Wu <olv@google.com>
2021-01-22 13:28:32 +00:00
Daniel Verkamp
46844e7131 rutabaga_gfx: ignore unused consts warning
Annotate the THREAD_SYNC flags with allow statements so that clippy does
not complain about them.

BUG=None
TEST=bin/clippy

Change-Id: I9d9d5d5b2a5f51e3ce49c36dd7528ad677aeb30e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2638139
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2021-01-21 02:06:46 +00:00
Andrew Walbran
9cfdbd9cc0 Fix clippy errors and some warnings.
TEST=cargo test

Change-Id: I91afe78141c717a592eec5ec77acac2a500ba163
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2623941
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Andrew Walbran <qwandor@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Andrew Walbran <qwandor@google.com>
2021-01-18 15:50:25 +00:00
Jason Macnak
d8dd1c62c7 rutabaga_gfx: fix iov scope with transfer_read
Move the RutabagaIovec representing the display framebuffer out of
match's Some() condition so that it outlives the call to the
underlying renderer.

BUG=b:173630595
TEST=launch_cvd --gpu_mode=gfxstream

Change-Id: I86b2ddd0de0551bf0fbbbfebf811c39d7581f3cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2627646
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
2021-01-16 04:59:51 +00:00
Jason Macnak
eaec45bc8c rutabaga_gfx: Pass display dimensions and gl flags to gfxstream
BUG=b:173630595
TEST=launch_cvd --gpu_mode=gfxstream

Change-Id: Ie745424f1d5e18c9402066cf80c45770dcd86671
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2627645
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
2021-01-16 04:59:50 +00:00
Lingfeng Yang
f35d2c43ff gfxstream: use WC memory in ASG blobs
This seems to be faster than using UC and brings perf close to or
on par with goldfish address space blobs.

BUG=b:177241396

Change-Id: I8198ac0a0510388e79753cdb22007f97dcb3568b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2621997
Commit-Queue: Lingfeng Yang <lfy@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Auto-Submit: Lingfeng Yang <lfy@google.com>
2021-01-14 20:54:20 +00:00
Gurchetan Singh
028b8044bc crosvm: clearer naming about GPU features
It's possible to compile the gpu device without virgl_renderer.
In fact, in many instances, this may be required.

This builds the gpu device default, but only with --gpu do I see
/dev/dri/renderN128, so this should be safe.

BUG=b:173630595
TEST=compile and run

Cq-Depend: chromium:2592111
Change-Id: I5fbf2de8a2f818a9ca2e5ac4a1a02c7797cff927
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2592089
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
2020-12-17 01:18:00 +00:00
Gurchetan Singh
b1394f719d rutabaga_gfx: an electrifying possibility
rutabaga_gfx is a cross platform, Rust-based, Wayland and
Vulkan-centric Virtual Graphics Interface (VGI).

Apologies for the mega-change, but it was hard to do this piece
by piece.

The rationale for this change is:

1) Android graphics virtualization experts have been proposing
for a VGI for many months (years?).  Their goal is to boot
Android anywhere, everywhere.

2) For the {wayland, cross-domain} context type prototype,
it's desirable to create a {wayland, camera} connection at the
appropriate time. Details can be found in the code, though the
RutabagaChannels have yet to be hooked up.

There's a high chance neither effort will work.  As such,
rutabaga is just a prototype.

However, even (1) and (2) don't end up working, this
refactor/cleanup by itself makes a ton of sense.

Here's a summary of revelant changes:

* Removed auto-generated {p_defines, p_format, virgl_protocol}.
These files were added for tests when bringing up crosvm-gpu,
and AFAICT these tests are not run.  There's actually now a
commit queue for virglrenderer changes and container boot tests
that provides excellent coverage.

* Removed command_buffer.rs.  Used only for the previously
mentioned tests.  It's quite nice, but couldn't determine the right
place to put it.  Maybe data_model?  But removed it in the interim.

* Removed {write_from_guest_memory, read_to_volatile}.  The same
basic functionality has been moved into {transfer_write,
transfer_read} in Rutabaga.

* Removed VirtioResource, Virtio3DResource, Virtio2DResource,
and VirtioGfxStreamResource in favor of VirtioGpuResource and
RutabagaResource.  This leads to less duplication and clearer
separation between external library functions and VMM functions.

* Moved display and hypervisor memory management functions to
virtio_gpu.rs.  This is because external components do not interface
with this functionality, and there was a lot of duplication (for example
map/unmap blob).

* Added context management between gfxstream and virglrenderer.

* Added separate gfxstream and virglrenderer flags.

* Clearer naming.

* Added simple implementations for context init and multiple timelines.
These changes have no effect since all Google kernels don't pass the
revelant flags, but are useful for theoretical {wayland, cross-domain}
prototype.

* Unify RESOURCE_CREATE_3D and RESOURCE_CREATE_2D handling.

* Better error handling.

BUG=b:146066070, b:173630595, b:150239451
TEST=launch virtual machine with 2D mode
TEST=launch virtual machine with 3D mode
TEST=boot ARCVM

Change-Id: I240b0c134a3b562cbc65981837a41f6db7767c92
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2522452
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Lingfeng Yang <lfy@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2020-12-08 20:17:05 +00:00