diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-02-24 02:30:08 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-02-24 02:30:08 +0000 |
commit | 1d35364040c0ffa99133522fa5ab3bd6131d8bf7 (patch) | |
tree | 0ea3d9ca4ad10692c6477168b67e98cb50ea6bd3 /lib/mesa/src/gallium/auxiliary/vl | |
parent | b24b5b9049e889ee4eb39b565bcc8d48bd45ab48 (diff) |
Merge Mesa 21.3.7
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/vl')
11 files changed, 36 insertions, 19 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/vl/vl_bicubic_filter.c b/lib/mesa/src/gallium/auxiliary/vl/vl_bicubic_filter.c index 674aa587d..457f2cf68 100644 --- a/lib/mesa/src/gallium/auxiliary/vl/vl_bicubic_filter.c +++ b/lib/mesa/src/gallium/auxiliary/vl/vl_bicubic_filter.c @@ -456,7 +456,7 @@ vl_bicubic_filter_render(struct vl_bicubic_filter *filter, filter->pipe->bind_sampler_states(filter->pipe, PIPE_SHADER_FRAGMENT, 0, 1, &filter->sampler); filter->pipe->set_sampler_views(filter->pipe, PIPE_SHADER_FRAGMENT, - 0, 1, 0, &src); + 0, 1, 0, false, &src); filter->pipe->bind_vs_state(filter->pipe, filter->vs); filter->pipe->bind_fs_state(filter->pipe, filter->fs); filter->pipe->set_framebuffer_state(filter->pipe, &fb_state); diff --git a/lib/mesa/src/gallium/auxiliary/vl/vl_compositor.c b/lib/mesa/src/gallium/auxiliary/vl/vl_compositor.c index a6ace3532..66abf7325 100644 --- a/lib/mesa/src/gallium/auxiliary/vl/vl_compositor.c +++ b/lib/mesa/src/gallium/auxiliary/vl/vl_compositor.c @@ -237,6 +237,7 @@ static bool init_buffers(struct vl_compositor *c) { struct pipe_vertex_element vertex_elems[3]; + memset(vertex_elems, 0, sizeof(vertex_elems)); assert(c); @@ -571,6 +572,8 @@ vl_compositor_set_buffer_layer(struct vl_compositor_state *s, if (buffer->interlaced) { float half_a_line = 0.5f / s->layers[layer].zw.y; switch(deinterlace) { + case VL_COMPOSITOR_NONE: + case VL_COMPOSITOR_MOTION_ADAPTIVE: case VL_COMPOSITOR_WEAVE: if (c->pipe_cs_composit_supported) s->layers[layer].cs = c->cs_weave_rgb; @@ -777,6 +780,8 @@ vl_compositor_init(struct vl_compositor *c, struct pipe_context *pipe) c->pipe_gfx_supported = pipe->screen->get_param(pipe->screen, PIPE_CAP_GRAPHICS); c->pipe = pipe; + c->deinterlace = VL_COMPOSITOR_NONE; + if (!init_pipe_state(c)) { return false; } diff --git a/lib/mesa/src/gallium/auxiliary/vl/vl_compositor.h b/lib/mesa/src/gallium/auxiliary/vl/vl_compositor.h index cccee0162..32ce82f73 100644 --- a/lib/mesa/src/gallium/auxiliary/vl/vl_compositor.h +++ b/lib/mesa/src/gallium/auxiliary/vl/vl_compositor.h @@ -50,9 +50,11 @@ struct pipe_context; /* deinterlace allgorithem */ enum vl_compositor_deinterlace { + VL_COMPOSITOR_NONE, VL_COMPOSITOR_WEAVE, VL_COMPOSITOR_BOB_TOP, - VL_COMPOSITOR_BOB_BOTTOM + VL_COMPOSITOR_BOB_BOTTOM, + VL_COMPOSITOR_MOTION_ADAPTIVE }; /* clockwise degree */ @@ -125,6 +127,8 @@ struct vl_compositor bool pipe_cs_composit_supported; bool pipe_gfx_supported; + enum vl_compositor_deinterlace deinterlace; + struct { struct { void *y; diff --git a/lib/mesa/src/gallium/auxiliary/vl/vl_deint_filter.c b/lib/mesa/src/gallium/auxiliary/vl/vl_deint_filter.c index 950739b6c..fa6b5046e 100644 --- a/lib/mesa/src/gallium/auxiliary/vl/vl_deint_filter.c +++ b/lib/mesa/src/gallium/auxiliary/vl/vl_deint_filter.c @@ -501,7 +501,8 @@ vl_deint_filter_render(struct vl_deint_filter *filter, sampler_views[1] = prev_sv[k]; sampler_views[2] = cur_sv[k]; sampler_views[3] = next_sv[k]; - filter->pipe->set_sampler_views(filter->pipe, PIPE_SHADER_FRAGMENT, 0, 4, 0, sampler_views); + filter->pipe->set_sampler_views(filter->pipe, PIPE_SHADER_FRAGMENT, + 0, 4, 0, false, sampler_views); /* blit current field */ fb_state.cbufs[0] = blit_surf; diff --git a/lib/mesa/src/gallium/auxiliary/vl/vl_matrix_filter.c b/lib/mesa/src/gallium/auxiliary/vl/vl_matrix_filter.c index 6c912ea86..f3e3bd5c6 100644 --- a/lib/mesa/src/gallium/auxiliary/vl/vl_matrix_filter.c +++ b/lib/mesa/src/gallium/auxiliary/vl/vl_matrix_filter.c @@ -295,7 +295,7 @@ vl_matrix_filter_render(struct vl_matrix_filter *filter, filter->pipe->bind_sampler_states(filter->pipe, PIPE_SHADER_FRAGMENT, 0, 1, &filter->sampler); filter->pipe->set_sampler_views(filter->pipe, PIPE_SHADER_FRAGMENT, - 0, 1, 0, &src); + 0, 1, 0, false, &src); filter->pipe->bind_vs_state(filter->pipe, filter->vs); filter->pipe->bind_fs_state(filter->pipe, filter->fs); filter->pipe->set_framebuffer_state(filter->pipe, &fb_state); diff --git a/lib/mesa/src/gallium/auxiliary/vl/vl_median_filter.c b/lib/mesa/src/gallium/auxiliary/vl/vl_median_filter.c index 90ae4fcf9..ca935237b 100644 --- a/lib/mesa/src/gallium/auxiliary/vl/vl_median_filter.c +++ b/lib/mesa/src/gallium/auxiliary/vl/vl_median_filter.c @@ -399,7 +399,7 @@ vl_median_filter_render(struct vl_median_filter *filter, filter->pipe->bind_sampler_states(filter->pipe, PIPE_SHADER_FRAGMENT, 0, 1, &filter->sampler); filter->pipe->set_sampler_views(filter->pipe, PIPE_SHADER_FRAGMENT, - 0, 1, 0, &src); + 0, 1, 0, false, &src); filter->pipe->bind_vs_state(filter->pipe, filter->vs); filter->pipe->bind_fs_state(filter->pipe, filter->fs); filter->pipe->set_framebuffer_state(filter->pipe, &fb_state); diff --git a/lib/mesa/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/lib/mesa/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c index e6225d2ec..8ce89351a 100644 --- a/lib/mesa/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c +++ b/lib/mesa/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c @@ -628,7 +628,7 @@ vl_mpeg12_begin_frame(struct pipe_video_codec *decoder, rect.height = tex->height0; buf->texels = - dec->context->transfer_map(dec->context, tex, 0, + dec->context->texture_map(dec->context, tex, 0, PIPE_MAP_WRITE | PIPE_MAP_DISCARD_RANGE, &rect, &buf->tex_transfer); @@ -770,7 +770,7 @@ vl_mpeg12_end_frame(struct pipe_video_codec *decoder, vl_vb_unmap(&buf->vertex_stream, dec->context); if (buf->tex_transfer) - dec->context->transfer_unmap(dec->context, buf->tex_transfer); + dec->context->texture_unmap(dec->context, buf->tex_transfer); vb[0] = dec->quads; vb[1] = dec->pos; @@ -830,7 +830,7 @@ vl_mpeg12_end_frame(struct pipe_video_codec *decoder, vl_idct_prepare_stage2(i ? &dec->idct_c : &dec->idct_y, &buf->idct[plane]); else { dec->context->set_sampler_views(dec->context, - PIPE_SHADER_FRAGMENT, 0, 1, 0, + PIPE_SHADER_FRAGMENT, 0, 1, 0, false, &mc_source_sv[plane]); dec->context->bind_sampler_states(dec->context, PIPE_SHADER_FRAGMENT, diff --git a/lib/mesa/src/gallium/auxiliary/vl/vl_vertex_buffers.c b/lib/mesa/src/gallium/auxiliary/vl/vl_vertex_buffers.c index 00c424f3b..be02b8273 100644 --- a/lib/mesa/src/gallium/auxiliary/vl/vl_vertex_buffers.c +++ b/lib/mesa/src/gallium/auxiliary/vl/vl_vertex_buffers.c @@ -136,6 +136,7 @@ vl_vb_get_quad_vertex_element(void) element.src_offset = 0; element.instance_divisor = 0; element.vertex_buffer_index = 0; + element.dual_slot = false; element.src_format = PIPE_FORMAT_R32G32_FLOAT; return element; diff --git a/lib/mesa/src/gallium/auxiliary/vl/vl_video_buffer.c b/lib/mesa/src/gallium/auxiliary/vl/vl_video_buffer.c index eb13f89dd..a8815c4ba 100644 --- a/lib/mesa/src/gallium/auxiliary/vl/vl_video_buffer.c +++ b/lib/mesa/src/gallium/auxiliary/vl/vl_video_buffer.c @@ -219,6 +219,7 @@ static struct pipe_sampler_view ** vl_video_buffer_sampler_view_planes(struct pipe_video_buffer *buffer) { struct vl_video_buffer *buf = (struct vl_video_buffer *)buffer; + unsigned num_planes = util_format_get_num_planes(buffer->buffer_format); struct pipe_sampler_view sv_templ; struct pipe_context *pipe; unsigned i; @@ -227,7 +228,7 @@ vl_video_buffer_sampler_view_planes(struct pipe_video_buffer *buffer) pipe = buf->base.context; - for (i = 0; i < buf->num_planes; ++i ) { + for (i = 0; i < num_planes; ++i ) { if (!buf->sampler_view_planes[i]) { memset(&sv_templ, 0, sizeof(sv_templ)); u_sampler_view_default_template(&sv_templ, buf->resources[i], buf->resources[i]->format); @@ -244,7 +245,7 @@ vl_video_buffer_sampler_view_planes(struct pipe_video_buffer *buffer) return buf->sampler_view_planes; error: - for (i = 0; i < buf->num_planes; ++i ) + for (i = 0; i < num_planes; ++i ) pipe_sampler_view_reference(&buf->sampler_view_planes[i], NULL); return NULL; diff --git a/lib/mesa/src/gallium/auxiliary/vl/vl_winsys_dri3.c b/lib/mesa/src/gallium/auxiliary/vl/vl_winsys_dri3.c index f2dd810b4..baa12fa95 100644 --- a/lib/mesa/src/gallium/auxiliary/vl/vl_winsys_dri3.c +++ b/lib/mesa/src/gallium/auxiliary/vl/vl_winsys_dri3.c @@ -55,6 +55,7 @@ struct vl_dri3_buffer struct pipe_resource *linear_texture; uint32_t pixmap; + uint32_t region; uint32_t sync_fence; struct xshmfence *shm_fence; @@ -107,6 +108,8 @@ static void dri3_free_back_buffer(struct vl_dri3_screen *scrn, struct vl_dri3_buffer *buffer) { + if (buffer->region) + xcb_xfixes_destroy_region(scrn->conn, buffer->region); xcb_free_pixmap(scrn->conn, buffer->pixmap); xcb_sync_destroy_fence(scrn->conn, buffer->sync_fence); xshmfence_unmap_shm(buffer->shm_fence); @@ -564,7 +567,6 @@ vl_dri3_flush_frontbuffer(struct pipe_screen *screen, uint32_t options = XCB_PRESENT_OPTION_NONE; struct vl_dri3_buffer *back; struct pipe_box src_box; - xcb_xfixes_region_t region; xcb_rectangle_t rectangle; back = scrn->back_buffers[scrn->cur_back]; @@ -580,8 +582,11 @@ vl_dri3_flush_frontbuffer(struct pipe_screen *screen, rectangle.width = (scrn->output_texture) ? scrn->clip_width : scrn->width; rectangle.height = (scrn->output_texture) ? scrn->clip_height : scrn->height; - region = xcb_generate_id(scrn->conn); - xcb_xfixes_create_region(scrn->conn, region, 2, &rectangle); + if (!back->region) { + back->region = xcb_generate_id(scrn->conn); + xcb_xfixes_create_region(scrn->conn, back->region, 0, NULL); + } + xcb_xfixes_set_region(scrn->conn, back->region, 1, &rectangle); if (scrn->is_different_gpu) { u_box_origin_2d(back->width, back->height, &src_box); @@ -600,7 +605,7 @@ vl_dri3_flush_frontbuffer(struct pipe_screen *screen, scrn->drawable, back->pixmap, (uint32_t)(++scrn->send_sbc), - 0, region, 0, 0, + 0, back->region, 0, 0, None, None, back->sync_fence, options, diff --git a/lib/mesa/src/gallium/auxiliary/vl/vl_zscan.c b/lib/mesa/src/gallium/auxiliary/vl/vl_zscan.c index d225265d0..543c9340f 100644 --- a/lib/mesa/src/gallium/auxiliary/vl/vl_zscan.c +++ b/lib/mesa/src/gallium/auxiliary/vl/vl_zscan.c @@ -409,7 +409,7 @@ vl_zscan_layout(struct pipe_context *pipe, const int layout[64], unsigned blocks if (!res) goto error_resource; - f = pipe->transfer_map(pipe, res, + f = pipe->texture_map(pipe, res, 0, PIPE_MAP_WRITE | PIPE_MAP_DISCARD_RANGE, &rect, &buf_transfer); if (!f) @@ -428,7 +428,7 @@ vl_zscan_layout(struct pipe_context *pipe, const int layout[64], unsigned blocks f[i * VL_BLOCK_WIDTH + y * pitch + x] = addr; } - pipe->transfer_unmap(pipe, buf_transfer); + pipe->texture_unmap(pipe, buf_transfer); memset(&sv_tmpl, 0, sizeof(sv_tmpl)); u_sampler_view_default_template(&sv_tmpl, res, res->format); @@ -579,7 +579,7 @@ vl_zscan_upload_quant(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer, rect.width *= zscan->blocks_per_line; - data = pipe->transfer_map(pipe, buffer->quant->texture, + data = pipe->texture_map(pipe, buffer->quant->texture, 0, PIPE_MAP_WRITE | PIPE_MAP_DISCARD_RANGE, &rect, &buf_transfer); @@ -593,7 +593,7 @@ vl_zscan_upload_quant(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer, for (x = 0; x < VL_BLOCK_WIDTH; ++x) data[i * VL_BLOCK_WIDTH + y * pitch + x] = matrix[x + y * VL_BLOCK_WIDTH]; - pipe->transfer_unmap(pipe, buf_transfer); + pipe->texture_unmap(pipe, buf_transfer); } void @@ -608,7 +608,7 @@ vl_zscan_render(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer, unsigned zscan->pipe->set_framebuffer_state(zscan->pipe, &buffer->fb_state); zscan->pipe->set_viewport_states(zscan->pipe, 0, 1, &buffer->viewport); zscan->pipe->set_sampler_views(zscan->pipe, PIPE_SHADER_FRAGMENT, - 0, 3, 0, &buffer->src); + 0, 3, 0, false, &buffer->src); zscan->pipe->bind_vs_state(zscan->pipe, zscan->vs); zscan->pipe->bind_fs_state(zscan->pipe, zscan->fs); util_draw_arrays_instanced(zscan->pipe, PIPE_PRIM_QUADS, 0, 4, 0, num_instances); |