aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/dri/common/dri_context.c4
-rw-r--r--src/gallium/state_trackers/vega/vg_manager.c14
2 files changed, 14 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/dri/common/dri_context.c b/src/gallium/state_trackers/dri/common/dri_context.c
index e9e00490d21..3e5a040c69e 100644
--- a/src/gallium/state_trackers/dri/common/dri_context.c
+++ b/src/gallium/state_trackers/dri/common/dri_context.c
@@ -58,6 +58,7 @@ dri_create_context(gl_api api, const struct gl_config * visual,
struct dri_context *ctx = NULL;
struct st_context_iface *st_share = NULL;
struct st_context_attribs attribs;
+ enum st_context_error ctx_err = 0;
memset(&attribs, 0, sizeof(attribs));
switch (api) {
@@ -88,7 +89,8 @@ dri_create_context(gl_api api, const struct gl_config * visual,
&screen->optionCache, sPriv->myNum, "dri");
dri_fill_st_visual(&attribs.visual, screen, visual);
- ctx->st = stapi->create_context(stapi, &screen->base, &attribs, st_share);
+ ctx->st = stapi->create_context(stapi, &screen->base, &attribs, &ctx_err,
+ st_share);
if (ctx->st == NULL)
goto fail;
ctx->st->st_manager_private = (void *) ctx;
diff --git a/src/gallium/state_trackers/vega/vg_manager.c b/src/gallium/state_trackers/vega/vg_manager.c
index dec1581fb84..e88f5f17fe5 100644
--- a/src/gallium/state_trackers/vega/vg_manager.c
+++ b/src/gallium/state_trackers/vega/vg_manager.c
@@ -163,28 +163,36 @@ vg_context_destroy(struct st_context_iface *stctxi)
static struct st_context_iface *
vg_api_create_context(struct st_api *stapi, struct st_manager *smapi,
const struct st_context_attribs *attribs,
+ enum st_context_error *error,
struct st_context_iface *shared_stctxi)
{
struct vg_context *shared_ctx = (struct vg_context *) shared_stctxi;
struct vg_context *ctx;
struct pipe_context *pipe;
- if (!(stapi->profile_mask & (1 << attribs->profile)))
+ if (!(stapi->profile_mask & (1 << attribs->profile))) {
+ *error = ST_CONTEXT_ERROR_BAD_API;
return NULL;
+ }
/* only 1.0 is supported */
- if (attribs->major > 1 || (attribs->major == 1 && attribs->minor > 0))
+ if (attribs->major > 1 || (attribs->major == 1 && attribs->minor > 0)) {
+ *error = ST_CONTEXT_ERROR_BAD_VERSION;
return NULL;
+ }
/* for VGHandle / pointer lookups */
init_handles();
pipe = smapi->screen->context_create(smapi->screen, NULL);
- if (!pipe)
+ if (!pipe) {
+ *error = ST_CONTEXT_ERROR_NO_MEMORY;
return NULL;
+ }
ctx = vg_create_context(pipe, NULL, shared_ctx);
if (!ctx) {
pipe->destroy(pipe);
+ *error = ST_CONTEXT_ERROR_NO_MEMORY;
return NULL;
}