2005-01-06 01:43:34 +00:00
|
|
|
|
/* radeon_irq.c -- IRQ handling for radeon -*- linux-c -*- */
|
|
|
|
|
/*-
|
2003-03-09 02:08:30 +00:00
|
|
|
|
* Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
*
|
2003-03-09 02:08:30 +00:00
|
|
|
|
* The Weather Channel (TM) funded Tungsten Graphics to develop the
|
|
|
|
|
* initial release of the Radeon 8500 driver under the XFree86 license.
|
|
|
|
|
* This notice must be preserved.
|
|
|
|
|
*
|
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
|
*
|
|
|
|
|
* The above copyright notice and this permission notice (including the next
|
|
|
|
|
* paragraph) shall be included in all copies or substantial portions of the
|
|
|
|
|
* Software.
|
|
|
|
|
*
|
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
|
* PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
|
|
|
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
|
|
|
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
|
* DEALINGS IN THE SOFTWARE.
|
|
|
|
|
*
|
|
|
|
|
* Authors:
|
|
|
|
|
* Keith Whitwell <keith@tungstengraphics.com>
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
* Michel D<EFBFBD>zer <michel@daenzer.net>
|
2003-03-09 02:08:30 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2005-11-28 23:13:57 +00:00
|
|
|
|
#include <sys/cdefs.h>
|
|
|
|
|
__FBSDID("$FreeBSD$");
|
|
|
|
|
|
2003-03-09 02:08:30 +00:00
|
|
|
|
#include "dev/drm/drmP.h"
|
|
|
|
|
#include "dev/drm/drm.h"
|
|
|
|
|
#include "dev/drm/radeon_drm.h"
|
|
|
|
|
#include "dev/drm/radeon_drv.h"
|
|
|
|
|
|
2008-08-23 20:59:12 +00:00
|
|
|
|
void radeon_irq_set_state(struct drm_device *dev, u32 mask, int state)
|
2005-11-28 23:13:57 +00:00
|
|
|
|
{
|
2008-08-23 20:59:12 +00:00
|
|
|
|
drm_radeon_private_t *dev_priv = dev->dev_private;
|
|
|
|
|
|
|
|
|
|
if (state)
|
|
|
|
|
dev_priv->irq_enable_reg |= mask;
|
|
|
|
|
else
|
|
|
|
|
dev_priv->irq_enable_reg &= ~mask;
|
|
|
|
|
|
2008-12-23 22:53:57 +00:00
|
|
|
|
if (dev->irq_enabled)
|
|
|
|
|
RADEON_WRITE(RADEON_GEN_INT_CNTL, dev_priv->irq_enable_reg);
|
2008-08-23 20:59:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void r500_vbl_irq_set_state(struct drm_device *dev, u32 mask, int state)
|
|
|
|
|
{
|
|
|
|
|
drm_radeon_private_t *dev_priv = dev->dev_private;
|
|
|
|
|
|
|
|
|
|
if (state)
|
|
|
|
|
dev_priv->r500_disp_irq_reg |= mask;
|
|
|
|
|
else
|
|
|
|
|
dev_priv->r500_disp_irq_reg &= ~mask;
|
|
|
|
|
|
2008-12-23 22:53:57 +00:00
|
|
|
|
if (dev->irq_enabled)
|
|
|
|
|
RADEON_WRITE(R500_DxMODE_INT_MASK, dev_priv->r500_disp_irq_reg);
|
2008-08-23 20:59:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int radeon_enable_vblank(struct drm_device *dev, int crtc)
|
|
|
|
|
{
|
|
|
|
|
drm_radeon_private_t *dev_priv = dev->dev_private;
|
|
|
|
|
|
2009-03-07 21:36:57 +00:00
|
|
|
|
if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS600) {
|
2008-08-23 20:59:12 +00:00
|
|
|
|
switch (crtc) {
|
|
|
|
|
case 0:
|
|
|
|
|
r500_vbl_irq_set_state(dev, R500_D1MODE_INT_MASK, 1);
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
r500_vbl_irq_set_state(dev, R500_D2MODE_INT_MASK, 1);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
DRM_ERROR("tried to enable vblank on non-existent crtc %d\n",
|
|
|
|
|
crtc);
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
switch (crtc) {
|
|
|
|
|
case 0:
|
|
|
|
|
radeon_irq_set_state(dev, RADEON_CRTC_VBLANK_MASK, 1);
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
radeon_irq_set_state(dev, RADEON_CRTC2_VBLANK_MASK, 1);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
DRM_ERROR("tried to enable vblank on non-existent crtc %d\n",
|
|
|
|
|
crtc);
|
|
|
|
|
return EINVAL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void radeon_disable_vblank(struct drm_device *dev, int crtc)
|
|
|
|
|
{
|
|
|
|
|
drm_radeon_private_t *dev_priv = dev->dev_private;
|
|
|
|
|
|
2009-03-07 21:36:57 +00:00
|
|
|
|
if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS600) {
|
2008-08-23 20:59:12 +00:00
|
|
|
|
switch (crtc) {
|
|
|
|
|
case 0:
|
|
|
|
|
r500_vbl_irq_set_state(dev, R500_D1MODE_INT_MASK, 0);
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
r500_vbl_irq_set_state(dev, R500_D2MODE_INT_MASK, 0);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
DRM_ERROR("tried to enable vblank on non-existent crtc %d\n",
|
|
|
|
|
crtc);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
switch (crtc) {
|
|
|
|
|
case 0:
|
|
|
|
|
radeon_irq_set_state(dev, RADEON_CRTC_VBLANK_MASK, 0);
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
radeon_irq_set_state(dev, RADEON_CRTC2_VBLANK_MASK, 0);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
DRM_ERROR("tried to enable vblank on non-existent crtc %d\n",
|
|
|
|
|
crtc);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static __inline__ u32 radeon_acknowledge_irqs(drm_radeon_private_t * dev_priv, u32 *r500_disp_int)
|
|
|
|
|
{
|
|
|
|
|
u32 irqs = RADEON_READ(RADEON_GEN_INT_STATUS);
|
|
|
|
|
u32 irq_mask = RADEON_SW_INT_TEST;
|
|
|
|
|
|
|
|
|
|
*r500_disp_int = 0;
|
2009-03-07 21:36:57 +00:00
|
|
|
|
if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS600) {
|
2008-08-23 20:59:12 +00:00
|
|
|
|
/* vbl interrupts in a different place */
|
|
|
|
|
|
|
|
|
|
if (irqs & R500_DISPLAY_INT_STATUS) {
|
|
|
|
|
/* if a display interrupt */
|
|
|
|
|
u32 disp_irq;
|
|
|
|
|
|
|
|
|
|
disp_irq = RADEON_READ(R500_DISP_INTERRUPT_STATUS);
|
|
|
|
|
|
|
|
|
|
*r500_disp_int = disp_irq;
|
|
|
|
|
if (disp_irq & R500_D1_VBLANK_INTERRUPT) {
|
|
|
|
|
RADEON_WRITE(R500_D1MODE_VBLANK_STATUS, R500_VBLANK_ACK);
|
|
|
|
|
}
|
|
|
|
|
if (disp_irq & R500_D2_VBLANK_INTERRUPT) {
|
|
|
|
|
RADEON_WRITE(R500_D2MODE_VBLANK_STATUS, R500_VBLANK_ACK);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
irq_mask |= R500_DISPLAY_INT_STATUS;
|
|
|
|
|
} else
|
|
|
|
|
irq_mask |= RADEON_CRTC_VBLANK_STAT | RADEON_CRTC2_VBLANK_STAT;
|
|
|
|
|
|
|
|
|
|
irqs &= irq_mask;
|
|
|
|
|
|
2005-11-28 23:13:57 +00:00
|
|
|
|
if (irqs)
|
|
|
|
|
RADEON_WRITE(RADEON_GEN_INT_STATUS, irqs);
|
2008-08-23 20:59:12 +00:00
|
|
|
|
|
2005-11-28 23:13:57 +00:00
|
|
|
|
return irqs;
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-09 02:08:30 +00:00
|
|
|
|
/* Interrupts - Used for device synchronization and flushing in the
|
|
|
|
|
* following circumstances:
|
|
|
|
|
*
|
|
|
|
|
* - Exclusive FB access with hw idle:
|
|
|
|
|
* - Wait for GUI Idle (?) interrupt, then do normal flush.
|
|
|
|
|
*
|
|
|
|
|
* - Frame throttling, NV_fence:
|
|
|
|
|
* - Drop marker irq's into command stream ahead of time.
|
|
|
|
|
* - Wait on irq's with lock *not held*
|
|
|
|
|
* - Check each for termination condition
|
|
|
|
|
*
|
|
|
|
|
* - Internally in cp_getbuffer, etc:
|
|
|
|
|
* - as above, but wait with lock held???
|
|
|
|
|
*
|
|
|
|
|
* NOTE: These functions are misleadingly named -- the irq's aren't
|
|
|
|
|
* tied to dma at all, this is just a hangover from dri prehistory.
|
|
|
|
|
*/
|
|
|
|
|
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
irqreturn_t radeon_driver_irq_handler(DRM_IRQ_ARGS)
|
2003-03-09 02:08:30 +00:00
|
|
|
|
{
|
2008-08-23 20:59:12 +00:00
|
|
|
|
struct drm_device *dev = (struct drm_device *) arg;
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
drm_radeon_private_t *dev_priv =
|
|
|
|
|
(drm_radeon_private_t *) dev->dev_private;
|
|
|
|
|
u32 stat;
|
2008-08-23 20:59:12 +00:00
|
|
|
|
u32 r500_disp_int;
|
2009-02-25 18:50:35 +00:00
|
|
|
|
u32 tmp;
|
2003-03-09 02:08:30 +00:00
|
|
|
|
|
2009-09-28 22:37:07 +00:00
|
|
|
|
if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600)
|
|
|
|
|
return IRQ_NONE;
|
|
|
|
|
|
2003-03-09 02:08:30 +00:00
|
|
|
|
/* Only consider the bits we're interested in - others could be used
|
|
|
|
|
* outside the DRM
|
|
|
|
|
*/
|
2008-08-23 20:59:12 +00:00
|
|
|
|
stat = radeon_acknowledge_irqs(dev_priv, &r500_disp_int);
|
2003-03-09 02:08:30 +00:00
|
|
|
|
if (!stat)
|
2003-08-19 02:57:31 +00:00
|
|
|
|
return IRQ_NONE;
|
2003-03-09 02:08:30 +00:00
|
|
|
|
|
2008-08-23 20:59:12 +00:00
|
|
|
|
stat &= dev_priv->irq_enable_reg;
|
|
|
|
|
|
2003-03-09 02:08:30 +00:00
|
|
|
|
/* SW interrupt */
|
2008-08-23 20:59:12 +00:00
|
|
|
|
if (stat & RADEON_SW_INT_TEST)
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
DRM_WAKEUP(&dev_priv->swi_queue);
|
2003-03-09 02:08:30 +00:00
|
|
|
|
|
|
|
|
|
/* VBLANK interrupt */
|
2009-03-07 21:36:57 +00:00
|
|
|
|
if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS600) {
|
2008-08-23 20:59:12 +00:00
|
|
|
|
if (r500_disp_int & R500_D1_VBLANK_INTERRUPT)
|
|
|
|
|
drm_handle_vblank(dev, 0);
|
|
|
|
|
if (r500_disp_int & R500_D2_VBLANK_INTERRUPT)
|
|
|
|
|
drm_handle_vblank(dev, 1);
|
|
|
|
|
} else {
|
|
|
|
|
if (stat & RADEON_CRTC_VBLANK_STAT)
|
|
|
|
|
drm_handle_vblank(dev, 0);
|
|
|
|
|
if (stat & RADEON_CRTC2_VBLANK_STAT)
|
|
|
|
|
drm_handle_vblank(dev, 1);
|
2003-03-09 02:08:30 +00:00
|
|
|
|
}
|
2009-02-25 18:50:35 +00:00
|
|
|
|
if (dev->msi_enabled) {
|
|
|
|
|
switch(dev_priv->flags & RADEON_FAMILY_MASK) {
|
|
|
|
|
case CHIP_RS400:
|
|
|
|
|
case CHIP_RS480:
|
|
|
|
|
tmp = RADEON_READ(RADEON_AIC_CNTL) &
|
|
|
|
|
~RS400_MSI_REARM;
|
|
|
|
|
RADEON_WRITE(RADEON_AIC_CNTL, tmp);
|
|
|
|
|
RADEON_WRITE(RADEON_AIC_CNTL,
|
|
|
|
|
tmp | RS400_MSI_REARM);
|
|
|
|
|
break;
|
2009-03-16 19:09:59 +00:00
|
|
|
|
case CHIP_RS600:
|
2009-02-25 18:50:35 +00:00
|
|
|
|
case CHIP_RS690:
|
|
|
|
|
case CHIP_RS740:
|
|
|
|
|
tmp = RADEON_READ(RADEON_BUS_CNTL) &
|
|
|
|
|
~RS600_MSI_REARM;
|
|
|
|
|
RADEON_WRITE(RADEON_BUS_CNTL, tmp);
|
|
|
|
|
RADEON_WRITE(RADEON_BUS_CNTL, tmp |
|
|
|
|
|
RS600_MSI_REARM);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
tmp = RADEON_READ(RADEON_MSI_REARM_EN) &
|
|
|
|
|
~RV370_MSI_REARM_EN;
|
|
|
|
|
RADEON_WRITE(RADEON_MSI_REARM_EN, tmp);
|
|
|
|
|
RADEON_WRITE(RADEON_MSI_REARM_EN,
|
|
|
|
|
tmp | RV370_MSI_REARM_EN);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2003-08-19 02:57:31 +00:00
|
|
|
|
return IRQ_HANDLED;
|
2003-03-09 02:08:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-08-23 20:59:12 +00:00
|
|
|
|
static int radeon_emit_irq(struct drm_device * dev)
|
2003-03-09 02:08:30 +00:00
|
|
|
|
{
|
|
|
|
|
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);
|
|
|
|
|
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
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();
|
2003-03-09 02:08:30 +00:00
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
2008-08-23 20:59:12 +00:00
|
|
|
|
static int radeon_wait_irq(struct drm_device * dev, int swi_nr)
|
2003-03-09 02:08:30 +00:00
|
|
|
|
{
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
drm_radeon_private_t *dev_priv =
|
|
|
|
|
(drm_radeon_private_t *) dev->dev_private;
|
2003-03-09 02:08:30 +00:00
|
|
|
|
int ret = 0;
|
|
|
|
|
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
if (RADEON_READ(RADEON_LAST_SWI_REG) >= swi_nr)
|
|
|
|
|
return 0;
|
2003-03-09 02:08:30 +00:00
|
|
|
|
|
|
|
|
|
dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE;
|
|
|
|
|
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
DRM_WAIT_ON(ret, dev_priv->swi_queue, 3 * DRM_HZ,
|
|
|
|
|
RADEON_READ(RADEON_LAST_SWI_REG) >= swi_nr);
|
2003-03-09 02:08:30 +00:00
|
|
|
|
|
2009-03-19 08:36:08 +00:00
|
|
|
|
if (ret == -ERESTART)
|
|
|
|
|
DRM_DEBUG("restarting syscall");
|
|
|
|
|
|
2003-03-09 02:08:30 +00:00
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
2008-08-23 20:59:12 +00:00
|
|
|
|
u32 radeon_get_vblank_counter(struct drm_device *dev, int crtc)
|
2003-03-09 02:08:30 +00:00
|
|
|
|
{
|
2008-08-23 20:59:12 +00:00
|
|
|
|
drm_radeon_private_t *dev_priv = dev->dev_private;
|
2003-03-09 02:08:30 +00:00
|
|
|
|
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
if (!dev_priv) {
|
2008-08-23 20:59:12 +00:00
|
|
|
|
DRM_ERROR("called with no initialization\n");
|
|
|
|
|
return -EINVAL;
|
2003-03-09 02:08:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-08-23 20:59:12 +00:00
|
|
|
|
if (crtc < 0 || crtc > 1) {
|
|
|
|
|
DRM_ERROR("Invalid crtc %d\n", crtc);
|
|
|
|
|
return -EINVAL;
|
|
|
|
|
}
|
2003-03-09 02:08:30 +00:00
|
|
|
|
|
2009-03-07 21:36:57 +00:00
|
|
|
|
if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS600) {
|
2008-08-23 20:59:12 +00:00
|
|
|
|
if (crtc == 0)
|
|
|
|
|
return RADEON_READ(R500_D1CRTC_FRAME_COUNT);
|
|
|
|
|
else
|
|
|
|
|
return RADEON_READ(R500_D2CRTC_FRAME_COUNT);
|
|
|
|
|
} else {
|
|
|
|
|
if (crtc == 0)
|
|
|
|
|
return RADEON_READ(RADEON_CRTC_CRNT_FRAME);
|
|
|
|
|
else
|
|
|
|
|
return RADEON_READ(RADEON_CRTC2_CRNT_FRAME);
|
|
|
|
|
}
|
2003-03-09 02:08:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Needs the lock as it touches the ring.
|
|
|
|
|
*/
|
2008-08-23 20:59:12 +00:00
|
|
|
|
int radeon_irq_emit(struct drm_device *dev, void *data, struct drm_file *file_priv)
|
2003-03-09 02:08:30 +00:00
|
|
|
|
{
|
|
|
|
|
drm_radeon_private_t *dev_priv = dev->dev_private;
|
2008-08-23 20:59:12 +00:00
|
|
|
|
drm_radeon_irq_emit_t *emit = data;
|
2003-03-09 02:08:30 +00:00
|
|
|
|
int result;
|
|
|
|
|
|
2009-09-28 22:37:07 +00:00
|
|
|
|
if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600)
|
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
2008-08-23 20:59:12 +00:00
|
|
|
|
LOCK_TEST_WITH_RETURN(dev, file_priv);
|
2003-03-09 02:08:30 +00:00
|
|
|
|
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
if (!dev_priv) {
|
2008-08-23 20:59:12 +00:00
|
|
|
|
DRM_ERROR("called with no initialization\n");
|
|
|
|
|
return -EINVAL;
|
2003-03-09 02:08:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
result = radeon_emit_irq(dev);
|
2003-03-09 02:08:30 +00:00
|
|
|
|
|
2008-08-23 20:59:12 +00:00
|
|
|
|
if (DRM_COPY_TO_USER(emit->irq_seq, &result, sizeof(int))) {
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
DRM_ERROR("copy_to_user\n");
|
2008-08-23 20:59:12 +00:00
|
|
|
|
return -EFAULT;
|
2003-03-09 02:08:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Doesn't need the hardware lock.
|
|
|
|
|
*/
|
2008-08-23 20:59:12 +00:00
|
|
|
|
int radeon_irq_wait(struct drm_device *dev, void *data, struct drm_file *file_priv)
|
2003-03-09 02:08:30 +00:00
|
|
|
|
{
|
|
|
|
|
drm_radeon_private_t *dev_priv = dev->dev_private;
|
2008-08-23 20:59:12 +00:00
|
|
|
|
drm_radeon_irq_wait_t *irqwait = data;
|
2003-03-09 02:08:30 +00:00
|
|
|
|
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
if (!dev_priv) {
|
2008-08-23 20:59:12 +00:00
|
|
|
|
DRM_ERROR("called with no initialization\n");
|
|
|
|
|
return -EINVAL;
|
2003-03-09 02:08:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-08-23 20:59:12 +00:00
|
|
|
|
return radeon_wait_irq(dev, irqwait->irq_seq);
|
2003-03-09 02:08:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* drm_dma.h hooks
|
|
|
|
|
*/
|
2008-08-23 20:59:12 +00:00
|
|
|
|
void radeon_driver_irq_preinstall(struct drm_device * dev)
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
{
|
2003-03-09 02:08:30 +00:00
|
|
|
|
drm_radeon_private_t *dev_priv =
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
(drm_radeon_private_t *) dev->dev_private;
|
2008-08-23 20:59:12 +00:00
|
|
|
|
u32 dummy;
|
2003-03-09 02:08:30 +00:00
|
|
|
|
|
2009-09-28 22:37:07 +00:00
|
|
|
|
if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600)
|
|
|
|
|
return;
|
|
|
|
|
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
/* Disable *all* interrupts */
|
2009-03-07 21:36:57 +00:00
|
|
|
|
if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS600)
|
2008-08-23 20:59:12 +00:00
|
|
|
|
RADEON_WRITE(R500_DxMODE_INT_MASK, 0);
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
RADEON_WRITE(RADEON_GEN_INT_CNTL, 0);
|
2003-03-09 02:08:30 +00:00
|
|
|
|
|
|
|
|
|
/* Clear bits if they're already high */
|
2008-08-23 20:59:12 +00:00
|
|
|
|
radeon_acknowledge_irqs(dev_priv, &dummy);
|
2003-03-09 02:08:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-08-23 20:59:12 +00:00
|
|
|
|
int radeon_driver_irq_postinstall(struct drm_device * dev)
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
{
|
2003-03-09 02:08:30 +00:00
|
|
|
|
drm_radeon_private_t *dev_priv =
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
(drm_radeon_private_t *) dev->dev_private;
|
2003-03-09 02:08:30 +00:00
|
|
|
|
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
atomic_set(&dev_priv->swi_emitted, 0);
|
|
|
|
|
DRM_INIT_WAITQUEUE(&dev_priv->swi_queue);
|
2003-03-09 02:08:30 +00:00
|
|
|
|
|
2009-09-28 22:37:07 +00:00
|
|
|
|
if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2008-08-23 20:59:12 +00:00
|
|
|
|
radeon_irq_set_state(dev, RADEON_SW_INT_ENABLE, 1);
|
|
|
|
|
|
|
|
|
|
return 0;
|
2003-03-09 02:08:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-08-23 20:59:12 +00:00
|
|
|
|
void radeon_driver_irq_uninstall(struct drm_device * dev)
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
{
|
2003-03-09 02:08:30 +00:00
|
|
|
|
drm_radeon_private_t *dev_priv =
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
(drm_radeon_private_t *) dev->dev_private;
|
2003-08-19 02:57:31 +00:00
|
|
|
|
if (!dev_priv)
|
|
|
|
|
return;
|
|
|
|
|
|
2008-08-23 20:59:12 +00:00
|
|
|
|
dev_priv->irq_enabled = 0;
|
|
|
|
|
|
2009-09-28 22:37:07 +00:00
|
|
|
|
if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600)
|
|
|
|
|
return;
|
|
|
|
|
|
2009-03-07 21:36:57 +00:00
|
|
|
|
if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS600)
|
2008-08-23 20:59:12 +00:00
|
|
|
|
RADEON_WRITE(R500_DxMODE_INT_MASK, 0);
|
2003-08-19 02:57:31 +00:00
|
|
|
|
/* Disable *all* interrupts */
|
Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.
Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net
2005-04-16 03:44:47 +00:00
|
|
|
|
RADEON_WRITE(RADEON_GEN_INT_CNTL, 0);
|
2003-03-09 02:08:30 +00:00
|
|
|
|
}
|
2008-08-23 20:59:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int radeon_vblank_crtc_get(struct drm_device *dev)
|
|
|
|
|
{
|
|
|
|
|
drm_radeon_private_t *dev_priv = (drm_radeon_private_t *) dev->dev_private;
|
|
|
|
|
|
|
|
|
|
return dev_priv->vblank_crtc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int radeon_vblank_crtc_set(struct drm_device *dev, int64_t value)
|
|
|
|
|
{
|
|
|
|
|
drm_radeon_private_t *dev_priv = (drm_radeon_private_t *) dev->dev_private;
|
|
|
|
|
if (value & ~(DRM_RADEON_VBLANK_CRTC1 | DRM_RADEON_VBLANK_CRTC2)) {
|
|
|
|
|
DRM_ERROR("called with invalid crtc 0x%x\n", (unsigned int)value);
|
|
|
|
|
return -EINVAL;
|
|
|
|
|
}
|
|
|
|
|
dev_priv->vblank_crtc = (unsigned int)value;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|