Mesa (master): virgl: use virgl_transfer_inline_write even less

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Feb 15 10:40:17 UTC 2019


Module: Mesa
Branch: master
Commit: 67426ccd428706b558ae1d8697831ce337f97412
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=67426ccd428706b558ae1d8697831ce337f97412

Author: Gurchetan Singh <gurchetansingh at chromium.org>
Date:   Wed Feb  6 16:26:18 2019 -0800

virgl: use virgl_transfer_inline_write even less

We've noticed the Team Fortress 2 engine seems to do many small
calls to glSubData(..). Let's pick our heuristic based on the
resource base width, not the size of a particular upload.
This will cause transfers to be batched together in the transfer
queue.

Revelant glbench microbenchmark --

Before: buffer_upload_dynamic_element_array_131072 = 131.17 mbytes_sec
After: buffer_upload_dynamic_element_array_131072 = 6828.24 mbytes_sec
Reviewed-by: Gert Wollny <gert.wollny at collabora.com>

---

 src/gallium/drivers/virgl/virgl_resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/virgl/virgl_resource.c b/src/gallium/drivers/virgl/virgl_resource.c
index a21e9111769..2a1e0c18b8b 100644
--- a/src/gallium/drivers/virgl/virgl_resource.c
+++ b/src/gallium/drivers/virgl/virgl_resource.c
@@ -147,7 +147,7 @@ static void virgl_buffer_subdata(struct pipe_context *pipe,
 
    u_box_1d(offset, size, &box);
 
-   if (size >= (VIRGL_MAX_CMDBUF_DWORDS * 4))
+   if (resource->width0 >= getpagesize())
       u_default_buffer_subdata(pipe, resource, usage, offset, size, data);
    else
       virgl_transfer_inline_write(pipe, resource, 0, usage, &box, data, 0, 0);




More information about the mesa-commit mailing list