Lines Matching refs:primary
78 drm_mga_primary_buffer_t *primary = &dev_priv->prim; in mga_do_dma_reset() local
84 primary->tail = 0; in mga_do_dma_reset()
85 primary->space = primary->size; in mga_do_dma_reset()
86 primary->last_flush = 0; in mga_do_dma_reset()
105 drm_mga_primary_buffer_t *primary = &dev_priv->prim; in mga_do_dma_flush() local
120 if (primary->tail == primary->last_flush) { in mga_do_dma_flush()
125 tail = primary->tail + dev_priv->primary->offset; in mga_do_dma_flush()
139 primary->last_flush = primary->tail; in mga_do_dma_flush()
144 primary->space = primary->size - primary->tail; in mga_do_dma_flush()
146 primary->space = head - tail; in mga_do_dma_flush()
148 DRM_DEBUG(" head = 0x%06lx\n", (unsigned long)(head - dev_priv->primary->offset)); in mga_do_dma_flush()
149 DRM_DEBUG(" tail = 0x%06lx\n", (unsigned long)(tail - dev_priv->primary->offset)); in mga_do_dma_flush()
150 DRM_DEBUG(" space = 0x%06x\n", primary->space); in mga_do_dma_flush()
160 drm_mga_primary_buffer_t *primary = &dev_priv->prim; in mga_do_dma_wrap_start() local
173 tail = primary->tail + dev_priv->primary->offset; in mga_do_dma_wrap_start()
175 primary->tail = 0; in mga_do_dma_wrap_start()
176 primary->last_flush = 0; in mga_do_dma_wrap_start()
177 primary->last_wrap++; in mga_do_dma_wrap_start()
181 if (head == dev_priv->primary->offset) in mga_do_dma_wrap_start()
182 primary->space = primary->size; in mga_do_dma_wrap_start()
184 primary->space = head - dev_priv->primary->offset; in mga_do_dma_wrap_start()
186 DRM_DEBUG(" head = 0x%06lx\n", (unsigned long)(head - dev_priv->primary->offset)); in mga_do_dma_wrap_start()
187 DRM_DEBUG(" tail = 0x%06x\n", primary->tail); in mga_do_dma_wrap_start()
188 DRM_DEBUG(" wrap = %d\n", primary->last_wrap); in mga_do_dma_wrap_start()
189 DRM_DEBUG(" space = 0x%06x\n", primary->space); in mga_do_dma_wrap_start()
194 set_bit(0, &primary->wrapped); in mga_do_dma_wrap_start()
200 drm_mga_primary_buffer_t *primary = &dev_priv->prim; in mga_do_dma_wrap_end() local
202 u32 head = dev_priv->primary->offset; in mga_do_dma_wrap_end()
211 clear_bit(0, &primary->wrapped); in mga_do_dma_wrap_end()
232 dev_priv->primary->offset)); in mga_freelist_print()
238 (unsigned long)(entry->age.head - dev_priv->primary->offset)); in mga_freelist_print()
336 (unsigned long)(tail->age.head - dev_priv->primary->offset) : 0, in mga_freelist_get()
339 (unsigned long)(head - dev_priv->primary->offset), wrap); in mga_freelist_get()
363 dev_priv->primary->offset), in mga_freelist_put()
540 _DRM_AGP, _DRM_READ_ONLY, &dev_priv->primary); in mga_do_agp_dma_bootstrap()
589 drm_legacy_ioremap(dev_priv->primary, dev); in mga_do_agp_dma_bootstrap()
593 !dev_priv->primary->handle || !dev->agp_buffer_map->handle) { in mga_do_agp_dma_bootstrap()
595 dev_priv->warp->handle, dev_priv->primary->handle, in mga_do_agp_dma_bootstrap()
668 _DRM_READ_ONLY, &dev_priv->primary); in mga_do_pci_dma_bootstrap()
678 if (dev_priv->primary->size != dma_bs->primary_size) { in mga_do_pci_dma_bootstrap()
681 (unsigned)dev_priv->primary->size); in mga_do_pci_dma_bootstrap()
682 dma_bs->primary_size = dev_priv->primary->size; in mga_do_pci_dma_bootstrap()
858 dev_priv->primary = drm_legacy_findmap(dev, init->primary_offset); in mga_do_init_dma()
859 if (!dev_priv->primary) { in mga_do_init_dma()
872 drm_legacy_ioremap(dev_priv->primary, dev); in mga_do_init_dma()
881 !dev_priv->primary->handle || in mga_do_init_dma()
907 MGA_WRITE(MGA_PRIMADDRESS, dev_priv->primary->offset | MGA_DMA_GENERAL); in mga_do_init_dma()
913 dev_priv->prim.start = (u8 *) dev_priv->primary->handle; in mga_do_init_dma()
914 dev_priv->prim.end = ((u8 *) dev_priv->primary->handle in mga_do_init_dma()
915 + dev_priv->primary->size); in mga_do_init_dma()
916 dev_priv->prim.size = dev_priv->primary->size; in mga_do_init_dma()
927 dev_priv->prim.status[0] = dev_priv->primary->offset; in mga_do_init_dma()
961 if ((dev_priv->primary != NULL) in mga_do_cleanup_dma()
962 && (dev_priv->primary->type != _DRM_CONSISTENT)) in mga_do_cleanup_dma()
963 drm_legacy_ioremapfree(dev_priv->primary, dev); in mga_do_cleanup_dma()
991 dev_priv->primary = NULL; in mga_do_cleanup_dma()