1976 Commits
Author SHA1 Message Date
Gert Wollny 9fbc538ac6 vrend: move program only into front of queue of it is not already there
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:15:54 +01:00
Gert Wollny 4a5c238d53 vrend: don't check vertex attributes in draw_vbo
This reverts 374dd5bae8
    Fix i965 crash with bin/gl-3.1-vao-broken-attrib

The crash with i965 can't be reproduced anymore, and the Gallium
drivers do the correct checks to not crash there, so it is
not necessary to do the extra checking.

Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:15:49 +01:00
Gert Wollny c08c84197a vrend: use helper pointers in draw_bind_samplers_shader
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:15:47 +01:00
Gert Wollny 4fd840331a vrend: use sub_ctx directly in clear
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:15:45 +01:00
Gert Wollny 9e0c4aabd4 vrend: use helper for sub_ctx in set_framebuffer_state
Also change the interface of called functions to take sub_ctx

Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:15:42 +01:00
Gert Wollny 999f9feea4 vrend: pass sub_ctx directly to draw_bind_objects
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:15:41 +01:00
Gert Wollny e409ad823a vrend: add sub_ctx helper in bind_shader
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:15:39 +01:00
Gert Wollny ff37f78f84 vrend: add sub_ctx helper in create_shader
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:15:37 +01:00
Gert Wollny 7ab6a964f0 vrend: add a sub_ctx helper in launch_grid
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:15:35 +01:00
Gert Wollny 5c85adaa7d vrend: pass sub_context directly to draw_bind_abo_shader
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:15:34 +01:00
Gert Wollny b32ff0f72e vrend: pass sub_context directly to draw_bind_ssbo_shader
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:15:32 +01:00
Gert Wollny bd7972b403 vrend: pass sub_context directly to draw_bind_images_shader
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:15:30 +01:00
Gert Wollny 8ac253a42e vrend: make evaluation of same_prog better optimizable
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:15:28 +01:00
Gert Wollny 4b151fcc8a vrend: rework shader program creation to be able to pass sub_ctx
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:15:26 +01:00
Gert Wollny d0a23c1a7f vrend: pass sub_ctx directly to draw_bind_samplers_shader
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:15:25 +01:00
Gert Wollny 217538ff8c vrend: pass sub_ctx directly to draw_bind_const_shader
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:15:22 +01:00
Gert Wollny 6bbf703a98 vrend: pass sub_ctx direcly to draw_bind_ubo_shader
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:15:20 +01:00
Gert Wollny 2ca4dd4fe4 vrend: pass sub_ctx dirctly to use and add program
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:14:56 +01:00
Gert Wollny 71378f0d02 vrend: pass sub_ctx to blend state
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:14:54 +01:00
Gert Wollny d3d10369dc vrend: pass sub_ctx to update_viewport_state
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:14:49 +01:00
Gert Wollny 18fb818a92 vrend: pass sub_ctx when setting scissor state
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:14:47 +01:00
Gert Wollny 3712429d84 vrend: pass sub_ctx when setting DS state
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:14:45 +01:00
Gert Wollny 963a02a785 vrend: pass sub_ctx directly to update_frontface_state
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:14:43 +01:00
Gert Wollny 71eadba603 vrend: replace uses of ctx->sub with sub_ctx
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:14:40 +01:00
Gert Wollny 57a19772cb vrend: Add parent context reference to sub-contexts
When we want to pass sub contexts directly to the function to avoid
having to de-reference the context pointer all the time there are rare
cases when we need the pointer to the parent context (e.g. for error
reporting). For these cases we need to be able to get the parent context.
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Reviewed-by: Chia-I Wu <[email protected]>
2021-02-01 12:14:33 +01:00
Antonio Caggiano 05676a0376 perf: Update gfx-pps version
Signed-off-by: Antonio Caggiano <[email protected]>
Reviewed-by: Gert Wollny <[email protected]>
2021-01-28 08:54:01 +00:00
Antonio Caggiano c165357711 perf: Fix trace path handling in scripts
Fix `run.sh` and `run_traces.sh` trace path handling by taking into
account that the `--trace` option may contain a multi-directory path
relative to traces-db.

Together with this fix, you should expect to find the output directory
of a perf testing session under the same directory of the trace file.

Signed-off-by: Antonio Caggiano <[email protected]>
Reviewed-by: Gert Wollny <[email protected]>
2021-01-27 14:59:11 +01:00
Louis-Francis Ratté-Boulianne b9dc30355a perf: don't start perfetto when disabled with argument
Reviewed-by: Gert Wollny <[email protected]>
2021-01-25 08:28:05 +00:00
Chia-I Wu f5a45fe97e vrend: add support for VIRGL_CAP_V2_UNTYPED_RESOURCE
An untyped resource is a virgl_resource without pipe_resource while
vrend_context works with pipe_resources exclusively.  When an untyped
resource is attached, we defer the insersion into res_hash until
VIRGL_CCMD_PIPE_RESOURCE_SET_TYPE is submitted.

Signed-off-by: Chia-I Wu <[email protected]>
Acked-by: Gert Wollny <[email protected]>
Acked-by: Gurchetan Singh <[email protected]> (protocol)
2021-01-22 10:35:06 -08:00
Chia-I Wu 115a07a171 vrend: track untyped resources
Track them with a list and a single-slot cache in vrend_context.  The
cache hit rate is expected to be ~100%.

Signed-off-by: Chia-I Wu <[email protected]>
Acked-by: Gert Wollny <[email protected]>
2021-01-22 10:34:51 -08:00
Chia-I Wu f1e72a87b3 vrend: attach/detach virgl_resource rather than pipe_resource
An untyped virgl_resource does not have a pipe_resource.

Signed-off-by: Chia-I Wu <[email protected]>
Acked-by: Gert Wollny <[email protected]>
2021-01-22 10:34:50 -08:00
Chia-I Wu e9de44ea19 vrend: fix a potential egl_image leak
egl_image always wraps gbm_bo so far so this is not a real issue.  But
it will change soon.

Signed-off-by: Chia-I Wu <[email protected]>
Acked-by: Gert Wollny <[email protected]>
2021-01-22 10:34:49 -08:00
Chia-I Wu 1f36f00ad6 vrend: clean up virgl_egl_image_from_*
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 <[email protected]>
Acked-by: Gert Wollny <[email protected]>
2021-01-22 10:34:36 -08:00
Gert Wollny 03dd77537a vrend: refactor select program
Use helper variables for some pointer derefs and query the shader ID's
only once.

Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
2021-01-21 20:59:36 +01:00
Gert Wollny d9b4e34933 vrend: remove unused ctx from shader state call
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
2021-01-21 20:59:36 +01:00
Gert Wollny 12e5c80b8a vrend: pass sub-context to shader key generation
v2: rename ctx to sub_ctx (inspired by comment of Chia-I)

Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
2021-01-21 20:59:36 +01:00
Gert Wollny 2835fed3d6 vrend: move drawing info to sub context
This info is only used when creating the shader key, so it can reside in
the sub context.

Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
2021-01-21 20:59:36 +01:00
Gert Wollny 0be4be0c3b vrend: extract method for shader update from vrend_draw_vbo
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
2021-01-21 20:59:36 +01:00
Gert Wollny 2b0e2f0729 gallium/cso: use a different hash function
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
2021-01-21 20:59:36 +01:00
Gert Wollny 00093d0a8e vrend: use an array of program lists and merge dual_src into compare value
With that Unigine Heaven goes from around 56 FPS to 58

Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
2021-01-21 20:59:36 +01:00
Gert Wollny 2d64614b84 vrend: seperate lists for compute and gfx shaders
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
2021-01-21 20:59:36 +01:00
Gert Wollny b9f7be9e98 vrend: move last used shader program in front of the list
With that shaders that are used more frequently will remain at the
top of the list, and since the search in the shader program list is
linear, this should save some time.

Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
2021-01-21 20:59:36 +01:00
Gert Wollny 5f1f099222 vrend: Cache VS and FS id's in program to speed up comparison
This gives a 6% speed improvement with Unigine Heaven

v2: remove the unlikely for dual_src, the whole statement will
    be changed later (Chia-I Wu)

Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
2021-01-21 20:59:36 +01:00
Gert Wollny 9ad6f60c50 vrend: merge vertex buffer ID into vertex buffer struct
With that only one deref is needed.

Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
2021-01-21 20:59:36 +01:00
Gert Wollny 1b51495bd1 vrend: replace if-chain by using switch/case
if-chains can usually not be optimized very well, switch/case might be
implemented as a jump table.

v2: Add a break in bese before default (Chia-I Wu)

Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
2021-01-21 20:59:36 +01:00
Gert Wollny 46be8896a5 vrend: use a helper variable for the buffer pointer
This makes the code a bit easier to read and may help the complier
to avoid needless dereferencing of pointers.

Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
2021-01-21 20:59:36 +01:00
Gert Wollny a22c56fff4 vrend: remove unused parameter
v2: add comment about that INDEX is not used (Chia-I Wu)

Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
2021-01-21 20:59:36 +01:00
Gert Wollny 4ab4d4ebb5 vrend: pass texture swizzle as array
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
2021-01-21 20:59:36 +01:00
Chia-I Wu f8000f0986 vtest: add VCMD_CONTEXT_INIT
It gives clients access to virgl_renderer_context_create_with_flags.

Signed-off-by: Chia-I Wu <[email protected]>
Reviewed-by: Isaac Bosompem <[email protected]>
2021-01-16 08:05:29 +00:00
Chia-I Wu 0b3e195268 vtest: add VCMD_GET_CAPSET
Comparing to VCMD_GET_{CAPS,CAPS2}, it allows any capset id/version
to be queried.

This is similar to linux's DRM_IOCTL_VIRTGPU_GET_CAPS.

Signed-off-by: Chia-I Wu <[email protected]>
Reviewed-by: Isaac Bosompem <[email protected]>
2021-01-16 08:05:29 +00:00