summaryrefslogtreecommitdiff
path: root/libdrm
AgeCommit message (Expand)Author
2005-02-01momentary revert. libdrm build may be broken now, but no one uses it yet...Adam Jackson
2005-01-30Final pass of libdrm.so work:Adam Jackson
2005-01-22Add drm.h to the install target.Adam Jackson
2005-01-17Add xf86drm.h to the install target.Adam Jackson
2005-01-16Shared libdrm work:Adam Jackson
2005-01-16The patch makes drmAddBufs/drmMapBufs can handle buffers in video memoryDave Airlie
2005-01-01Added a new DRM map type _DRM_CONSISTENT for consistent PCI memory. It usesFelix Kuehling
2004-11-07respect cc and cflagsDave Airlie
2004-09-17Makefile and missing file to build libxf86drm.aJon Smirl
2004-08-11Bug #979: Don't include <sys/sysmacros.h> on linux, it occasionally emitsAdam Jackson
2004-07-31Patch picked up from Redhat xorg release:Dave Airlie
2004-07-07Make drm/libdrm/xf86drm.c matchJon Smirl
2004-07-07Add xf86drm.h back to drm/libdrm until it's true home can be found.Jon Smirl
2003-11-04build fixMichel Daenzer
2003-10-23- Introduce a new ioctl, DRM_IOCTL_SET_VERSION. This ioctl allows theEric Anholt
2003-09-24post merge fixAlan Hourihane
2003-09-13compatibility layer still uses agp (not gart)Alan Hourihane
2003-09-12linux drm fixesAlan Hourihane
2003-08-29Update to reflect renaming of SIS ioctls.Eric Anholt
2003-08-26Rename agp to gart for radeonMichel Daenzer
2003-05-27Merged DRM documentation.Jose Fonseca
2003-04-23deal correctly with read() from the DRM failingMichel Daenzer
2003-03-25linux merge for drmAlan Hourihane
2003-03-25XFree86 4.3.0 mergeAlan Hourihane
2003-02-21Merge from bsd-4-0-0-branch.Eric Anholt
2003-02-02don't inflate relative vblank sequence numbers on repeated calls (e.g. whenMichel Daenzer
2002-11-25added missing return fd (Alexander Stohr)Brian Paul
2002-10-22final part of XFree86 4.2.99.2 mergeAlan Hourihane
2002-09-25common ioctl to wait for vertical blank IRQsMichel Daenzer
2002-08-30Remove compat functions for FreeBSD for drivers which weren't available inEric Anholt
2002-08-08Try to open the /dev/dri/cardX device once, then only if it fails check theEric Anholt
2002-07-05merged bsd-3-0-0-branchAlan Hourihane
2002-04-09Merged drmcommand-0-0-1Jens Owen
2002-01-27First pass merge of XFree86 4.2.0 import.David Dawes
2001-08-25- Remove the rest of the unneeded client-side libraries.David Dawes
2001-08-22First part of XFree86 4.1.99.1 merge.David Dawes
2001-07-30Merge the multihead-1-0-0 branch into the trunk, with the exception of theDavid Dawes
2001-07-20Remove module name hacks because we aren't going to implement this anymoreJeff Hartmann
2001-07-18Add module version name at a lower layer of the code, allows things to beJeff Hartmann
2001-06-14First pass of 4.1.0 merge.David Dawes
2001-05-14finish struct stat type cleanup Fix a build dependencies for the tdfx drmDavid Dawes
2001-05-04add some commented enclosures around the BUS_BASE calls for AlphaAlan Hourihane
2001-05-01Initial merge for XFree86 4.0.99.3 importDavid Dawes
2001-04-30- PCIGART patches for Alpha from CompaqKevin E Martin
2001-04-18put back BUS_BASEDavid Dawes
2001-04-09First pass of XFree86 4.0.99.2 merge.David Dawes
2001-04-05Merged ati-pcigart-1-0-0Kevin E Martin
2001-03-30- Move xf86ConfigDRI declaration from xf86Priv.h to xf86.h.David Dawes
2001-03-14Merged sarea-1-0-0Kevin E Martin
2001-03-13Rest of MGA dualhead patch.Gareth Hughes
irq's aren't * tied to dma at all, this is just a hangover from dri prehistory. */ irqreturn_t radeon_driver_irq_handler(DRM_IRQ_ARGS) { drm_device_t *dev = (drm_device_t *) arg; drm_radeon_private_t *dev_priv = (drm_radeon_private_t *) dev->dev_private; u32 stat; /* Only consider the bits we're interested in - others could be used * outside the DRM */ stat = radeon_acknowledge_irqs(dev_priv, (RADEON_SW_INT_TEST_ACK | RADEON_CRTC_VBLANK_STAT)); if (!stat) return IRQ_NONE; /* SW interrupt */ if (stat & RADEON_SW_INT_TEST) { DRM_WAKEUP(&dev_priv->swi_queue); } /* VBLANK interrupt */ if (stat & RADEON_CRTC_VBLANK_STAT) { atomic_inc(&dev->vbl_received); DRM_WAKEUP(&dev->vbl_queue); drm_vbl_send_signals(dev); } return IRQ_HANDLED; } static int radeon_emit_irq(drm_device_t * dev) { drm_radeon_private_t *dev_priv = dev->dev_private; unsigned int ret; RING_LOCALS; atomic_inc(&dev_priv->swi_emitted); ret = atomic_read(&dev_priv->swi_emitted); BEGIN_RING(4); OUT_RING_REG(RADEON_LAST_SWI_REG, ret); OUT_RING_REG(RADEON_GEN_INT_STATUS, RADEON_SW_INT_FIRE); ADVANCE_RING(); COMMIT_RING(); return ret; } static int radeon_wait_irq(drm_device_t * dev, int swi_nr) { drm_radeon_private_t *dev_priv = (drm_radeon_private_t *) dev->dev_private; int ret = 0; if (RADEON_READ(RADEON_LAST_SWI_REG) >= swi_nr) return 0; dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE; DRM_WAIT_ON(ret, dev_priv->swi_queue, 3 * DRM_HZ, RADEON_READ(RADEON_LAST_SWI_REG) >= swi_nr); return ret; } int radeon_driver_vblank_wait(drm_device_t * dev, unsigned int *sequence) { drm_radeon_private_t *dev_priv = (drm_radeon_private_t *) dev->dev_private; unsigned int cur_vblank; int ret = 0; if (!dev_priv) { DRM_ERROR("%s called with no initialization\n", __FUNCTION__); return DRM_ERR(EINVAL); } radeon_acknowledge_irqs(dev_priv, RADEON_CRTC_VBLANK_STAT); dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE; /* Assume that the user has missed the current sequence number * by about a day rather than she wants to wait for years * using vertical blanks... */ DRM_WAIT_ON(ret, dev->vbl_queue, 3 * DRM_HZ, (((cur_vblank = atomic_read(&dev->vbl_received)) - *sequence) <= (1 << 23))); *sequence = cur_vblank; return ret; } /* Needs the lock as it touches the ring. */ int radeon_irq_emit(DRM_IOCTL_ARGS) { DRM_DEVICE; drm_radeon_private_t *dev_priv = dev->dev_private; drm_radeon_irq_emit_t emit; int result; LOCK_TEST_WITH_RETURN(dev, filp); if (!dev_priv) { DRM_ERROR("%s called with no initialization\n", __FUNCTION__); return DRM_ERR(EINVAL); } DRM_COPY_FROM_USER_IOCTL(emit, (drm_radeon_irq_emit_t __user *) data, sizeof(emit)); result = radeon_emit_irq(dev); if (DRM_COPY_TO_USER(emit.irq_seq, &result, sizeof(int))) { DRM_ERROR("copy_to_user\n"); return DRM_ERR(EFAULT); } return 0; } /* Doesn't need the hardware lock. */ int radeon_irq_wait(DRM_IOCTL_ARGS) { DRM_DEVICE; drm_radeon_private_t *dev_priv = dev->dev_private; drm_radeon_irq_wait_t irqwait; if (!dev_priv) { DRM_ERROR("%s called with no initialization\n", __FUNCTION__); return DRM_ERR(EINVAL); } DRM_COPY_FROM_USER_IOCTL(irqwait, (drm_radeon_irq_wait_t __user *) data, sizeof(irqwait)); return radeon_wait_irq(dev, irqwait.irq_seq); } /* drm_dma.h hooks */ void radeon_driver_irq_preinstall(drm_device_t * dev) { drm_radeon_private_t *dev_priv = (drm_radeon_private_t *) dev->dev_private; /* Disable *all* interrupts */ RADEON_WRITE(RADEON_GEN_INT_CNTL, 0); /* Clear bits if they're already high */ radeon_acknowledge_irqs(dev_priv, (RADEON_SW_INT_TEST_ACK | RADEON_CRTC_VBLANK_STAT)); } void radeon_driver_irq_postinstall(drm_device_t * dev) { drm_radeon_private_t *dev_priv = (drm_radeon_private_t *) dev->dev_private; atomic_set(&dev_priv->swi_emitted, 0); DRM_INIT_WAITQUEUE(&dev_priv->swi_queue); /* Turn on SW and VBL ints */ RADEON_WRITE(RADEON_GEN_INT_CNTL, RADEON_CRTC_VBLANK_MASK | RADEON_SW_INT_ENABLE); } void radeon_driver_irq_uninstall(drm_device_t * dev) { drm_radeon_private_t *dev_priv = (drm_radeon_private_t *) dev->dev_private; if (!dev_priv) return; /* Disable *all* interrupts */ RADEON_WRITE(RADEON_GEN_INT_CNTL, 0); }