gallium/vl: Add param to create compute only vl_compositor
Reviewed-by: Leo Liu <leo.liu@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32794>
This commit is contained in:
@@ -819,17 +819,14 @@ vl_compositor_render(struct vl_compositor_state *s,
|
||||
}
|
||||
|
||||
bool
|
||||
vl_compositor_init(struct vl_compositor *c, struct pipe_context *pipe)
|
||||
vl_compositor_init(struct vl_compositor *c, struct pipe_context *pipe, bool compute_only)
|
||||
{
|
||||
assert(c);
|
||||
|
||||
memset(c, 0, sizeof(*c));
|
||||
|
||||
c->pipe_cs_composit_supported = pipe->screen->get_param(pipe->screen, PIPE_CAP_PREFER_COMPUTE_FOR_MULTIMEDIA) &&
|
||||
pipe->screen->get_param(pipe->screen, PIPE_CAP_TGSI_TEX_TXF_LZ) &&
|
||||
pipe->screen->get_param(pipe->screen, PIPE_CAP_TGSI_DIV);
|
||||
|
||||
c->pipe_gfx_supported = pipe->screen->get_param(pipe->screen, PIPE_CAP_GRAPHICS);
|
||||
c->pipe_cs_composit_supported = compute_only || pipe->screen->get_param(pipe->screen, PIPE_CAP_PREFER_COMPUTE_FOR_MULTIMEDIA);
|
||||
c->pipe_gfx_supported = !compute_only && pipe->screen->get_param(pipe->screen, PIPE_CAP_GRAPHICS);
|
||||
c->pipe = pipe;
|
||||
|
||||
c->deinterlace = VL_COMPOSITOR_NONE;
|
||||
|
||||
@@ -203,7 +203,7 @@ struct vl_compositor
|
||||
* initialize this compositor
|
||||
*/
|
||||
bool
|
||||
vl_compositor_init(struct vl_compositor *compositor, struct pipe_context *pipe);
|
||||
vl_compositor_init(struct vl_compositor *compositor, struct pipe_context *pipe, bool compute_only);
|
||||
|
||||
/**
|
||||
* init state bag
|
||||
|
||||
@@ -220,7 +220,7 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
|
||||
drv->vscreen->pscreen->get_param(drv->vscreen->pscreen, PIPE_CAP_COMPUTE));
|
||||
|
||||
if (can_init_compositor) {
|
||||
if (!vl_compositor_init(&drv->compositor, drv->pipe))
|
||||
if (!vl_compositor_init(&drv->compositor, drv->pipe, false))
|
||||
goto error_compositor;
|
||||
if (!vl_compositor_init_state(&drv->cstate, drv->pipe))
|
||||
goto error_compositor_state;
|
||||
|
||||
@@ -136,7 +136,7 @@ vdp_imp_device_create_x11(Display *display, int screen, VdpDevice *device,
|
||||
goto no_handle;
|
||||
}
|
||||
|
||||
if (!vl_compositor_init(&dev->compositor, dev->context)) {
|
||||
if (!vl_compositor_init(&dev->compositor, dev->context, false)) {
|
||||
ret = VDP_STATUS_ERROR;
|
||||
goto no_compositor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user