[Mesa-dev] [PATCH] u_upload_mgr: use unsync flag on both buffer mappings for consistency

Jose Fonseca jfonseca at vmware.com
Mon Apr 29 22:42:29 PDT 2013



----- Original Message -----
> From: Dave Airlie <airlied at redhat.com>
> 
> Not sure if this makes a difference or not, but either its inconsistent
> for some undocumented reason or its just a bug.

PIPE_TRANSFER_UNSYNCHRONIZED only makes sense when one maps for the 2nd time (or after). It really makes no sense to set UNSYNCRHONIZED with a buffer that was just created, as the map can't block (i.e, there is no drawing to synchronize with anyway).

UNSYNCHRONIZED was actually set here before, and exposed a bug in svga pipe driver because it is such an unexpected thing to do.  Of course, the svga pipe driver bug was fixed -- as apps could make the same mistake with mapbufferrange --, but we decided not to set the flag anymore just in case it caused problems elsewhere.

But I suppose that the asymmetry causes suspicion, so maybe a comment would be a good idea indeed.

Jose


> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/gallium/auxiliary/util/u_upload_mgr.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c
> b/src/gallium/auxiliary/util/u_upload_mgr.c
> index 6859751..de448e0 100644
> --- a/src/gallium/auxiliary/util/u_upload_mgr.c
> +++ b/src/gallium/auxiliary/util/u_upload_mgr.c
> @@ -138,7 +138,8 @@ u_upload_alloc_buffer( struct u_upload_mgr *upload,
>     upload->map = pipe_buffer_map_range(upload->pipe, upload->buffer,
>                                         0, size,
>                                         PIPE_TRANSFER_WRITE |
> -                                       PIPE_TRANSFER_FLUSH_EXPLICIT,
> +                                       PIPE_TRANSFER_FLUSH_EXPLICIT |
> +                                       PIPE_TRANSFER_UNSYNCHRONIZED,
>                                         &upload->transfer);
>     if (upload->map == NULL) {
>        upload->transfer = NULL;
> --
> 1.8.1.2
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 


More information about the mesa-dev mailing list