Add a helper, virgl_resource_create, to allocate and add the
virgl_resource to the table.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
I don't see the point why we want to use context0 to do transfer.
If we always use original context to do transfer, then we can
avoid sync between contexts for mobile GPU.
Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
There is no TGSI OPCODE for roundEven, prefer roundEven
so roundEven in guest gets translated to roundEven.
Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Autotools is deprecated since debb6e6ac4
It's now time to drop it definitively.
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
fs_texfetch_col_swizzle is parameterized on the number of samples and
whether or not it needs to handle swizzle. Make sure that the cached
shader is recreated if the parameters change.
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Minigbm's gbm_bo_map signature has diverged from gbm. Update to
minigbm signature, since virglrenderer now explicitly targets minigbm.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
VIRGL_BIND_SHARED allows external allocators to intercept resource
creation. Reserve the upper byte of bind flags to allow passing
allocator-specific flags, and define a set of such flags for minigbm.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
convert_mag_filter is quite a simple function and it's only used once.
So lets inline it.
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
This patch move glDeleteShader into build_and_check to avoid code duplication
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
If the next shader stage doesn't declare an input block,
we should not emit an output block in the current stage.
Fix the remaining compilation issue when using the GLES backend.
error: redeclaration of gl_PerVertex must be a subset of the built-in members of gl_PerVertex
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Fix the following compilation issue when using the GLES backend.
error: redeclaration of gl_PerVertex must be a subset of the built-in members of gl_PerVertex
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
While adding support to llvmpipe for GL 4.00 a bunch of virgl tests
started to fail, this should fix one of the cases
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
This is better so we can dump same shader multiple times.
Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Fix potential truncations caught by the compiler, such as
../src/vrend_shader.c:2395:82: warning: ‘%s’ directive output may be truncated writing up to 127 bytes into a region of size between 86 and 213 [-Wformat-truncation=]
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Increase the size of full_op. Use ARRAY_SIZE to get the buffer
sizes. This fixes
../src/vrend_shader.c:2069:25: warning: ‘%s’ directive output may be truncated writing up to 63 bytes into a region of size between 62 and 125 [-Wformat-truncation=]
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Fix void* arithmetic and extra semicolon. -Wno-overlength-strings
is for large_frag in large_shader.h.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
../src/virgl_gbm.c:186:13: warning: ‘virgl_gbm_transfer_internal’ defined but not used [-Wunused-function]
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
In c20a5a9, I move some unused results files in the archived folder
but I didn't correctly fix the path of the softpipe results.
Softpipe is the driver used for the ci so its results file wasn't archived.
Fixes: c20a5a9 "ci: move outdated results to an archived folder"
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Like in vrend_renderer_transfer_internal, virgl_gbm_transfer is a
special path that is generally preferred. However, a copy transfer
can be a synchronized transfer. We don't want to use GBM in that
case.
v2: add a comment on glFinish
v3: use GBM only when VIRGL_TEXTURE_NEED_SWIZZLE is set
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: David Riley <davidriley@chromium.org>
Tested-by: David Riley <davidriley@chromium.org>
Acked-by: Gurchetan Singh <gurchetansingh@chromium.org>
We should honor info->offset and info->layer_stride. This brings
virgl_gbm_transfer closer to
vrend_renderer_transfer_{write,send}_iov.
minigbm has a bug and never sets info->offset. The bug went
unnoticed before virgl_gbm_transfer was added. I suppose fixing
virgl_gbm_transfer now should not suddenly make the bug
user-visible.
v2: With virgl_gbm_transfer, we added planar YUV support that was
not available before. We have to make a special case for YUV to not
regress minigbm.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: David Riley <davidriley@chromium.org> (v1)
Tested-by: David Riley <davidriley@chromium.org> (v1)
Acked-by: Gurchetan Singh <gurchetansingh@chromium.org>
When a stride is given, validate it against the box width, not the
bo width.
This mirrors what check_iov_bounds does.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: David Riley <davidriley@chromium.org>
Tested-by: David Riley <davidriley@chromium.org>
Acked-by: Gurchetan Singh <gurchetansingh@chromium.org>
amdgpu, llvmpipe and i915 are not used by the freedesktop ci and
didn't see any update for at least 6 months.
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Context lookup should happen in virglrenderer.c such that we can
dispatch through the context callbacks. Being able to get rid of
vrend_lookup_renderer_ctx (context lookup inside vrend) is
significant.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
When a context is destroyed, all its queries are destroyed with
vrend_destroy_query_object and removed from
vrend_state.waiting_query_list. vrend_query::ctx is never dangling.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Move resource lookup up from vrend to virglrenderer for
vrend_renderer_export_query. Now that the last user of
vrend_renderer_res_lookup is gone, we can remove the helper.
After this change, it becomes clear that vrend deals with
vrend_resource mostly. The only exceptions are the
virgl_context::{attach_resource,detach_resource,transfer_3d}
callbacks.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>