Import of XFree86 4.0.1d-pre

main
Alan Hourihane 2000-09-22 18:14:54 +00:00
parent e06e4a73ac
commit 881683873e
3 changed files with 77 additions and 16 deletions

View File

@ -2,6 +2,7 @@
* Created: Thu Oct 7 10:50:22 1999 by faith@precisioninsight.com * Created: Thu Oct 7 10:50:22 1999 by faith@precisioninsight.com
* *
* Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
* Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
* All Rights Reserved. * All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
@ -24,12 +25,12 @@
* DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
* *
* Authors: * Authors:
* Rickard E. (Rik) Faith <faith@precisioninsight.com> * Rickard E. (Rik) Faith <faith@valinux.com>
* Daryll Strauss <daryll@valinux.com>
* Sung-Ching Lin <sclin@sis.com.tw>
* *
*/ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_context.c,v 1.2 2000/08/04 03:51:47 tsi Exp $ */ /* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_context.c,v 1.5 2000/08/28 02:43:16 tsi Exp $ */
#include <linux/sched.h>
#define __NO_VERSION__ #define __NO_VERSION__
#include "drmP.h" #include "drmP.h"
@ -39,9 +40,7 @@ extern drm_ctx_t sis_res_ctx;
static int sis_alloc_queue(drm_device_t *dev) static int sis_alloc_queue(drm_device_t *dev)
{ {
static int context = 0; return drm_ctxbitmap_next(dev);
return ++context; /* Should this reuse contexts in the future? */
} }
int sis_context_switch(drm_device_t *dev, int old, int new) int sis_context_switch(drm_device_t *dev, int old, int new)
@ -138,6 +137,11 @@ int sis_addctx(struct inode *inode, struct file *filp, unsigned int cmd,
ctx.handle = sis_alloc_queue(dev); ctx.handle = sis_alloc_queue(dev);
} }
DRM_DEBUG("%d\n", ctx.handle); DRM_DEBUG("%d\n", ctx.handle);
if (ctx.handle == -1) {
DRM_DEBUG("Not enough free contexts.\n");
/* Should this return -EBUSY instead? */
return -ENOMEM;
}
/* new added */ /* new added */
sis_init_context(ctx.handle); sis_init_context(ctx.handle);
@ -198,16 +202,13 @@ int sis_newctx(struct inode *inode, struct file *filp, unsigned int cmd,
int sis_rmctx(struct inode *inode, struct file *filp, unsigned int cmd, int sis_rmctx(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long arg) unsigned long arg)
{ {
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
drm_ctx_t ctx; drm_ctx_t ctx;
copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT); copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT);
DRM_DEBUG("%d\n", ctx.handle); DRM_DEBUG("%d\n", ctx.handle);
/* This is currently a noop because we drm_ctxbitmap_free(dev, ctx.handle);
don't reuse context values. Perhaps we
should? */
/* new added */
sis_final_context(ctx.handle);
return 0; return 0;
} }

View File

@ -1,3 +1,34 @@
/* sis_ds.c -- Private header for Direct Rendering Manager -*- linux-c -*-
* Created: Mon Jan 4 10:05:05 1999 by sclin@sis.com.tw
*
* Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
* All rights reserved.
*
* 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:
* Sung-Ching Lin <sclin@sis.com.tw>
*
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.c,v 1.2 2000/08/04 03:51:47 tsi Exp $ */
#define __NO_VERSION__ #define __NO_VERSION__
#include <linux/module.h> #include <linux/module.h>
#include <linux/delay.h> #include <linux/delay.h>

View File

@ -1,3 +1,32 @@
/* sis_ds.h -- Private header for Direct Rendering Manager -*- linux-c -*-
* Created: Mon Jan 4 10:05:05 1999 by sclin@sis.com.tw
*
* Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
* All rights reserved.
*
* 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:
* Sung-Ching Lin <sclin@sis.com.tw>
*
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.h,v 1.2 2000/08/04 03:51:47 tsi Exp $ */ /* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_ds.h,v 1.2 2000/08/04 03:51:47 tsi Exp $ */
#ifndef _sis_ds_h_ #ifndef _sis_ds_h_