diff options
author | Rob Clark <[email protected]> | 2014-01-11 10:34:36 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2014-02-01 11:47:08 -0500 |
commit | 4971628baedf885ba6987a2946c6e24526464125 (patch) | |
tree | 252bdd1fe354d309551773b3bb0a79cbc2026d7c /src/gallium/drivers/freedreno/a3xx | |
parent | 303df12db8a9b54a3471e259d8b38d1f4cf8b393 (diff) |
freedreno: ctx should hold ref to dev
The ctx should hold ref to dev to avoid problems if screen is destroyed
before ctx. Doesn't really fix the egl/glx issues, but at least it
prevents things from getting much worse.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a3xx')
-rw-r--r-- | src/gallium/drivers/freedreno/a3xx/fd3_context.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a3xx/fd3_gmem.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a3xx/fd3_program.c | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_context.c b/src/gallium/drivers/freedreno/a3xx/fd3_context.c index 3732896d2a2..8273e9a1a77 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_context.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_context.c @@ -105,6 +105,7 @@ fd3_context_create(struct pipe_screen *pscreen, void *priv) pctx = &fd3_ctx->base.base; + fd3_ctx->base.dev = fd_device_ref(screen->dev); fd3_ctx->base.screen = fd_screen(pscreen); pctx->destroy = fd3_context_destroy; diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c b/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c index a08b482fafb..0f0cf3104c5 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c @@ -609,7 +609,7 @@ update_vsc_pipe(struct fd_context *ctx) struct fd_vsc_pipe *pipe = &ctx->pipe[i]; if (!pipe->bo) { - pipe->bo = fd_bo_new(ctx->screen->dev, 0x40000, + pipe->bo = fd_bo_new(ctx->dev, 0x40000, DRM_FREEDRENO_GEM_TYPE_KMEM); } diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_program.c b/src/gallium/drivers/freedreno/a3xx/fd3_program.c index 2622006ff09..0886c495d89 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_program.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_program.c @@ -57,7 +57,7 @@ assemble_shader(struct pipe_context *pctx, struct fd3_shader_stateobj *so) bin = ir3_shader_assemble(so->ir, &so->info); sz = so->info.sizedwords * 4; - so->bo = fd_bo_new(ctx->screen->dev, sz, + so->bo = fd_bo_new(ctx->dev, sz, DRM_FREEDRENO_GEM_CACHE_WCOMBINE | DRM_FREEDRENO_GEM_TYPE_KMEM); |