and init flag for preferring discrete GPU. Modify GBM selection to
prefer integrated GPU for display. Report "different GPU" back to
client to enable drawable shadowing. Allocate linear GBM buffers to make
them shareable between different devices.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Make virgl_egl_image_from_dmabuf a generic helper. Add
virgl_egl_image_from_gbm_bo and virgl_egl_aux_plane_image_from_gbm_bo
that use the helper.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Gert Wollny <gert.wollny@collabora.com>
EGL_ANDROID_native_fence_sync only works on gles profiles.
Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
This change is being done in preparation for exporting fences, so the
fences are built on EGL_ANDROID_native_fence_sync instead of on
EGL_KHR_fence_sync.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Rename vrend_util.h to virgl_util.h. Add the header guard.
"vrend" is the prefix for the GL renderer code. "virgl" is the
prefix for common code.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
This is currently only used with minigbm, and largely untested
elsewhere. This will also allow us to use flags which are not
available in Mesa GBM.
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
Change to use eglWaitSyncKHR which is a server side fence and it
could be sightly better.
Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: David Riley <davidriley@chromium.org>
We only need a recent version of gbm when enable_gbm_allocation gets
set.
Close#134
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Lepton Wu <lepton@chromium.org>
Add helper to complete GPU operations to allow synchronization prior to
CPU accesses like mapping buffers on platforms that require it (ie ARM
Mali).
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Mesa emulates planar format sampling with per-plane samplers. With this
change, the guest can pass the plane index when creating a sampler view
from a virgl resource to create a per-plane sampler view. The index can
be passed in place of the texture layer, as that will always be 0 for
planar images.
Signed-off-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Lepton Wu <lepton@chromium.org>
Certain 2D allocations will take the GBM path if the option
is set.
Reviewed-by: David Riley <davidriley@chromium.org>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
It's possible to EGL images from any dmabuf. Currently, gbm-based
dma-bufs are supported.
v2: 39 attributes --> 37 attributes (@davidriley)
Reviewed-by: David Riley <davidriley@chromium.org>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
It is possible to open rendernodes when using EGL_MESA_platform_surfaceless.
v2: fail if user-provided fd fails (@davidriley)
Reviewed-by: David Riley <davidriley@chromium.org>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
These extensions allow for multi-plane images and modifiers, and
are more widely supported than EGL_MESA_drm_image or EGL_MESA_image_dma_buf_export.
Reviewed-by: David Riley <davidriley@chromium.org>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Just a cleanup -- no functional changes.
Reviewed-by: David Riley <davidriley@chromium.org>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
ARM platforms such as Mali might not support Mesa surfaceless platform
so fall back to using a default display.
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
ARM GL stacks might not support these extensions, and if buffers
are not being exported since they're being imported from externally
created buffers, then these are not necessary.
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
ARM platforms may only advertise GLES 2.0 configurations.
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
This way all output originating from virglrenderer will be redirected.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: David Riley <davidriley@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This is needed to properly support EXT_sRGB_write_control
v2: Make return value of virgl_has_egl_khr_gl_colorspace
a bool (Gurchetan)
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
It is nice to know why things go wrong.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Functionality of the extension is used to create the context.
Closes: #37
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
The define EGL_MESA_drm_image is always set by the required version of
libepoxy, and since the availability of the extension EGL_MESA_drm_image
is driver dependend the run-time test in virgl_egl_init is sufficient.
Thanks to Emil Velikov for giving me the heads up about this EGL extension
stuff.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
The availability of this extension is already checked at run-time and the
requirement on the libepoxy version insures that the relevant prototypes
are available.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
The define should always be true and the availability of the extension is
already checked at run-time.
Also correct the fourcc fallback code path to fullfill test expectation.
Closes: #36
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Adds a VIRGL_RENDERER_USE_GLES flag for specifying the API to request
when creating the EGL context.
Users can enable this flag when using vtest with the VTEST_USE_GLES
environment variable.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
To make it easier to run the test suite on environments without graphics
hardware, add an environment variable VIRGL_EGL_SURFACELESS that will
force the use of the surfaceless platform.
Combined with the following flags, we can run virglrenderer and its
tests without any graphics hardware or windowing system present:
LIBGL_ALWAYS_SOFTWARE=true GALLIUM_DRIVER=llvmpipe VIRGL_EGL_SURFACELESS=yes
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Allow the caller to provide a pre-opened DRM file descriptor, to be
used by the EGL context.
Bump callback interface version for compatibility.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
virgl_renderer_resource_get_info() doesn't return the underlying image
stride. eglExportDMABUFImageMESA() does. This fixes imports failing
due to a stride mismatch under certain resolutions. (note that qemu
uses its own export methods, perhaps because Gerd noticed the problem
with virgl egl export functions)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>