Lines Matching refs:primary
80 drm_mga_primary_buffer_t *primary = &dev_priv->prim; in mga_do_dma_reset() local
86 primary->tail = 0; in mga_do_dma_reset()
87 primary->space = primary->size; in mga_do_dma_reset()
88 primary->last_flush = 0; in mga_do_dma_reset()
107 drm_mga_primary_buffer_t *primary = &dev_priv->prim; in mga_do_dma_flush() local
122 if (primary->tail == primary->last_flush) { in mga_do_dma_flush()
127 tail = primary->tail + dev_priv->primary->offset; in mga_do_dma_flush()
141 primary->last_flush = primary->tail; in mga_do_dma_flush()
146 primary->space = primary->size - primary->tail; in mga_do_dma_flush()
148 primary->space = head - tail; in mga_do_dma_flush()
150 DRM_DEBUG(" head = 0x%06lx\n", (unsigned long)(head - dev_priv->primary->offset)); in mga_do_dma_flush()
151 DRM_DEBUG(" tail = 0x%06lx\n", (unsigned long)(tail - dev_priv->primary->offset)); in mga_do_dma_flush()
152 DRM_DEBUG(" space = 0x%06x\n", primary->space); in mga_do_dma_flush()
162 drm_mga_primary_buffer_t *primary = &dev_priv->prim; in mga_do_dma_wrap_start() local
175 tail = primary->tail + dev_priv->primary->offset; in mga_do_dma_wrap_start()
177 primary->tail = 0; in mga_do_dma_wrap_start()
178 primary->last_flush = 0; in mga_do_dma_wrap_start()
179 primary->last_wrap++; in mga_do_dma_wrap_start()
183 if (head == dev_priv->primary->offset) in mga_do_dma_wrap_start()
184 primary->space = primary->size; in mga_do_dma_wrap_start()
186 primary->space = head - dev_priv->primary->offset; in mga_do_dma_wrap_start()
188 DRM_DEBUG(" head = 0x%06lx\n", (unsigned long)(head - dev_priv->primary->offset)); in mga_do_dma_wrap_start()
189 DRM_DEBUG(" tail = 0x%06x\n", primary->tail); in mga_do_dma_wrap_start()
190 DRM_DEBUG(" wrap = %d\n", primary->last_wrap); in mga_do_dma_wrap_start()
191 DRM_DEBUG(" space = 0x%06x\n", primary->space); in mga_do_dma_wrap_start()
196 set_bit(0, &primary->wrapped); in mga_do_dma_wrap_start()
202 drm_mga_primary_buffer_t *primary = &dev_priv->prim; in mga_do_dma_wrap_end() local
204 u32 head = dev_priv->primary->offset; in mga_do_dma_wrap_end()
213 clear_bit(0, &primary->wrapped); in mga_do_dma_wrap_end()
234 dev_priv->primary->offset)); in mga_freelist_print()
240 (unsigned long)(entry->age.head - dev_priv->primary->offset)); in mga_freelist_print()
338 (unsigned long)(tail->age.head - dev_priv->primary->offset) : 0, in mga_freelist_get()
341 (unsigned long)(head - dev_priv->primary->offset), wrap); in mga_freelist_get()
365 dev_priv->primary->offset), in mga_freelist_put()
528 _DRM_AGP, _DRM_READ_ONLY, &dev_priv->primary); in mga_do_agp_dma_bootstrap()
577 drm_core_ioremap(dev_priv->primary, dev); in mga_do_agp_dma_bootstrap()
581 !dev_priv->primary->handle || !dev->agp_buffer_map->handle) { in mga_do_agp_dma_bootstrap()
583 dev_priv->warp->handle, dev_priv->primary->handle, in mga_do_agp_dma_bootstrap()
656 _DRM_READ_ONLY, &dev_priv->primary); in mga_do_pci_dma_bootstrap()
666 if (dev_priv->primary->size != dma_bs->primary_size) { in mga_do_pci_dma_bootstrap()
669 (unsigned)dev_priv->primary->size); in mga_do_pci_dma_bootstrap()
670 dma_bs->primary_size = dev_priv->primary->size; in mga_do_pci_dma_bootstrap()
845 dev_priv->primary = drm_core_findmap(dev, init->primary_offset); in mga_do_init_dma()
846 if (!dev_priv->primary) { in mga_do_init_dma()
859 drm_core_ioremap(dev_priv->primary, dev); in mga_do_init_dma()
868 !dev_priv->primary->handle || in mga_do_init_dma()
894 MGA_WRITE(MGA_PRIMADDRESS, dev_priv->primary->offset | MGA_DMA_GENERAL); in mga_do_init_dma()
900 dev_priv->prim.start = (u8 *) dev_priv->primary->handle; in mga_do_init_dma()
901 dev_priv->prim.end = ((u8 *) dev_priv->primary->handle in mga_do_init_dma()
902 + dev_priv->primary->size); in mga_do_init_dma()
903 dev_priv->prim.size = dev_priv->primary->size; in mga_do_init_dma()
914 dev_priv->prim.status[0] = dev_priv->primary->offset; in mga_do_init_dma()
948 if ((dev_priv->primary != NULL) in mga_do_cleanup_dma()
949 && (dev_priv->primary->type != _DRM_CONSISTENT)) in mga_do_cleanup_dma()
950 drm_core_ioremapfree(dev_priv->primary, dev); in mga_do_cleanup_dma()
978 dev_priv->primary = NULL; in mga_do_cleanup_dma()