From e656655a361acf73c5652fcef8cf6ba61dfe7a50 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 30 Oct 2002 06:10:34 +0000 Subject: Kernel support for vblank syncing on Rage 128 and Matrox. --- shared/mga_state.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'shared/mga_state.c') diff --git a/shared/mga_state.c b/shared/mga_state.c index 26ea3e7f..61077220 100644 --- a/shared/mga_state.c +++ b/shared/mga_state.c @@ -1075,3 +1075,36 @@ int mga_dma_blit( DRM_IOCTL_ARGS ) return 0; } + +int mga_getparam( DRM_IOCTL_ARGS ) +{ + DRM_DEVICE; + drm_mga_private_t *dev_priv = dev->dev_private; + drm_mga_getparam_t param; + int value; + + if ( !dev_priv ) { + DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); + return DRM_ERR(EINVAL); + } + + DRM_COPY_FROM_USER_IOCTL( param, (drm_mga_getparam_t *)data, + sizeof(param) ); + + DRM_DEBUG( "pid=%d\n", DRM_CURRENTPID ); + + switch( param.param ) { + case MGA_PARAM_IRQ_NR: + value = dev->irq; + break; + default: + return DRM_ERR(EINVAL); + } + + if ( DRM_COPY_TO_USER( param.value, &value, sizeof(int) ) ) { + DRM_ERROR( "copy_to_user\n" ); + return DRM_ERR(EFAULT); + } + + return 0; +} -- cgit v1.2.3