frontends/va: Set csc matrix in PutSurface
Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11889 Acked-by: Ruijing Dong <ruijing.dong@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32890>
This commit is contained in:
@@ -415,6 +415,7 @@ vlVaPutSurface(VADriverContextP ctx, VASurfaceID surface_id, void* draw, short s
|
|||||||
struct u_rect dst_rect = {destx, destx + destw, desty, desty + desth};
|
struct u_rect dst_rect = {destx, destx + destw, desty, desty + desth};
|
||||||
enum pipe_format format;
|
enum pipe_format format;
|
||||||
VAStatus status;
|
VAStatus status;
|
||||||
|
enum VL_CSC_COLOR_STANDARD color_standard;
|
||||||
|
|
||||||
if (!ctx)
|
if (!ctx)
|
||||||
return VA_STATUS_ERROR_INVALID_CONTEXT;
|
return VA_STATUS_ERROR_INVALID_CONTEXT;
|
||||||
@@ -455,6 +456,16 @@ vlVaPutSurface(VADriverContextP ctx, VASurfaceID surface_id, void* draw, short s
|
|||||||
|
|
||||||
format = surf->buffer->buffer_format;
|
format = surf->buffer->buffer_format;
|
||||||
|
|
||||||
|
if (flags & VA_SRC_BT601)
|
||||||
|
color_standard = VL_CSC_COLOR_STANDARD_BT_601;
|
||||||
|
else if (flags & VA_SRC_SMPTE_240)
|
||||||
|
color_standard = VL_CSC_COLOR_STANDARD_SMPTE_240M;
|
||||||
|
else
|
||||||
|
color_standard = VL_CSC_COLOR_STANDARD_BT_709;
|
||||||
|
|
||||||
|
vl_csc_get_matrix(color_standard, NULL, true, &drv->csc);
|
||||||
|
vl_compositor_set_csc_matrix(&drv->cstate, (const vl_csc_matrix *)&drv->csc, 1.0f, 0.0f);
|
||||||
|
|
||||||
vl_compositor_clear_layers(&drv->cstate);
|
vl_compositor_clear_layers(&drv->cstate);
|
||||||
|
|
||||||
if (format == PIPE_FORMAT_B8G8R8A8_UNORM || format == PIPE_FORMAT_B8G8R8X8_UNORM ||
|
if (format == PIPE_FORMAT_B8G8R8A8_UNORM || format == PIPE_FORMAT_B8G8R8X8_UNORM ||
|
||||||
|
Reference in New Issue
Block a user