Lines Matching refs:buf_priv
58 drm_i810_buf_priv_t *buf_priv = buf->dev_private; in i810_freelist_get() local
60 used = cmpxchg(buf_priv->in_use, I810_BUF_FREE, in i810_freelist_get()
74 drm_i810_buf_priv_t *buf_priv = buf->dev_private; in i810_freelist_put() local
78 used = cmpxchg(buf_priv->in_use, I810_BUF_CLIENT, I810_BUF_FREE); in i810_freelist_put()
93 drm_i810_buf_priv_t *buf_priv; in i810_mmap_buffers() local
98 buf_priv = buf->dev_private; in i810_mmap_buffers()
102 buf_priv->currently_mapped = I810_BUF_MAPPED; in i810_mmap_buffers()
123 drm_i810_buf_priv_t *buf_priv = buf->dev_private; in i810_map_buffer() local
128 if (buf_priv->currently_mapped == I810_BUF_MAPPED) in i810_map_buffer()
135 buf_priv->virtual = (void *)vm_mmap(file_priv->filp, 0, buf->total, in i810_map_buffer()
140 if (IS_ERR(buf_priv->virtual)) { in i810_map_buffer()
143 retcode = PTR_ERR(buf_priv->virtual); in i810_map_buffer()
144 buf_priv->virtual = NULL; in i810_map_buffer()
152 drm_i810_buf_priv_t *buf_priv = buf->dev_private; in i810_unmap_buffer() local
155 if (buf_priv->currently_mapped != I810_BUF_MAPPED) in i810_unmap_buffer()
158 retcode = vm_munmap((unsigned long)buf_priv->virtual, in i810_unmap_buffer()
161 buf_priv->currently_mapped = I810_BUF_UNMAPPED; in i810_unmap_buffer()
162 buf_priv->virtual = NULL; in i810_unmap_buffer()
171 drm_i810_buf_priv_t *buf_priv; in i810_dma_get_buffer() local
188 buf_priv = buf->dev_private; in i810_dma_get_buffer()
192 d->virtual = buf_priv->virtual; in i810_dma_get_buffer()
225 drm_i810_buf_priv_t *buf_priv = buf->dev_private; in i810_dma_cleanup() local
227 if (buf_priv->kernel_virtual && buf->total) in i810_dma_cleanup()
228 drm_legacy_ioremapfree(&buf_priv->map, dev); in i810_dma_cleanup()
293 drm_i810_buf_priv_t *buf_priv = buf->dev_private; in i810_freelist_init() local
295 buf_priv->in_use = hw_status++; in i810_freelist_init()
296 buf_priv->my_use_idx = my_idx; in i810_freelist_init()
299 *buf_priv->in_use = I810_BUF_FREE; in i810_freelist_init()
301 buf_priv->map.offset = buf->bus_address; in i810_freelist_init()
302 buf_priv->map.size = buf->total; in i810_freelist_init()
303 buf_priv->map.type = _DRM_AGP; in i810_freelist_init()
304 buf_priv->map.flags = 0; in i810_freelist_init()
305 buf_priv->map.mtrr = 0; in i810_freelist_init()
307 drm_legacy_ioremap(&buf_priv->map, dev); in i810_freelist_init()
308 buf_priv->kernel_virtual = buf_priv->map.handle; in i810_freelist_init()
710 drm_i810_buf_priv_t *buf_priv = buf->dev_private; in i810_dma_dispatch_vertex() local
730 if (buf_priv->currently_mapped == I810_BUF_MAPPED) { in i810_dma_dispatch_vertex()
733 *(u32 *) buf_priv->kernel_virtual = in i810_dma_dispatch_vertex()
737 *(u32 *) ((char *) buf_priv->kernel_virtual + used) = 0; in i810_dma_dispatch_vertex()
770 (void)cmpxchg(buf_priv->in_use, I810_BUF_CLIENT, in i810_dma_dispatch_vertex()
778 OUT_RING(buf_priv->my_use_idx); in i810_dma_dispatch_vertex()
867 drm_i810_buf_priv_t *buf_priv = buf->dev_private; in i810_flush_queue() local
869 int used = cmpxchg(buf_priv->in_use, I810_BUF_HARDWARE, in i810_flush_queue()
899 drm_i810_buf_priv_t *buf_priv = buf->dev_private; in i810_driver_reclaim_buffers() local
901 if (buf->file_priv == file_priv && buf_priv) { in i810_driver_reclaim_buffers()
902 int used = cmpxchg(buf_priv->in_use, I810_BUF_CLIENT, in i810_driver_reclaim_buffers()
907 if (buf_priv->currently_mapped == I810_BUF_MAPPED) in i810_driver_reclaim_buffers()
908 buf_priv->currently_mapped = I810_BUF_UNMAPPED; in i810_driver_reclaim_buffers()
1031 drm_i810_buf_priv_t *buf_priv = buf->dev_private; in i810_dma_dispatch_mc() local
1040 u = cmpxchg(buf_priv->in_use, I810_BUF_CLIENT, I810_BUF_HARDWARE); in i810_dma_dispatch_mc()
1057 if (buf_priv->currently_mapped == I810_BUF_MAPPED) { in i810_dma_dispatch_mc()
1059 *(u32 *) ((char *) buf_priv->virtual + used) = 0; in i810_dma_dispatch_mc()
1074 OUT_RING(buf_priv->my_use_idx); in i810_dma_dispatch_mc()