From: David Rosca Date: Mon, 14 Aug 2023 06:58:01 +0000 (+0200) Subject: gallium/auxiliary/vl: Map range when updating constants X-Git-Tag: upstream/23.3.3~2419 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a90b9f1d1e5e69a386cd3fc848e5004677ba6e3b;p=platform%2Fupstream%2Fmesa.git gallium/auxiliary/vl: Map range when updating constants Use WRITE | DISCARD_RANGE to avoid having to read back the csc matrix and luma min/max values. Acked-by: Leo Liu Reviewed-by: Thong Thai Part-of: --- diff --git a/src/gallium/auxiliary/vl/vl_compositor_cs.c b/src/gallium/auxiliary/vl/vl_compositor_cs.c index 432b20a..853c6ce 100644 --- a/src/gallium/auxiliary/vl/vl_compositor_cs.c +++ b/src/gallium/auxiliary/vl/vl_compositor_cs.c @@ -782,15 +782,16 @@ set_viewport(struct vl_compositor_state *s, assert(s && drawn); - void *ptr = pipe_buffer_map(s->pipe, s->shader_params, - PIPE_MAP_READ | PIPE_MAP_WRITE, - &buf_transfer); + void *ptr = pipe_buffer_map_range(s->pipe, s->shader_params, + sizeof(vl_csc_matrix) + sizeof(float) * 2, + sizeof(float) * 6 + sizeof(int) * 8, + PIPE_MAP_WRITE | PIPE_MAP_DISCARD_RANGE, + &buf_transfer); if (!ptr) return false; float *ptr_float = (float *)ptr; - ptr_float += sizeof(vl_csc_matrix)/sizeof(float) + 2; *ptr_float++ = drawn->scale_x; *ptr_float++ = drawn->scale_y;