nouveau: cleanups

main
Ben Skeggs 2007-11-05 03:53:46 +11:00
parent c1008104ad
commit 0a2ab1a900
4 changed files with 20 additions and 15 deletions

View File

@ -55,7 +55,6 @@ nouveau_bo_fence_type(struct drm_buffer_object *bo,
uint32_t *fclass, uint32_t *type) uint32_t *fclass, uint32_t *type)
{ {
*fclass = 0; *fclass = 0;
if (bo->mem.mask & (DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE)) if (bo->mem.mask & (DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE))
*type = 3; *type = 3;
else else
@ -191,9 +190,8 @@ nouveau_bo_move_m2mf(struct drm_buffer_object *bo, int evict, int no_wait,
page_count -= line_count; page_count -= line_count;
} }
return drm_bo_move_accel_cleanup(bo, evict, no_wait, 0, return drm_bo_move_accel_cleanup(bo, evict, no_wait, dchan->chan->id,
DRM_FENCE_TYPE_EXE, DRM_FENCE_TYPE_EXE, 0, new_mem);
0, new_mem);
} }
static int static int

View File

@ -54,13 +54,17 @@ nouveau_fence_emit(struct drm_device *dev, uint32_t class, uint32_t flags,
DRM_DEBUG("class=%d, flags=0x%08x\n", class, flags); DRM_DEBUG("class=%d, flags=0x%08x\n", class, flags);
/* We can't emit fences on client channels */ /* We can't emit fences on client channels, update sequence number
if (chan != dchan->chan) * and userspace will emit the fence
return 0; */
*breadcrumb = ++chan->next_sequence;
*breadcrumb = ++dchan->next_sequence;
*native_type = DRM_FENCE_TYPE_EXE; *native_type = DRM_FENCE_TYPE_EXE;
if (chan != dchan->chan) {
DRM_DEBUG("user fence 0x%08x\n", *breadcrumb);
return 0;
}
DRM_DEBUG("emit 0x%08x\n", *breadcrumb);
BEGIN_RING(NvSubM2MF, NV_MEMORY_TO_MEMORY_FORMAT_SET_REF, 1); BEGIN_RING(NvSubM2MF, NV_MEMORY_TO_MEMORY_FORMAT_SET_REF, 1);
OUT_RING (*breadcrumb); OUT_RING (*breadcrumb);
BEGIN_RING(NvSubM2MF, NV_MEMORY_TO_MEMORY_FORMAT_NOTIFY, 1); BEGIN_RING(NvSubM2MF, NV_MEMORY_TO_MEMORY_FORMAT_NOTIFY, 1);
@ -83,10 +87,13 @@ nouveau_fence_perform_flush(struct drm_device *dev, uint32_t class)
pending_types = fc->pending_flush | pending_types = fc->pending_flush |
((fc->pending_exe_flush) ? DRM_FENCE_TYPE_EXE : 0); ((fc->pending_exe_flush) ? DRM_FENCE_TYPE_EXE : 0);
DRM_DEBUG("pending: 0x%08x 0x%08x\n", pending_types,
fc->pending_flush);
if (pending_types) { if (pending_types) {
uint32_t sequence = NV_READ(NV03_FIFO_REGS(class) + 0x48); uint32_t sequence = NV_READ(NV03_FIFO_REGS(class) + 0x48);
DRM_DEBUG("got 0x%08x\n", sequence);
drm_fence_handler(dev, class, sequence, pending_types, 0); drm_fence_handler(dev, class, sequence, pending_types, 0);
} }
} }

View File

@ -106,6 +106,9 @@ struct nouveau_channel
/* mapping of the regs controling the fifo */ /* mapping of the regs controling the fifo */
drm_local_map_t *regs; drm_local_map_t *regs;
/* Fencing */
uint32_t next_sequence;
/* DMA push buffer */ /* DMA push buffer */
struct nouveau_gpuobj_ref *pushbuf; struct nouveau_gpuobj_ref *pushbuf;
struct mem_block *pushbuf_mem; struct mem_block *pushbuf_mem;
@ -146,9 +149,6 @@ struct nouveau_drm_channel {
/* Notifiers */ /* Notifiers */
uint32_t notify0_offset; uint32_t notify0_offset;
/* Fences */
uint32_t next_sequence;
/* Buffer moves */ /* Buffer moves */
uint32_t m2mf_dma_source; uint32_t m2mf_dma_source;
uint32_t m2mf_dma_destin; uint32_t m2mf_dma_destin;

View File

@ -115,7 +115,7 @@ nouveau_fifo_irq_handler(struct drm_device *dev)
} }
if (status) { if (status) {
DRM_INFO("Unhandled PFIFO_INTR - 0x%8x\n", status); DRM_INFO("Unhandled PFIFO_INTR - 0x%08x\n", status);
NV_WRITE(NV03_PFIFO_INTR_0, status); NV_WRITE(NV03_PFIFO_INTR_0, status);
} }
@ -395,7 +395,7 @@ nouveau_pgraph_irq_handler(struct drm_device *dev)
} }
if (status) { if (status) {
DRM_INFO("Unhandled PGRAPH_INTR - 0x%8x\n", status); DRM_INFO("Unhandled PGRAPH_INTR - 0x%08x\n", status);
NV_WRITE(NV03_PGRAPH_INTR, status); NV_WRITE(NV03_PGRAPH_INTR, status);
} }