depth == util_num_layers(tex, level);
}
+static inline struct pipe_context *
+pipe_create_multimedia_context(struct pipe_screen *screen)
+{
+ unsigned flags = 0;
+
+ if (!screen->get_param(screen, PIPE_CAP_GRAPHICS))
+ flags |= PIPE_CONTEXT_COMPUTE_ONLY;
+
+ return screen->context_create(screen, NULL, flags);
+}
+
#ifdef __cplusplus
}
#endif
dec->base = *templat;
dec->base.context = context;
- dec->context = context->screen->context_create(context->screen, NULL, 0);
+ dec->context = pipe_create_multimedia_context(context->screen);
dec->base.destroy = vl_mpeg12_destroy;
dec->base.begin_frame = vl_mpeg12_begin_frame;
if (!scrn->base.pscreen)
goto release_pipe;
- scrn->pipe = scrn->base.pscreen->context_create(scrn->base.pscreen,
- NULL, 0);
+ scrn->pipe = pipe_create_multimedia_context(scrn->base.pscreen);
if (!scrn->pipe)
goto no_context;
return OMX_ErrorInsufficientResources;
screen = priv->screen->pscreen;
- priv->pipe = screen->context_create(screen, NULL, 0);
+ priv->pipe = pipe_create_multimedia_context(screen);
if (!priv->pipe)
return OMX_ErrorInsufficientResources;
PIPE_VIDEO_ENTRYPOINT_ENCODE, PIPE_VIDEO_CAP_SUPPORTED))
return OMX_ErrorBadParameter;
- priv->s_pipe = screen->context_create(screen, NULL, 0);
+ priv->s_pipe = pipe_create_multimedia_context(screen);
if (!priv->s_pipe)
return OMX_ErrorInsufficientResources;
return OMX_ErrorInsufficientResources;
}
- priv->t_pipe = screen->context_create(screen, NULL, 0);
+ priv->t_pipe = pipe_create_multimedia_context(screen);
if (!priv->t_pipe)
return OMX_ErrorInsufficientResources;
return OMX_ErrorInsufficientResources;
screen = priv->screen->pscreen;
- priv->pipe = screen->context_create(screen, priv->screen, 0);
+ priv->pipe = pipe_create_multimedia_context(screen);
if (!priv->pipe)
return OMX_ErrorInsufficientResources;
PIPE_VIDEO_ENTRYPOINT_ENCODE, PIPE_VIDEO_CAP_SUPPORTED))
return OMX_ErrorBadParameter;
- priv->s_pipe = screen->context_create(screen, NULL, 0);
+ priv->s_pipe = pipe_create_multimedia_context(screen);
if (!priv->s_pipe)
return OMX_ErrorInsufficientResources;
return OMX_ErrorInsufficientResources;
}
- priv->t_pipe = screen->context_create(screen, NULL, 0);
+ priv->t_pipe = pipe_create_multimedia_context(screen);
if (!priv->t_pipe)
return OMX_ErrorInsufficientResources;
if (!drv->vscreen)
goto error_screen;
- drv->pipe = drv->vscreen->pscreen->context_create(drv->vscreen->pscreen,
- NULL, 0);
+ drv->pipe = pipe_create_multimedia_context(drv->vscreen->pscreen);
if (!drv->pipe)
goto error_pipe;
}
pscreen = dev->vscreen->pscreen;
- dev->context = pscreen->context_create(pscreen, NULL, 0);
+ dev->context = pipe_create_multimedia_context(pscreen);
if (!dev->context) {
ret = VDP_STATUS_RESOURCES;
goto no_context;