gallium/vl: Add vl compositor layer mirror

Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32919>
This commit is contained in:
David Rosca 2025-01-05 13:46:09 +01:00 committed by Marge Bot
parent 746ba9f2d2
commit 7fac4e3c79
2 changed files with 27 additions and 0 deletions

View file

@ -489,6 +489,7 @@ vl_compositor_clear_layers(struct vl_compositor_state *s)
s->layers[i].viewport.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z;
s->layers[i].viewport.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
s->layers[i].rotate = VL_COMPOSITOR_ROTATE_0;
s->layers[i].mirror = VL_COMPOSITOR_MIRROR_NONE;
for ( j = 0; j < 3; j++)
pipe_sampler_view_reference(&s->layers[i].sampler_views[j], NULL);
@ -717,6 +718,16 @@ vl_compositor_set_layer_rotation(struct vl_compositor_state *s,
s->layers[layer].rotate = rotate;
}
void
vl_compositor_set_layer_mirror(struct vl_compositor_state *s,
unsigned layer,
enum vl_compositor_mirror mirror)
{
assert(s);
assert(layer < VL_COMPOSITOR_MAX_LAYERS);
s->layers[layer].mirror = mirror;
}
void
vl_compositor_yuv_deint_full(struct vl_compositor_state *s,
struct vl_compositor *c,

View file

@ -68,6 +68,13 @@ enum vl_compositor_rotation
VL_COMPOSITOR_ROTATE_270
};
enum vl_compositor_mirror
{
VL_COMPOSITOR_MIRROR_NONE,
VL_COMPOSITOR_MIRROR_HORIZONTAL,
VL_COMPOSITOR_MIRROR_VERTICAL
};
/* chroma sample location */
enum vl_compositor_chroma_location
{
@ -107,6 +114,7 @@ struct vl_compositor_layer
struct vertex2f zw;
struct vertex4f colors[4];
enum vl_compositor_rotation rotate;
enum vl_compositor_mirror mirror;
};
struct vl_compositor_state
@ -313,6 +321,14 @@ vl_compositor_set_layer_rotation(struct vl_compositor_state *state,
unsigned layer,
enum vl_compositor_rotation rotate);
/**
* set the layer mirror
*/
void
vl_compositor_set_layer_mirror(struct vl_compositor_state *state,
unsigned layer,
enum vl_compositor_mirror mirror);
/**
* deinterlace yuv buffer with full abilities
*/