diff options
author | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2007-10-24 19:34:12 +0200 |
---|---|---|
committer | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2007-10-24 20:56:50 +0200 |
commit | d2c78f82c20f33fc9c22cab8a7ca161e57a34bf8 (patch) | |
tree | 6cd6f127c1908c9e96ea89fe0ad32a8bad99a7c0 /src/i830_memory.c | |
parent | 78aaec0ffc711742bf8ad77757ed8c15cc3f7a9f (diff) |
Adapt to DRM Lockfree and setStatus changes.
Diffstat (limited to 'src/i830_memory.c')
-rw-r--r-- | src/i830_memory.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/i830_memory.c b/src/i830_memory.c index bdfbba67..91d7bebb 100644 --- a/src/i830_memory.c +++ b/src/i830_memory.c @@ -165,7 +165,17 @@ i830_bind_memory(ScrnInfoPtr pScrn, i830_memory *mem) I830Ptr pI830 = I830PTR(pScrn); int ret; - ret = drmBOSetPin(pI830->drmSubFD, &mem->bo, 1); + ret = drmBOSetStatus(pI830->drmSubFD, &mem->bo, + DRM_BO_FLAG_MEM_VRAM | + DRM_BO_FLAG_MEM_TT | + DRM_BO_FLAG_READ | + DRM_BO_FLAG_WRITE | + DRM_BO_FLAG_NO_EVICT, + DRM_BO_MASK_MEM | + DRM_BO_FLAG_READ | + DRM_BO_FLAG_WRITE | + DRM_BO_FLAG_NO_EVICT, + 0, 0, 0); if (ret != 0) return FALSE; @@ -226,7 +236,10 @@ i830_unbind_memory(ScrnInfoPtr pScrn, i830_memory *mem) I830Ptr pI830 = I830PTR(pScrn); int ret; - ret = drmBOSetPin(pI830->drmSubFD, &mem->bo, 0); + ret = drmBOSetStatus(pI830->drmSubFD, &mem->bo, + 0, DRM_BO_FLAG_NO_EVICT, + 0, 0, 0); + if (ret == 0) { mem->bound = FALSE; /* Give buffer obviously wrong offset/end until it's re-pinned. */ @@ -739,8 +752,15 @@ i830_allocate_memory_bo(ScrnInfoPtr pScrn, const char *name, return NULL; } + /* + * Create buffers in local memory to avoid having the creation order + * determine the TT offset. Driver acceleration + * cannot handle changed front buffer TT offsets yet , + * so let's keep our fingers crossed. + */ + mask = DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE | DRM_BO_FLAG_MAPPABLE | - DRM_BO_FLAG_MEM_TT; + DRM_BO_FLAG_MEM_LOCAL; if (flags & ALLOW_SHARING) mask |= DRM_BO_FLAG_SHAREABLE; |