Deleted Added
full compact
mga_irq.c (112015) mga_irq.c (119098)
1/* mga_irq.c -- IRQ handling for radeon -*- linux-c -*-
2 *
3 * Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
4 *
5 * The Weather Channel (TM) funded Tungsten Graphics to develop the
6 * initial release of the Radeon 8500 driver under the XFree86 license.
7 * This notice must be preserved.
8 *

--- 15 unchanged lines hidden (view full) ---

24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 * DEALINGS IN THE SOFTWARE.
27 *
28 * Authors:
29 * Keith Whitwell <keith@tungstengraphics.com>
30 * Eric Anholt <anholt@FreeBSD.org>
31 *
1/* mga_irq.c -- IRQ handling for radeon -*- linux-c -*-
2 *
3 * Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
4 *
5 * The Weather Channel (TM) funded Tungsten Graphics to develop the
6 * initial release of the Radeon 8500 driver under the XFree86 license.
7 * This notice must be preserved.
8 *

--- 15 unchanged lines hidden (view full) ---

24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 * DEALINGS IN THE SOFTWARE.
27 *
28 * Authors:
29 * Keith Whitwell <keith@tungstengraphics.com>
30 * Eric Anholt <anholt@FreeBSD.org>
31 *
32 * $FreeBSD: head/sys/dev/drm/mga_irq.c 112015 2003-03-09 02:08:30Z anholt $
32 * $FreeBSD: head/sys/dev/drm/mga_irq.c 119098 2003-08-19 02:57:31Z anholt $
33 */
34
35#include "dev/drm/mga.h"
36#include "dev/drm/drmP.h"
37#include "dev/drm/drm.h"
38#include "dev/drm/mga_drm.h"
39#include "dev/drm/mga_drv.h"
40
33 */
34
35#include "dev/drm/mga.h"
36#include "dev/drm/drmP.h"
37#include "dev/drm/drm.h"
38#include "dev/drm/mga_drm.h"
39#include "dev/drm/mga_drv.h"
40
41void mga_dma_service( DRM_IRQ_ARGS )
41irqreturn_t mga_dma_service( DRM_IRQ_ARGS )
42{
43 drm_device_t *dev = (drm_device_t *) arg;
44 drm_mga_private_t *dev_priv =
45 (drm_mga_private_t *)dev->dev_private;
46 int status;
47
48 status = MGA_READ( MGA_STATUS );
49
50 /* VBLANK interrupt */
51 if ( status & MGA_VLINEPEN ) {
52 MGA_WRITE( MGA_ICLEAR, MGA_VLINEICLR );
53 atomic_inc(&dev->vbl_received);
54 DRM_WAKEUP(&dev->vbl_queue);
55 DRM(vbl_send_signals)( dev );
42{
43 drm_device_t *dev = (drm_device_t *) arg;
44 drm_mga_private_t *dev_priv =
45 (drm_mga_private_t *)dev->dev_private;
46 int status;
47
48 status = MGA_READ( MGA_STATUS );
49
50 /* VBLANK interrupt */
51 if ( status & MGA_VLINEPEN ) {
52 MGA_WRITE( MGA_ICLEAR, MGA_VLINEICLR );
53 atomic_inc(&dev->vbl_received);
54 DRM_WAKEUP(&dev->vbl_queue);
55 DRM(vbl_send_signals)( dev );
56 return IRQ_HANDLED;
56 }
57 }
58 return IRQ_NONE;
57}
58
59int mga_vblank_wait(drm_device_t *dev, unsigned int *sequence)
60{
61 unsigned int cur_vblank;
62 int ret = 0;
63
64 /* Assume that the user has missed the current sequence number

--- 25 unchanged lines hidden (view full) ---

90
91 /* Turn on VBL interrupt */
92 MGA_WRITE( MGA_IEN, MGA_VLINEIEN );
93}
94
95void mga_driver_irq_uninstall( drm_device_t *dev ) {
96 drm_mga_private_t *dev_priv =
97 (drm_mga_private_t *)dev->dev_private;
59}
60
61int mga_vblank_wait(drm_device_t *dev, unsigned int *sequence)
62{
63 unsigned int cur_vblank;
64 int ret = 0;
65
66 /* Assume that the user has missed the current sequence number

--- 25 unchanged lines hidden (view full) ---

92
93 /* Turn on VBL interrupt */
94 MGA_WRITE( MGA_IEN, MGA_VLINEIEN );
95}
96
97void mga_driver_irq_uninstall( drm_device_t *dev ) {
98 drm_mga_private_t *dev_priv =
99 (drm_mga_private_t *)dev->dev_private;
98 if ( dev_priv ) {
99 /* Disable *all* interrupts */
100 MGA_WRITE( MGA_IEN, 0 );
101 }
100 if (!dev_priv)
101 return;
102
103 /* Disable *all* interrupts */
104 MGA_WRITE( MGA_IEN, 0 );
102}
105}