Commit graph

39 commits

Author SHA1 Message Date
Gurchetan Singh
144c279d28 crosvm: add 'virtio-gpu-next' feature flag
With this, crosvm builds that don't have the CrOS version of
virglrenderer can build against master without adjustments.

BUG=chromium:924405
TEST=compile

Change-Id: Iee27c003bee1eb8947cb048dc16e2da6c68af11e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1797067
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2019-10-01 07:53:33 +00:00
Gurchetan Singh
f585543065 gpu_renderer: update bindings
Use virglrenderer to get the metadata associated with a buffer.
We must do this before we allocate the guest kernel pages, so
they agree with host requirements. This implements the rough API
outlined here:

https://gitlab.freedesktop.org/virgl/virglrenderer/issues/119

Probably we want this in virv-renderer eventually, but that may take
some time, so for prototyping just use non-upstreamed virglrenderer
functions.

BUG=chromium:924405
TEST=compile

Change-Id: If78f274c813c2131b297144172019848806e3a0e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1790831
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
2019-10-01 07:53:30 +00:00
Gurchetan Singh
b7da549c7b gpu_renderer: move capset3 out of VMM
In terms of layer and encapsulation, it's better that capset3 is
filled by the host rendering library.  With gbm inside virglrenderer
now, use that instead.

BUG=chromium:924405
TEST=compile

Change-Id: I7eb554074da98ab5d40aa53389124b3fd749474d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1790830
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
2019-09-20 16:55:27 +00:00
Gurchetan Singh
5ce68e42ca devices: gpu: remove BackedBuffer/GpuRendererResource distinction
We always advertise VIRTIO_GPU_F_VIRGL and don't activate the
worker thread if Renderer::init fails.  We're unlikely to
encounter an platform where we can initialize a GBM device, but
can't initialize virglrenderer.

Since our virtio-gpu implementation depends on virglrenderer, we can
pipe 2D hypercalls to virglrenderer (QEMU does this too, when built
with the --enable-virglrenderer option).

Also remove virgl_renderer_resource_info since it's unlikely to work
with non-Mesa drivers.

BUG=chromium:906811
TEST=kmscube renders correctly (though there's a prior bug in closing
the rendering window -- see chromium:991830)

Change-Id: I7851cd0837fd226f523f81c5b4a3389dc85f3e4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1743219
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org>
2019-08-20 17:46:26 +00:00
Gurchetan Singh
593dc3b34e gpu_renderer: remove EGL related functions
Now that we're not creating EGL images anymore, we can remove
EGL logic.

BUG=chromium:906811
TEST=freecad works without any local Mesa patches

Change-Id: I09db1c828ae1a331eaeae7c66653a49fe42a04bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1725451
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2019-08-20 17:46:25 +00:00
Gurchetan Singh
b8a833f6cc gpu_renderer: use GBM inside virglrenderer
With YUV support + modifier support coming up, it makes sense to
move GBM allocation inside virglrenderer so we can upstream
our use cases.

In addition, this allows us to use gbm_bo_map(..) for the freecad
issue, which would otherwise be resolved through local patches in
our graphics drivers.

BUG=chromium:906811
TEST=freecad works without Mesa patches

Change-Id: I61db5c58a5bc5a79fda3cec8ad6c322fae6acc9e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1725450
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org>
2019-08-20 17:46:24 +00:00
Gurchetan Singh
35a9d838db gpu_renderer: update bindings
BUG=chromium:906811
TEST=compile

Change-Id: Ie4ee8df9e944a4b6bf148dfa04ab7946992a0351
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1725449
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org>
2019-08-15 18:20:10 +00:00
David Riley
62c533c9a3 gpu_renderer: Make eglDebugMessageControlKHR usage optional.
BUG=chromium:892280
TEST=glxgears with virtio-gpu on kevin and nami

Change-Id: I2158f4fe3411006ce5498b01d12ca627aa985f53
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1717737
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: David Riley <davidriley@chromium.org>
Commit-Queue: David Riley <davidriley@chromium.org>
Auto-Submit: David Riley <davidriley@chromium.org>
2019-08-01 19:34:03 +00:00
Zach Reizner
f5285c647a gpu_display: add X11 backend
This change adds an X11 backend to the gpu_display crate. With this
addition, the virtio-gpu device can display to traditional linux
desktops that only have X11 output.

Change-Id: I86c80cac91ca5bdc97588194a44040273ae69385
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1591572
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Auto-Submit: Zach Reizner <zachr@chromium.org>
2019-07-25 22:15:48 +00:00
Gurchetan Singh
ed88b0ef5e devices: gpu: advertise support for capset 3
Useful for prototyping new features.

BUG=chromium:924405
TEST=compile

Change-Id: Ibdc4a70761493939ca96b92540b9e0cca88c17a8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1650290
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org>
2019-07-16 17:21:39 +00:00
David Riley
996beb6499 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>
2019-07-03 15:41:57 +00:00
David Riley
aa36a2923a gpu_renderer: update virglrenderer bindings
Results of:
  gpu_renderer/src/generated/generate --sysroot /build/$BOARD
  bin/fmt

BUG=chromium:972237
TEST=builds

Change-Id: I75063345a6cc77b54f51cfdaf244e5f73dffefcb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1657290
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: David Riley <davidriley@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
2019-07-03 15:41:55 +00:00
Gurchetan Singh
33626056f4 devices: virtio: add bindings to a new capset
This is useful for prototyping new virtgpu features (zero copy, YUV, Vulkan)
without stepping on virglrenderer's capsets.

Initially, the plan is just to transparently support zero-copy in ARCVM.

The bindings were generated from the following header:

https://gitlab.freedesktop.org/gurchetansingh/virtio-gpu-test/blob/master/virtgpu_hw.h
Generated via:

bindgen --with-derive-default virtgpu_hw.h -o virtgpu_hw.rs --no-doc-comments --no-layout-tests \
        --whitelist-type=virtgpu_.+ --whitelist-var VIRTGPU_.+ --no-prepend-enum-name

BUG=chromium:924405
TEST=compile

Change-Id: I6000244faa0d619c3ac74105713e63a52d0d9cb4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1650289
Reviewed-by: David Riley <davidriley@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
2019-07-03 05:42:27 +00:00
Zach Reizner
4a93a21ab3 gpu_renderer: make Box3 less error prone with constructor
The argument order of the new_2d constructor was very odd. That has been
changed to the ordinary x,y,w,h order. Also, each Box3 is checked by
is_empty() before being used, which prevents some degenerate operations
on zero area boxes.

TEST=cargo run -- run --gpu
BUG=None

Change-Id: I6954fa4846f20353517fe81028058b639752d8ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1670549
Tested-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: David Riley <davidriley@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Zach Reizner <zachr@chromium.org>
2019-06-24 23:59:15 +00:00
Zach Reizner
3e0fa36886 eliminate usage of uninitialized
uninitialized is deprecated and considered too dangerous to use for any
of the use cases we were using.

BUG=None
TEST=passes smoke_test

Change-Id: I5392cb8ec132f374d9b5590f72eb2cb329a82421
Reviewed-on: https://chromium-review.googlesource.com/1626795
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
2019-05-23 07:35:18 -07:00
Stephen Barber
d6945a09b8 crosvm: add license blurb to all files
A few files were missing license blurbs at the top, so update them all
to include them.

BUG=none
TEST=none

Change-Id: Ida101be2e5c255b8cffeb15f5b93f63bfd1b130b
Reviewed-on: https://chromium-review.googlesource.com/1577900
Commit-Ready: Stephen Barber <smbarber@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
2019-04-24 15:51:38 -07:00
Daniel Verkamp
cfb6f70d1c gpu: replace deprecated ATOMIC_BOOL_INIT
Fixes a warning:

  warning: use of deprecated item 'std::sync::atomic::ATOMIC_BOOL_INIT':
  the `new` function is now preferred

BUG=None
TEST=emerge-nami crosvm

Change-Id: Ic2c7d07fc87c80c853a5d47e37b6fd32a5ce6dd4
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1573245
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-19 14:45:55 -07:00
David Tolnay
dc4effa72b clippy: Iterate without calling .iter()
See:
https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
https://rust-lang.github.io/rust-clippy/master/index.html#explicit_into_iter_loop

Before:

    for element in slice.iter() {...}

After:

    for element in slice {...}

TEST=grep -r '\.iter() {'
TEST=grep -r '\.iter_mut() {'
TEST=grep -r '\.into_iter() {'
TEST=cargo check --all-features
TEST=local kokoro

Change-Id: I27f0df7cfa1064b2c8b162cba263513926a433a9
Reviewed-on: https://chromium-review.googlesource.com/1568525
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2019-04-18 19:51:01 -07:00
David Riley
800cc56418 devices: gpu: Only allocate scanout buffers via minigbm.
Cq-Depend: chromium:1569025

BUG=chromium:945033
TEST=Unity editor

Change-Id: I26d1dabd7fbd8cf62ebd99833a121ac0951a4440
Reviewed-on: https://chromium-review.googlesource.com/1553560
Commit-Ready: David Riley <davidriley@chromium.org>
Tested-by: David Riley <davidriley@chromium.org>
Reviewed-by: David Riley <davidriley@chromium.org>
2019-04-17 17:22:59 -07:00
David Riley
11c886a1f4 gpu_renderer: update virglrenderer bindings
Results of:
  gpu_renderer/src/generated/generate --sysroot /build/$BOARD
  cargo fmt

BUG=chromium:945033
TEST=builds

Change-Id: I9c681314431bb442688759b93e43cc85e9928aa0
Reviewed-on: https://chromium-review.googlesource.com/1553559
Commit-Ready: David Riley <davidriley@chromium.org>
Tested-by: David Riley <davidriley@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Riley <davidriley@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2019-04-17 17:22:58 -07:00
David Tolnay
aecf9a4dee edition: Remove extern crate lines
In Rust 2018 edition, `extern crate` is no longer required for importing
from other crates. Instead of writing:

    extern crate dep;
    use dep::Thing;

we write:

    use dep::Thing;

In this approach, macros are imported individually from the declaring
crate rather than through #[macro_use]. Before:

    #[macro_use]
    extern crate sys_util;

After:

    use sys_util::{debug, error};

The only place that `extern crate` continues to be required is in
importing the compiler's proc_macro API into a procedural macro crate.
This will hopefully be fixed in a future Rust release.

    extern crate proc_macro;

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu
TEST=local kokoro

Change-Id: I0b43768c0d81f2a250b1959fb97ba35cbac56293
Reviewed-on: https://chromium-review.googlesource.com/1565302
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-15 02:06:08 -07:00
David Tolnay
e40a7f32aa edition: Update gpu_buffer, gpu_display, gpu_renderer to 2018 edition
Separated out of CL:1513058 to make it possible to land parts
individually while the affected crate has no other significant CLs
pending. This avoids repeatedly introducing non-textual conflicts with
new code that adds `use` statements.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: I290fc72e5624cf8b4b2bacaf124cc5b654255978
Reviewed-on: https://chromium-review.googlesource.com/1519696
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-04-08 22:30:19 -07:00
David Tolnay
fe3ef7d998 edition: Update absolute paths to 2018 style
This is an easy step toward adopting 2018 edition eventually, and will
make any future CL that sets `edition = "2018"` this much smaller.

The module system changes in Rust 2018 are described here:

https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html

Generated by running:

    cargo fix --edition --all

in each workspace, followed by bin/fmt.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: I000ab5e69d69aa222c272fae899464bbaf65f6d8
Reviewed-on: https://chromium-review.googlesource.com/1513054
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
2019-03-13 21:05:03 -07:00
Lepton Wu
28716ea430 gpu_renderer: Enable DRM_FORMAT_RGB565 format.
Some games under arcvm tried to create gbu buffer in this format.

BUG=b:128019372
TEST=manual - Run Asphalt 8 in ARCVM.

Change-Id: I12e67981b4a0b50574ff57cd6bfe94c042feedac
Reviewed-on: https://chromium-review.googlesource.com/1518731
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Lepton Wu <lepton@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2019-03-13 10:38:47 -07:00
David Tolnay
c69f97542a error: Consistently use Display instead of error description()
The description method is deprecated and its signature forces less
helpful error messages than what Display can provide.

BUG=none
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: I27fc99d59d0ef457c5273dc53e4c563ef439c2c0
Reviewed-on: https://chromium-review.googlesource.com/1497735
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
2019-03-02 17:41:31 -08:00
David Tolnay
4d8fc333e5 gpu: Remove unused import
Use of this value was removed in CL:1446932.

TEST=cargo check gpu_renderer

Change-Id: I8473cbddd074bb553187532926b7c6a870a24a51
Reviewed-on: https://chromium-review.googlesource.com/1477499
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Riley <davidriley@chromium.org>
2019-02-20 08:20:08 -08:00
David Riley
02bbe5f1e4 gpu_renderer: switch to using virgl initialization
EXT_sRGB_write_control was not getting advertised due to virgl not
performing EGL initialization.  Move crosvm over to using the normal
virgl EGL initialization path.

BUG=chromium:925569
TEST=piglit/bin/fbo-srgb

Change-Id: I1acc5823ef1922395f1a6bf8e7996b23ee4c3632
Reviewed-on: https://chromium-review.googlesource.com/1446932
Commit-Ready: David Riley <davidriley@chromium.org>
Tested-by: David Riley <davidriley@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
2019-02-04 22:49:23 -08:00
David Riley
0f5e2af614 gpu_renderer: update virglrenderer bindings
Results of:
  gpu_renderer/src/generated/generate --sysroot /build/$BOARD
  cargo fmt

BUG=chromium:925569
TEST=builds

Change-Id: If8bd92879970e97699570250fdd66dcea553b0a8
Reviewed-on: https://chromium-review.googlesource.com/1446931
Commit-Ready: David Riley <davidriley@chromium.org>
Tested-by: David Riley <davidriley@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2019-01-31 14:06:19 -08:00
David Riley
fdc07a6466 gpu_renderer: Include VIRGL_ constants for generated bindings.
BUG=chromium:925569
TEST=src/generated/generate --sysroot /build$BOARD; grep VIRGL src/generated/virglrenderer.rs

Change-Id: I30fe392f0f762f7aa5c5730ff3007fd60db6d4d2
Reviewed-on: https://chromium-review.googlesource.com/1446730
Commit-Ready: David Riley <davidriley@chromium.org>
Tested-by: David Riley <davidriley@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2019-01-31 14:06:18 -08:00
David Tolnay
2bac1e7a9c toolchain: Update to Rust 1.31.0
We updated the production toolchain from 1.30 to 1.31 in CL:1366446.
This CL does the same upgrade for the local developer toolchain and
Kokoro.

The relevant changes are in rust-toolchain and kokoro/Dockerfile.
The rest are from rustfmt.

TEST=cargo fmt --all -- --check
TEST=as described in kokoro/README.md

Change-Id: I3b4913f3e237baa36c664b4953be360c09efffd4
Reviewed-on: https://chromium-review.googlesource.com/1374376
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-12-13 19:28:04 -08:00
Zach Reizner
aa5756669a devices: allow virtio-wayland to use virtgpu resources
This change uses the resource bridge between virtio-gpu and virtio-cpu
to send resources over the host wayland connection that originated from
the virtio-gpu device. This will help support gpu accelerated wayland
surfaces.

BUG=chromium:875998
TEST=wayland-simple-egl

Change-Id: I3340ecef438779be5cb3643b2de8bb8c33097d75
Reviewed-on: https://chromium-review.googlesource.com/1182793
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-12-11 19:33:56 -08:00
Zach Reizner
3655a633b2 gpu_renderer: cargo fmt epoxy_egl.rs, which is huge
The formatting of epoxy_egl.rs was separated from the rest because it is
an order of magnitude larger than any other file and seriously slows
down tools interacting with git.

TEST=cargo test
BUG=None

Change-Id: I3b407078b85e585dc7d1d518bf85a8cfcb07dd58
Reviewed-on: https://chromium-review.googlesource.com/1259288
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: David Riley <davidriley@chromium.org>
2018-10-09 21:14:06 -07:00
Zach Reizner
55a9e504be cargo fmt all source code
Now that cargo fmt has landed, run it over everything at once to bring
rust source to the standard formatting.

TEST=cargo test
BUG=None

Change-Id: Ic95a48725e5a40dcbd33ba6d5aef2bd01e91865b
Reviewed-on: https://chromium-review.googlesource.com/1259287
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-10-09 21:14:05 -07:00
David Riley
c9ce2da943 gpu: add force_ctx_0 calls prior to each gpu command
BUG=None
TEST=build with --features=gpu; null_platform_test

Change-Id: Ib7aab8b2f0d7e1523df49360ab99677b59ce6052
Reviewed-on: https://chromium-review.googlesource.com/1073960
Commit-Ready: David Riley <davidriley@chromium.org>
Tested-by: David Riley <davidriley@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-07-30 23:08:05 -07:00
David Riley
f89e0b50e2 gpu: add support for fences
BUG=None
TEST=build with --features=gpu; null_platform_test

Change-Id: Ib863c8ef3e85aa0f345c1f20be414979808b6a17
Reviewed-on: https://chromium-review.googlesource.com/1073959
Commit-Ready: David Riley <davidriley@chromium.org>
Tested-by: David Riley <davidriley@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-07-30 23:08:04 -07:00
David Riley
ba7c6035f8 gpu: hold image with resource
Ensure eglImage is not destroyed until the referencing resource is dropped.

BUG=None
TEST=build with --features=gpu; null_platform_test

Change-Id: I55c33344f46b08f846e094451516fcd16c9d16ae
Reviewed-on: https://chromium-review.googlesource.com/1073958
Commit-Ready: David Riley <davidriley@chromium.org>
Tested-by: David Riley <davidriley@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-07-30 23:08:04 -07:00
David Riley
af9d7edfb7 gpu: import buffers for rendering from minigbm
BUG=None
TEST=build with --features=gpu; null_platform_test (has tearing)

Change-Id: Ic53ac703971bfdafcff2a4df55ddc4cf382144f1
Reviewed-on: https://chromium-review.googlesource.com/1050989
Commit-Ready: David Riley <davidriley@chromium.org>
Tested-by: David Riley <davidriley@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-07-30 23:08:03 -07:00
David Riley
150daf94c2 gpu_renderer: update virglrenderer bindings
BUG=None
TEST=None

Change-Id: I48f6dcf4c176fe4d9bcbaae94bf2319a9063b0a8
Reviewed-on: https://chromium-review.googlesource.com/1073955
Commit-Ready: David Riley <davidriley@chromium.org>
Tested-by: David Riley <davidriley@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-07-30 23:08:02 -07:00
Zach Reizner
f40bb190ec gpu_renderer: add virglrenderer bindings
These bindings are needed for virtio-gpu 3D capabilities.

All the rust files under gpu_renderer/src/generated are generated via
the gpu_renderer/src/generated/generate script.

The gpu_renderer/src/lib.rs file contains the Renderer and Context
structs, which are the main interfaces to virglrenderer. They
encapsulate the global state of virglrenderer (Renderer) and each
context ID (Context).

The command_buffer module is included only for basic testing and is not
intended for production use.

The pipe_format_fourcc module is provided for the conversion of
virglrenderer specifc formats to standard fourcc formats.

BUG=chromium:837073
TEST=cargo build -p gpu_renderer
CQ-DEPEND=CL:1144406

Change-Id: Iad153390f618309bf493e92e76432c0b1c4a8a93
Reviewed-on: https://chromium-review.googlesource.com/1043447
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-07-20 05:30:54 -07:00