summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-09-01 18:11:05 +0200
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-09-01 18:11:05 +0200
commit405b5d9ca8cc9f6c5c7bb764c684bf74ba7660c6 (patch)
treeb638e0fe1f0fb90d45bfb6434141e91688f4f726 /linux-core
parentef8e618cf30ab7dcbe8c7211e0c2508c5520a669 (diff)
Flag bit pattern bugfixes. Remove some error messages.
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_bo.c27
-rw-r--r--linux-core/drm_ttm.c2
2 files changed, 15 insertions, 14 deletions
diff --git a/linux-core/drm_bo.c b/linux-core/drm_bo.c
index 317b5f7a..70342ac9 100644
--- a/linux-core/drm_bo.c
+++ b/linux-core/drm_bo.c
@@ -70,7 +70,6 @@ static int drm_move_tt_to_local(drm_buffer_object_t * buf)
BUG_ON(!buf->tt);
- DRM_ERROR("Flipping out of AGP\n");
mutex_lock(&dev->struct_mutex);
drm_unbind_ttm_region(buf->ttm_region);
drm_mm_put_block(&bm->tt_manager, buf->tt);
@@ -442,8 +441,9 @@ static int drm_move_local_to_tt(drm_buffer_object_t * bo, int no_wait)
if (ret)
return ret;
-
+#ifdef BODEBUG
DRM_ERROR("Flipping in to AGP 0x%08lx\n", bo->tt->start);
+#endif
mutex_lock(&dev->struct_mutex);
ret = drm_bind_ttm_region(bo->ttm_region, bo->tt->start);
if (ret) {
@@ -459,9 +459,9 @@ static int drm_move_local_to_tt(drm_buffer_object_t * bo, int no_wait)
bo->flags |= DRM_BO_FLAG_MEM_TT;
if (bo->priv_flags & _DRM_BO_FLAG_EVICTED) {
- DRM_ERROR("Flush read caches\n");
ret = dev->driver->bo_driver->invalidate_caches(dev, bo->flags);
- DRM_ERROR("Warning: Could not flush read caches\n");
+ if (ret)
+ DRM_ERROR("Warning: Could not flush read caches\n");
}
DRM_FLAG_MASKED(bo->priv_flags, 0, _DRM_BO_FLAG_EVICTED);
@@ -919,14 +919,12 @@ static int drm_bo_move_buffer(drm_buffer_object_t * bo, uint32_t new_flags,
/*
* Flush outstanding fences.
*/
- DRM_ERROR("Flushing fences\n");
drm_bo_busy(bo);
/*
* Make sure we're not mapped.
*/
- DRM_ERROR("Wait unmapped\n");
ret = drm_bo_wait_unmapped(bo, no_wait);
if (ret)
return ret;
@@ -935,7 +933,6 @@ static int drm_bo_move_buffer(drm_buffer_object_t * bo, uint32_t new_flags,
* Wait for outstanding fences.
*/
- DRM_ERROR("Wait fences\n");
ret = drm_bo_wait(bo, 0, no_wait);
if (ret == -EINTR)
@@ -979,19 +976,21 @@ static int drm_buffer_object_validate(drm_buffer_object_t * bo,
return -EINVAL;
}
- /*
- * Check whether we need to move buffer.
- */
-
+#ifdef BODEBUG
+ DRM_ERROR("New flags 0x%08x, Old flags 0x%08x\n",
+ new_flags, bo->flags);
+#endif
ret = driver->fence_type(new_flags, &bo->fence_class, &bo->fence_flags);
- DRM_ERROR("Fence type = 0x%08x\n", bo->fence_flags);
if (ret) {
DRM_ERROR("Driver did not support given buffer permissions\n");
return ret;
}
+ /*
+ * Check whether we need to move buffer.
+ */
+
if (flag_diff & DRM_BO_MASK_MEM) {
- DRM_ERROR("Calling move buffer\n");
ret = drm_bo_move_buffer(bo, new_flags, no_wait);
if (ret)
return ret;
@@ -1050,7 +1049,7 @@ static int drm_bo_handle_validate(drm_file_t * priv, uint32_t handle,
goto out;
ret = drm_bo_new_flags(dev, bo->flags,
- (flags & mask) | (bo->flags & ~mask), hint,
+ (flags & mask) | (bo->mask & ~mask), hint,
0, &new_flags, &bo->mask);
if (ret)
diff --git a/linux-core/drm_ttm.c b/linux-core/drm_ttm.c
index 97e3e96d..26133f9c 100644
--- a/linux-core/drm_ttm.c
+++ b/linux-core/drm_ttm.c
@@ -447,7 +447,9 @@ int drm_evict_ttm_region(drm_ttm_backend_list_t * entry)
entry->num_pages);
drm_ttm_unlock_mm(ttm, 0, 1);
}
+#ifdef BODEBUG
DRM_ERROR("Unbinding\n");
+#endif
be->unbind(entry->be);
if (ttm && be->needs_cache_adjust(be)) {
drm_set_caching(ttm, entry->page_offset,