diff options
author | Dave Airlie <airlied@redhat.com> | 2009-02-04 15:12:16 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-02-04 15:12:16 +1000 |
commit | 88a409fa8e85a45eb71f99e5926340a5fe6a8071 (patch) | |
tree | 039ac5d9fe69eb94325c39be5f5553838819c144 /src/mesa/drivers/dri/radeon/common_misc.c | |
parent | c370776b02806c6c98d1354e3d60d06311dcfb80 (diff) |
r300: fix up CS for modesetting - gears under kms works
Diffstat (limited to 'src/mesa/drivers/dri/radeon/common_misc.c')
-rw-r--r-- | src/mesa/drivers/dri/radeon/common_misc.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/radeon/common_misc.c b/src/mesa/drivers/dri/radeon/common_misc.c index f2b1213cb4..ec53007122 100644 --- a/src/mesa/drivers/dri/radeon/common_misc.c +++ b/src/mesa/drivers/dri/radeon/common_misc.c @@ -691,8 +691,13 @@ void rcommonInitCmdBuf(radeonContextPtr rmesa, int max_state_size) radeon_cs_set_limit(rmesa->cmdbuf.cs, RADEON_GEM_DOMAIN_VRAM, rmesa->radeonScreen->texSize[0]); radeon_cs_set_limit(rmesa->cmdbuf.cs, RADEON_GEM_DOMAIN_GTT, rmesa->radeonScreen->gartTextures.size); } else { - radeon_cs_set_limit(rmesa->cmdbuf.cs, RADEON_GEM_DOMAIN_VRAM, rmesa->radeonScreen->texSize[0]); - radeon_cs_set_limit(rmesa->cmdbuf.cs, RADEON_GEM_DOMAIN_GTT, rmesa->radeonScreen->gartTextures.size); + struct drm_radeon_gem_info mminfo; + + if (!drmCommandWriteRead(rmesa->dri.fd, DRM_RADEON_GEM_INFO, &mminfo, sizeof(mminfo))) + { + radeon_cs_set_limit(rmesa->cmdbuf.cs, RADEON_GEM_DOMAIN_VRAM, mminfo.vram_size); + radeon_cs_set_limit(rmesa->cmdbuf.cs, RADEON_GEM_DOMAIN_GTT, mminfo.gart_size); + } } } @@ -2412,7 +2417,7 @@ void radeonSpanRenderFinish(GLcontext * ctx) void radeonRefillCurrentDmaRegion(radeonContextPtr rmesa, int size) { struct radeon_cs_space_check bos[1]; - int flushed, ret; + int flushed = 0, ret; size = MAX2(size, MAX_DMA_BUF_SZ * 16); @@ -2464,10 +2469,8 @@ again: assert(0); } flushed = 1; - goto again; + goto again_alloc; } - - radeon_bo_map(rmesa->dma.current, 1); } |