Lines Matching defs:dev
45 static int radeon_do_cleanup_cp(drm_device_t *dev);
825 static int RADEON_READ_PLL(drm_device_t *dev, int addr)
827 drm_radeon_private_t *dev_priv = dev->dev_private;
1069 static int radeon_do_engine_reset(drm_device_t *dev)
1071 drm_radeon_private_t *dev_priv = dev->dev_private;
1078 mclk_cntl = RADEON_READ_PLL(dev, RADEON_MCLK_CNTL);
1120 radeon_freelist_reset(dev);
1126 radeon_cp_init_ring_buffer(drm_device_t *dev, drm_radeon_private_t *dev_priv)
1145 RADEON_WRITE(RADEON_AGP_BASE, (unsigned int)dev->agp->base);
1152 dev->agp->base + dev_priv->gart_vm_start;
1156 (unsigned long)dev->sg->virtual +
1174 dev->agp->base + dev_priv->gart_vm_start);
1178 drm_sg_mem_t *entry = dev->sg;
1182 (unsigned long)dev->sg->virtual;
1361 static int radeon_do_init_cp(drm_device_t *dev, drm_radeon_init_t *init)
1363 drm_radeon_private_t *dev_priv = dev->dev_private;
1369 (void) radeon_do_cleanup_cp(dev);
1383 if ((!(dev_priv->flags & RADEON_IS_AGP)) && !dev->sg) {
1385 (void) radeon_do_cleanup_cp(dev);
1392 (void) radeon_do_cleanup_cp(dev);
1418 (void) radeon_do_cleanup_cp(dev);
1488 (void) radeon_do_cleanup_cp(dev);
1492 dev_priv->cp_ring = drm_core_findmap(dev, init->ring_offset);
1496 (void) radeon_do_cleanup_cp(dev);
1499 dev_priv->ring_rptr = drm_core_findmap(dev, init->ring_rptr_offset);
1503 (void) radeon_do_cleanup_cp(dev);
1506 dev->agp_buffer_token = init->buffers_offset;
1507 dev->agp_buffer_map = drm_core_findmap(dev, init->buffers_offset);
1508 if (!dev->agp_buffer_map) {
1511 (void) radeon_do_cleanup_cp(dev);
1517 drm_core_findmap(dev, init->gart_textures_offset);
1521 (void) radeon_do_cleanup_cp(dev);
1532 drm_core_ioremap(dev_priv->cp_ring, dev);
1533 drm_core_ioremap(dev_priv->ring_rptr, dev);
1534 drm_core_ioremap(dev->agp_buffer_map, dev);
1537 !dev->agp_buffer_map->handle) {
1543 dev->agp_buffer_map->handle);
1544 (void) radeon_do_cleanup_cp(dev);
1554 dev->agp_buffer_map->handle =
1555 (void *)(intptr_t)dev->agp_buffer_map->offset;
1561 DRM_DEBUG("dev->agp_buffer_map->handle %p\n",
1562 dev->agp_buffer_map->handle);
1595 base = dev->agp->base;
1602 "won't fit\n", dev->agp->base);
1628 dev_priv->gart_buffers_offset = (dev->agp_buffer_map->offset -
1629 dev->agp->base + dev_priv->gart_vm_start);
1632 dev_priv->gart_buffers_offset = (dev->agp_buffer_map->offset -
1633 (unsigned long)dev->sg->virtual + dev_priv->gart_vm_start);
1666 drm_core_ioremap(&dev_priv->gart_info.mapping, dev);
1685 (void) radeon_do_cleanup_cp(dev);
1690 if (!drm_ati_pcigart_init(dev, &dev_priv->gart_info)) {
1692 (void) radeon_do_cleanup_cp(dev);
1701 radeon_cp_init_ring_buffer(dev, dev_priv);
1705 (void) radeon_do_engine_reset(dev);
1711 static int radeon_do_cleanup_cp(drm_device_t *dev)
1713 drm_radeon_private_t *dev_priv = dev->dev_private;
1720 if (dev->irq_enabled)
1721 (void) drm_irq_uninstall(dev);
1726 drm_core_ioremapfree(dev_priv->cp_ring, dev);
1730 drm_core_ioremapfree(dev_priv->ring_rptr, dev);
1733 if (dev->agp_buffer_map != NULL) {
1734 drm_core_ioremapfree(dev->agp_buffer_map, dev);
1735 dev->agp_buffer_map = NULL;
1744 if (!drm_ati_pcigart_cleanup(dev, &dev_priv->gart_info))
1750 drm_core_ioremapfree(&dev_priv->gart_info.mapping, dev);
1768 static int radeon_do_resume_cp(drm_device_t *dev)
1770 drm_radeon_private_t *dev_priv = dev->dev_private;
1791 radeon_cp_init_ring_buffer(dev, dev_priv);
1793 (void) radeon_do_engine_reset(dev);
1808 LOCK_TEST_WITH_RETURN(dev, fpriv);
1849 return (radeon_do_init_cp(dev, &init));
1851 return (radeon_do_cleanup_cp(dev));
1862 drm_radeon_private_t *dev_priv = dev->dev_private;
1864 LOCK_TEST_WITH_RETURN(dev, fpriv);
1889 drm_radeon_private_t *dev_priv = dev->dev_private;
1893 LOCK_TEST_WITH_RETURN(dev, fpriv);
1926 (void) radeon_do_engine_reset(dev);
1932 radeon_do_release(drm_device_t *dev)
1934 drm_radeon_private_t *dev_priv = dev->dev_private;
1946 msleep(&ret, &dev->dev_lock, PZERO,
1958 (void) radeon_do_engine_reset(dev);
1981 (void) radeon_do_cleanup_cp(dev);
1991 drm_radeon_private_t *dev_priv = dev->dev_private;
1993 LOCK_TEST_WITH_RETURN(dev, fpriv);
2013 drm_radeon_private_t *dev_priv = dev->dev_private;
2015 LOCK_TEST_WITH_RETURN(dev, fpriv);
2027 return (radeon_do_resume_cp(dev));
2036 LOCK_TEST_WITH_RETURN(dev, fpriv);
2038 return (radeon_do_engine_reset(dev));
2076 radeon_freelist_get(drm_device_t *dev)
2078 drm_device_dma_t *dma = dev->dma;
2079 drm_radeon_private_t *dev_priv = dev->dev_private;
2117 radeon_freelist_get(drm_device_t *dev)
2119 drm_device_dma_t *dma = dev->dma;
2120 drm_radeon_private_t *dev_priv = dev->dev_private;
2152 radeon_freelist_reset(drm_device_t *dev)
2154 drm_device_dma_t *dma = dev->dma;
2155 drm_radeon_private_t *dev_priv = dev->dev_private;
2204 radeon_cp_get_buffers(drm_file_t *filp, drm_device_t *dev, drm_dma_t *d)
2210 buf = radeon_freelist_get(dev);
2233 drm_device_dma_t *dma = dev->dma;
2237 LOCK_TEST_WITH_RETURN(dev, fpriv);
2277 ret = radeon_cp_get_buffers(fpriv, dev, &d);
2305 radeon_driver_load(struct drm_device *dev, unsigned long flags)
2315 dev->dev_private = (void *)dev_priv;
2333 if (drm_device_is_agp(dev))
2335 else if (drm_device_is_pcie(dev))
2348 radeon_driver_firstopen(struct drm_device *dev)
2352 drm_radeon_private_t *dev_priv = dev->dev_private;
2356 ret = drm_addmap(dev, (uint_t)drm_get_resource_start(dev, 2),
2357 (uint_t)drm_get_resource_len(dev, 2), _DRM_REGISTERS,
2363 (uint_t)drm_get_resource_start(dev, 2),
2364 (uint_t)drm_get_resource_len(dev, 2));
2368 ret = drm_addmap(dev, (uint_t)drm_get_resource_start(dev, 0),
2369 (uint_t)drm_get_resource_len(dev, 0), _DRM_FRAME_BUFFER,
2378 radeon_driver_unload(struct drm_device *dev)
2380 drm_radeon_private_t *dev_priv = dev->dev_private;
2385 dev->dev_private = NULL;