diff options
Diffstat (limited to 'linux-core')
-rw-r--r-- | linux-core/Makefile.kernel | 2 | ||||
-rw-r--r-- | linux-core/i915_execbuf.c | 6 | ||||
-rw-r--r-- | linux-core/nouveau_bo.c (renamed from linux-core/nouveau_buffer.c) | 6 |
3 files changed, 13 insertions, 1 deletions
diff --git a/linux-core/Makefile.kernel b/linux-core/Makefile.kernel index defbe43b..f012262d 100644 --- a/linux-core/Makefile.kernel +++ b/linux-core/Makefile.kernel @@ -23,7 +23,7 @@ i915-objs := i915_drv.o i915_dma.o i915_irq.o i915_mem.o i915_fence.o \ i915_buffer.o i915_compat.o i915_execbuf.o nouveau-objs := nouveau_drv.o nouveau_state.o nouveau_fifo.o nouveau_mem.o \ nouveau_object.o nouveau_irq.o nouveau_notifier.o nouveau_swmthd.o \ - nouveau_sgdma.o nouveau_dma.o nouveau_buffer.o nouveau_fence.o \ + nouveau_sgdma.o nouveau_dma.o nouveau_bo.o nouveau_fence.o \ nv04_timer.o \ nv04_mc.o nv40_mc.o nv50_mc.o \ nv04_fb.o nv10_fb.o nv40_fb.o \ diff --git a/linux-core/i915_execbuf.c b/linux-core/i915_execbuf.c index ff83d795..ae4a6121 100644 --- a/linux-core/i915_execbuf.c +++ b/linux-core/i915_execbuf.c @@ -138,6 +138,8 @@ int i915_apply_reloc(struct drm_file *file_priv, int num_buffers, new_cmd_offset = reloc[0]; if (!relocatee->data_page || !drm_bo_same_page(relocatee->offset, new_cmd_offset)) { + struct drm_bo_mem_reg *mem = &relocatee->buf->mem; + drm_bo_kunmap(&relocatee->kmap); relocatee->data_page = NULL; relocatee->offset = new_cmd_offset; @@ -149,6 +151,10 @@ int i915_apply_reloc(struct drm_file *file_priv, int num_buffers, relocatee->idle = I915_RELOC_IDLE; } + if (unlikely((mem->mem_type != DRM_BO_MEM_LOCAL) && + (mem->flags & DRM_BO_FLAG_CACHED_MAPPED))) + drm_bo_evict_cached(relocatee->buf); + ret = drm_bo_kmap(relocatee->buf, new_cmd_offset >> PAGE_SHIFT, 1, &relocatee->kmap); if (ret) { diff --git a/linux-core/nouveau_buffer.c b/linux-core/nouveau_bo.c index 11549317..7a899769 100644 --- a/linux-core/nouveau_buffer.c +++ b/linux-core/nouveau_bo.c @@ -262,6 +262,12 @@ nouveau_bo_move(struct drm_buffer_object *bo, int evict, int no_wait, // if (nouveau_bo_move_m2mf(bo, evict, no_wait, new_mem)) return drm_bo_move_memcpy(bo, evict, no_wait, new_mem); } + + if (0) { + nouveau_bo_move_m2mf(bo, 0, 0, NULL); + nouveau_bo_move_gart(bo, 0, 0, NULL); + } + return 0; } |