summaryrefslogtreecommitdiff
path: root/bsd
AgeCommit message (Expand)Author
2004-08-24This patch adds three new ioctl's to the VIA Unichrome/Pro DRM driver:Erdi Chen
2004-08-17Merged drmfntbl-0-0-1Dave Airlie
2004-08-14Remove unused pcigart/sg header stuff from i915 driver.Eric Anholt
2004-08-14Add a "dev" argument to DRIVER_CTX_[CD]TOR. This will be used in anEric Anholt
2004-08-14Hopefully proper fix for corrupted driver name in memcontrol list.Eric Anholt
2004-08-13Enable MTRR usage on AMD64, and use DELAY() instead of rolling our ownEric Anholt
2004-08-03bring over fix from i865-agp branch, it now probes the driver, X hangsDave Airlie
2004-07-29add read/write 16Dave Airlie
2004-07-29change to agp not pci ... still not workingDave Airlie
2004-07-29initial port of i915 to BSD, not finished doesn't work.. no idea why...Dave Airlie
2004-07-06Fix module loading on alpha by not referencing MTRR symbols onEric Anholt
2004-07-06MFC as of 20040705: dev_t -> struct cdev * change.Eric Anholt
2004-05-11Merge from FreeBSD-current. Mostly 64-bit cleanliness fixes, but a fewEric Anholt
2004-05-09Add mach64 DRM module for BSD (untested, but compiles).Eric Anholt
2004-05-09Add .cvsignore files.Eric Anholt
2004-05-09Warning fixes.Eric Anholt
2004-05-09- Link in shared files as necessary and clean them up.Eric Anholt
2004-05-09Catch up with sis's DRM tag change.Eric Anholt
2004-05-09Remove after repocopy to Makefile, now that we don't have to worry aboutEric Anholt
2004-05-09drm_hw_lock_t is now defined in drm.h, remove from here.Eric Anholt
2004-05-09Commit sysfs and drm PCI changes for 2.6 kernelDave Airlie
2004-04-21centralise pci ids into one place and use scripts to generate files forDave Airlie
2004-04-09remove ImakefileAlan Hourihane
2004-01-06Fix some misuse of NULL where 0 is intended.Eric Anholt
2003-12-16Don't ioremap the framebuffer area. The ioremapped area wasn't used byEric Anholt
2003-11-12Fix a locking nit, and add asserts in some things that should be calledEric Anholt
2003-11-06Return EBUSY when attempting to addmap a DRM_SHM area with a lock in it ifEric Anholt
2003-11-06Remove unused variable.Eric Anholt
2003-11-05- Tie the DRM to a specific device: setunique no longer succeeds when givenEric Anholt
2003-11-05Args for the BSD DRM_PUT_USER_UNCHECKED were swapped.Eric Anholt
2003-11-05Repo-copy linux/drm/kernel/drm.h to shared/drm/kernel/drm.h and use it onEric Anholt
2003-11-05Remove buf_alloc which is unused since the locking commit.Eric Anholt
2003-11-04Memory layout transition:Michel Daenzer
2003-10-27Add a DRM_PUT_USER_UNCHECKED, which will be used by an upcoming radeonEric Anholt
2003-10-24Don't try to use dev->dma_lock unless dma is initialized (dev->dma != NULL)Eric Anholt
2003-10-24Move the REALLY_HAVE_AGP endif above the mtrr functions. Broke tdfx module.Eric Anholt
2003-10-23- Introduce a new ioctl, DRM_IOCTL_SET_VERSION. This ioctl allows theEric Anholt
2003-10-22- Add DRM_GET_PRIV_WITH_RETURN macro. This can be used in shared code toEric Anholt
2003-10-22Fix warning about static DRM(bufs_info) defined but not used in theEric Anholt
2003-10-20Fix the possibility of sleeping with locks held in sysctls by copying theEric Anholt
2003-10-20Clean up BSD MTRR handling. The NetBSD code is untested, but it's my bestEric Anholt
2003-10-19- SMPng lock the DRM. This is only partial -- there are a few code pathsEric Anholt
2003-10-19Clean up extra zeroing of dev->dma, and use calloc to take advantage ofEric Anholt
2003-10-17- Move IRQ functions from drm_dma.h to new drm_irq.h and disentangle themEric Anholt
2003-10-17- Converted Linux drivers to initialize DRM instances based on PCI IDs, notEric Anholt
2003-10-03Some code cleanups done while working on locking. Reduces always-trueEric Anholt
2003-10-03Stylistic preparation for SMPng locking work: DRM_LOCK/DRM_UNLOCK have sideEric Anholt
2003-10-02Add an MIT-style copyright, assigned to myself, to these files. I thinkEric Anholt
2003-10-02Axe more old gamma DMA infrastructure.Eric Anholt
2003-10-02Mostly whitespace cleanups and style(9) fixes focused on "if(" -> "if ("Eric Anholt
class="hl com"> */ /* * Authors: * Jerome Glisse <glisse@freedesktop.org> */ #include "drm_pciids.h" #include "radeon_ms.h" #include "amd_legacy_fence.h" static uint32_t radeon_ms_mem_prios[] = { DRM_BO_MEM_VRAM, DRM_BO_MEM_TT, DRM_BO_MEM_LOCAL, }; static uint32_t radeon_ms_busy_prios[] = { DRM_BO_MEM_TT, DRM_BO_MEM_VRAM, DRM_BO_MEM_LOCAL, }; struct drm_bo_driver radeon_ms_bo_driver = { .mem_type_prio = radeon_ms_mem_prios, .mem_busy_prio = radeon_ms_busy_prios, .num_mem_type_prio = sizeof(radeon_ms_mem_prios)/sizeof(uint32_t), .num_mem_busy_prio = sizeof(radeon_ms_busy_prios)/sizeof(uint32_t), .create_ttm_backend_entry = radeon_ms_create_ttm_backend, .fence_type = r3xx_fence_types, .invalidate_caches = radeon_ms_invalidate_caches, .init_mem_type = radeon_ms_init_mem_type, .evict_flags = radeon_ms_evict_flags, .move = radeon_ms_bo_move, .ttm_cache_flush = radeon_ms_ttm_flush, }; struct drm_ioctl_desc radeon_ms_ioctls[] = { DRM_IOCTL_DEF(DRM_AMD_CMD, amd_ioctl_cmd, DRM_AUTH), DRM_IOCTL_DEF(DRM_AMD_RESETCP, radeon_ms_resetcp, DRM_AUTH), }; int radeon_ms_num_ioctls = DRM_ARRAY_SIZE(radeon_ms_ioctls); int radeon_ms_driver_dma_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_device_dma *dma = dev->dma; struct drm_dma *d = data; LOCK_TEST_WITH_RETURN(dev, file_priv); /* Please don't send us buffers. */ if (d->send_count != 0) { DRM_ERROR("Process %d trying to send %d buffers via drmDMA\n", DRM_CURRENTPID, d->send_count); return -EINVAL; } /* Don't ask us buffer neither :) */ DRM_ERROR("Process %d trying to get %d buffers (of %d max)\n", DRM_CURRENTPID, d->request_count, dma->buf_count); return -EINVAL; } void radeon_ms_driver_lastclose(struct drm_device * dev) { } int radeon_ms_driver_load(struct drm_device *dev, unsigned long flags) { struct drm_radeon_private *dev_priv; int ret = 0; DRM_INFO("[radeon_ms] loading\n"); /* allocate and clear device private structure */ dev_priv = drm_alloc(sizeof(struct drm_radeon_private), DRM_MEM_DRIVER); if (dev_priv == NULL) return -ENOMEM; memset(dev_priv, 0, sizeof(struct drm_radeon_private)); dev->dev_private = (void *)dev_priv; /* initialize modesetting structure (must be done here) */ drm_mode_config_init(dev); /* flags correspond to chipset family */ dev_priv->usec_timeout = 100; dev_priv->family = flags & 0xffffU; dev_priv->bus_type = flags & 0xff0000U; /* initialize family functions */ ret = radeon_ms_family_init(dev); if (ret != 0) { radeon_ms_driver_unload(dev); return ret; } dev_priv->fence = drm_alloc(sizeof(struct legacy_fence), DRM_MEM_DRIVER); if (dev_priv->fence == NULL) { radeon_ms_driver_unload(dev); return -ENOMEM; } memset(dev_priv->fence, 0, sizeof(struct legacy_fence)); /* we don't want userspace to be able to map this so don't use * drm_addmap */ dev_priv->mmio.offset = drm_get_resource_start(dev, 2); dev_priv->mmio.size = drm_get_resource_len(dev, 2); dev_priv->mmio.type = _DRM_REGISTERS; dev_priv->mmio.flags = _DRM_RESTRICTED; drm_core_ioremap(&dev_priv->mmio, dev); /* map vram FIXME: IGP likely don't have any of this */ dev_priv->vram.offset = drm_get_resource_start(dev, 0); dev_priv->vram.size = drm_get_resource_len(dev, 0); dev_priv->vram.type = _DRM_FRAME_BUFFER; dev_priv->vram.flags = _DRM_RESTRICTED; drm_core_ioremap(&dev_priv->vram, dev); /* save radeon initial state which will be restored upon module * exit */ radeon_ms_state_save(dev, &dev_priv->load_state); dev_priv->restore_state = 1; memcpy(&dev_priv->driver_state, &dev_priv->load_state, sizeof(struct radeon_state)); /* initialize irq */ ret = radeon_ms_irq_init(dev); if (ret != 0) {