summaryrefslogtreecommitdiff
path: root/shared/mach64_state.c
diff options
context:
space:
mode:
authorLeif Delgass <ldelgass@users.sourceforge.net>2003-02-26 09:49:54 +0000
committerLeif Delgass <ldelgass@users.sourceforge.net>2003-02-26 09:49:54 +0000
commitae0b8f750ae4ee190f7567fee5aca95d92e7895e (patch)
treed84c6248f4765a932b9e41aadf3e78fba5a207e8 /shared/mach64_state.c
parent3cde41f7cd7f439c11e845fd379e62a45611aa40 (diff)
Add VBLANK sync/throttle support. Many code cleanups, including moving themach64-0-0-6-20030329-freeze
interrupt-related code in the DRM to the new mach64_irq.c.
Diffstat (limited to 'shared/mach64_state.c')
-rw-r--r--shared/mach64_state.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/shared/mach64_state.c b/shared/mach64_state.c
index cad08cd8..a2269701 100644
--- a/shared/mach64_state.c
+++ b/shared/mach64_state.c
@@ -2,6 +2,7 @@
* Created: Sun Dec 03 19:20:26 2000 by gareth@valinux.com
*
* Copyright 2000 Gareth Hughes
+ * Copyright 2002-2003 Leif Delgass
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -18,7 +19,7 @@
* 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
- * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * THE COPYRIGHT OWNER(S) 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.
*
@@ -870,15 +871,23 @@ int mach64_get_param( DRM_IOCTL_ARGS )
DRM_DEBUG( "%s\n", __FUNCTION__ );
- LOCK_TEST_WITH_RETURN( dev );
+ if ( !dev_priv ) {
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
+ return DRM_ERR(EINVAL);
+ }
DRM_COPY_FROM_USER_IOCTL( param, (drm_mach64_getparam_t *)data,
sizeof(param) );
switch ( param.param ) {
case MACH64_PARAM_FRAMES_QUEUED:
+ /* Needs lock since it calls mach64_ring_tick() */
+ LOCK_TEST_WITH_RETURN( dev );
value = mach64_do_get_frames_queued( dev_priv );
break;
+ case MACH64_PARAM_IRQ_NR:
+ value = dev->irq;
+ break;
default:
return DRM_ERR(EINVAL);
}