diff options
author | Jerome Glisse <[email protected]> | 2013-01-28 14:48:46 -0500 |
---|---|---|
committer | Jerome Glisse <[email protected]> | 2013-01-28 14:51:40 -0500 |
commit | 72916698b056d0559263e84372bb45cd83a1c2c2 (patch) | |
tree | 923631099fde92a5b6ce5cd114de8435dd20d720 /src/gallium/drivers/r600/r600_pipe.c | |
parent | dbb2d192de33064ae6cdb799d71c5ac89a6ea8ff (diff) |
r600g: fix segfault with old kernel9.1-branchpoint
Old kernel do not have dma support, patch pushed were missing some
of the check needed to not use dma.
Signed-off-by: Jerome Glisse <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_pipe.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_pipe.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index 676741255f5..a59578db9c4 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -151,7 +151,9 @@ static void r600_flush_from_st(struct pipe_context *ctx, *rfence = r600_create_fence(rctx); } /* flush gfx & dma ring, order does not matter as only one can be live */ - rctx->rings.dma.flush(rctx, fflags); + if (rctx->rings.dma.cs) { + rctx->rings.dma.flush(rctx, fflags); + } rctx->rings.gfx.flush(rctx, fflags); } @@ -179,8 +181,10 @@ boolean r600_rings_is_buffer_referenced(struct r600_context *ctx, if (ctx->ws->cs_is_buffer_referenced(ctx->rings.gfx.cs, buf, usage)) { return TRUE; } - if (ctx->ws->cs_is_buffer_referenced(ctx->rings.dma.cs, buf, usage)) { - return TRUE; + if (ctx->rings.dma.cs) { + if (ctx->ws->cs_is_buffer_referenced(ctx->rings.dma.cs, buf, usage)) { + return TRUE; + } } return FALSE; } @@ -211,10 +215,12 @@ void *r600_buffer_mmap_sync_with_rings(struct r600_context *ctx, return NULL; } } - if (ctx->ws->cs_is_buffer_referenced(ctx->rings.dma.cs, resource->cs_buf, rusage) && ctx->rings.dma.cs->cdw) { - ctx->rings.dma.flush(ctx, flags); - if (usage & PIPE_TRANSFER_DONTBLOCK) { - return NULL; + if (ctx->rings.dma.cs) { + if (ctx->ws->cs_is_buffer_referenced(ctx->rings.dma.cs, resource->cs_buf, rusage) && ctx->rings.dma.cs->cdw) { + ctx->rings.dma.flush(ctx, flags); + if (usage & PIPE_TRANSFER_DONTBLOCK) { + return NULL; + } } } |