diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.c b/src/gallium/drivers/etnaviv/etnaviv_context.c index baca59116f0..8c9e9cdc576 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_context.c +++ b/src/gallium/drivers/etnaviv/etnaviv_context.c @@ -618,6 +618,8 @@ etna_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags) struct etna_context *ctx = CALLOC_STRUCT(etna_context); struct etna_screen *screen; struct pipe_context *pctx; + struct etna_pipe *pipe; + bool compute_only = flags & PIPE_CONTEXT_COMPUTE_ONLY; if (ctx == NULL) return NULL; @@ -631,7 +633,8 @@ etna_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags) pctx->const_uploader = pctx->stream_uploader; screen = etna_screen(pscreen); - ctx->stream = etna_cmd_stream_new(screen->pipe, 0x2000, + pipe = (compute_only && screen->pipe_nn) ? screen->pipe_nn : screen->pipe; + ctx->stream = etna_cmd_stream_new(pipe, 0x2000, &etna_context_force_flush, pctx); if (ctx->stream == NULL) goto fail; @@ -655,7 +658,7 @@ etna_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags) /* need some sane default in case gallium frontends don't set some state: */ ctx->sample_mask = 0xffff; - ctx->compute_only = flags & PIPE_CONTEXT_COMPUTE_ONLY; + ctx->compute_only = compute_only; /* Set sensible defaults for state */ etna_reset_gpu_state(ctx); diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c index a3d3bfff6ac..17d5af72cd2 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c @@ -103,6 +103,9 @@ etna_screen_destroy(struct pipe_screen *pscreen) etna_shader_screen_fini(pscreen); + if (screen->pipe_nn) + etna_pipe_del(screen->pipe_nn); + if (screen->pipe) etna_pipe_del(screen->pipe); @@ -1092,6 +1095,14 @@ etna_screen_create(struct etna_device *dev, struct etna_gpu *gpu, goto fail; } + if (gpu != npu) { + screen->pipe_nn = etna_pipe_new(npu, ETNA_PIPE_3D); + if (!screen->pipe_nn) { + DBG("could not create nn pipe"); + goto fail; + } + } + /* apply debug options that disable individual features */ if (DBG_ENABLED(ETNA_DBG_NO_EARLY_Z)) etna_core_disable_feature(screen->info, ETNA_FEATURE_NO_EARLY_Z); diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.h b/src/gallium/drivers/etnaviv/etnaviv_screen.h index d45ce5fdb6a..c2fddd968b4 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_screen.h +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.h @@ -51,6 +51,7 @@ struct etna_screen { struct etna_gpu *gpu; struct etna_gpu *npu; struct etna_pipe *pipe; + struct etna_pipe *pipe_nn; struct etna_perfmon *perfmon; struct renderonly *ro;