60405de4d8688d96dd05157c28db3ade5c9bc234kz * drm_drv.h -- Generic driver template -*- linux-c -*-
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Created: Thu Nov 23 03:10:50 2000 by gareth@valinux.com
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China * Copyright (c) 2009, Intel Corporation.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * All Rights Reserved.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Permission is hereby granted, free of charge, to any person obtaining a
60405de4d8688d96dd05157c28db3ade5c9bc234kz * copy of this software and associated documentation files (the "Software"),
60405de4d8688d96dd05157c28db3ade5c9bc234kz * to deal in the Software without restriction, including without limitation
60405de4d8688d96dd05157c28db3ade5c9bc234kz * the rights to use, copy, modify, merge, publish, distribute, sublicense,
60405de4d8688d96dd05157c28db3ade5c9bc234kz * and/or sell copies of the Software, and to permit persons to whom the
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Software is furnished to do so, subject to the following conditions:
60405de4d8688d96dd05157c28db3ade5c9bc234kz * The above copyright notice and this permission notice (including the next
60405de4d8688d96dd05157c28db3ade5c9bc234kz * paragraph) shall be included in all copies or substantial portions of the
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Software.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
60405de4d8688d96dd05157c28db3ade5c9bc234kz * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
60405de4d8688d96dd05157c28db3ade5c9bc234kz * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
60405de4d8688d96dd05157c28db3ade5c9bc234kz * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
60405de4d8688d96dd05157c28db3ade5c9bc234kz * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
60405de4d8688d96dd05157c28db3ade5c9bc234kz * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
60405de4d8688d96dd05157c28db3ade5c9bc234kz * OTHER DEALINGS IN THE SOFTWARE.
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Authors:
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Rickard E. (Rik) Faith <faith@valinux.com>
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Gareth Hughes <gareth@valinux.com>
d02310705313ee2fcefee164a4b26d1fa85e9d22miao chen - Sun Microsystems - Beijing China * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
e92e3a8694f157faf8a9e44096a70ada86c556bfzw * Use is subject to license terms.
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing Chinadrm_ioctl_desc_t drm_ioctls[DRIVER_IOCTL_COUNT] = {
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_VERSION)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_version, 0},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_GET_UNIQUE)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_getunique, 0},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_GET_MAGIC)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_getmagic, 0},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_IRQ_BUSID)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_irq_by_busid, DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_GET_MAP)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_getmap, 0},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_GET_CLIENT)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_getclient, 0},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_GET_STATS)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_getstats, 0},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_SET_VERSION)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_setversion, DRM_MASTER|DRM_ROOT_ONLY},
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_MODESET_CTL)] =
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China {drm_modeset_ctl, 0},
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_GEM_CLOSE)] =
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China {drm_gem_close_ioctl, 0},
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_GEM_FLINK)] =
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China {drm_gem_flink_ioctl, DRM_AUTH},
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_GEM_OPEN)] =
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China {drm_gem_open_ioctl, DRM_AUTH},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_SET_UNIQUE)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_setunique, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_BLOCK)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_UNBLOCK)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_AUTH_MAGIC)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_authmagic, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_ADD_MAP)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_addmap_ioctl, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_RM_MAP)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_rmmap_ioctl, DRM_AUTH},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_SET_SAREA_CTX)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_setsareactx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_GET_SAREA_CTX)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_getsareactx, DRM_AUTH},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_ADD_CTX)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_addctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_RM_CTX)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_rmctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_MOD_CTX)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_modctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_GET_CTX)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_getctx, DRM_AUTH},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_SWITCH_CTX)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_switchctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_NEW_CTX)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_newctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_RES_CTX)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_resctx, DRM_AUTH},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_ADD_DRAW)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_adddraw, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_RM_DRAW)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_rmdraw, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_LOCK)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_lock, DRM_AUTH},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_UNLOCK)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_unlock, DRM_AUTH},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_FINISH)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_noop, DRM_AUTH},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_ADD_BUFS)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_addbufs_ioctl, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_MARK_BUFS)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_markbufs, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_INFO_BUFS)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_infobufs, DRM_AUTH},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_MAP_BUFS)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_mapbufs, DRM_AUTH},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_FREE_BUFS)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_freebufs, DRM_AUTH},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_DMA)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_dma, DRM_AUTH},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_CONTROL)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_control, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_AGP_ACQUIRE)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_agp_acquire, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_AGP_RELEASE)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_agp_release, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_AGP_ENABLE)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_agp_enable, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_AGP_INFO)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_agp_info, DRM_AUTH},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_AGP_ALLOC)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_agp_alloc, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_AGP_FREE)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_agp_free, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_AGP_BIND)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_agp_bind, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_AGP_UNBIND)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_agp_unbind, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_SG_ALLOC)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_sg_alloc, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_SG_FREE)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_sg_free, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_WAIT_VBLANK)] =
ee33b1b8d10d92b82e8b3a266d228d3c8007f229miao chen - Sun Microsystems - Beijing China {drm_wait_vblank, 0},
d02310705313ee2fcefee164a4b26d1fa85e9d22miao chen - Sun Microsystems - Beijing China [DRM_IOCTL_NR(DRM_IOCTL_UPDATE_DRAW)] =
d02310705313ee2fcefee164a4b26d1fa85e9d22miao chen - Sun Microsystems - Beijing China {drm_update_draw, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing Chinaextern void idr_list_free(struct idr_list *head);
60405de4d8688d96dd05157c28db3ade5c9bc234kzconst char *
60405de4d8688d96dd05157c28db3ade5c9bc234kzdrm_find_description(int vendor, int device, drm_pci_id_list_t *idlist)
60405de4d8688d96dd05157c28db3ade5c9bc234kz int i = 0;
60405de4d8688d96dd05157c28db3ade5c9bc234kz return ((char *)NULL);
d0538f66491267879b7418b21ad78e3dcc2dcc83cg /* prebuild the SAREA */
d0538f66491267879b7418b21ad78e3dcc2dcc83cg if (retval != 0) {
d0538f66491267879b7418b21ad78e3dcc2dcc83cg DRM_DEBUG("drm_firstopen: use_agp=%d", dev->driver->use_agp);
d0538f66491267879b7418b21ad78e3dcc2dcc83cg if (retval != 0) {
d0538f66491267879b7418b21ad78e3dcc2dcc83cg DRM_ERROR("drm_firstopen: driver-specific firstopen failed");
60405de4d8688d96dd05157c28db3ade5c9bc234kz if (i != 0)
60405de4d8688d96dd05157c28db3ade5c9bc234kz return (i);
60405de4d8688d96dd05157c28db3ade5c9bc234kz for (i = 0; i < DRM_HASH_SIZE; i++) {
d0538f66491267879b7418b21ad78e3dcc2dcc83cg return (0);
60405de4d8688d96dd05157c28db3ade5c9bc234kz/* Free resources associated with the DRM on the last close. */
60405de4d8688d96dd05157c28db3ade5c9bc234kz drm_free(dev->unique, dev->unique_len + 1, DRM_MEM_DRIVER);
60405de4d8688d96dd05157c28db3ade5c9bc234kz /* Clear pid list */
60405de4d8688d96dd05157c28db3ade5c9bc234kz for (i = 0; i < DRM_HASH_SIZE; i++) {
60405de4d8688d96dd05157c28db3ade5c9bc234kz /* Clear AGP information */
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Remove AGP resources, but leave dev->agp
60405de4d8688d96dd05157c28db3ade5c9bc234kz * intact until drm_cleanup is called.
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China (void) drm_agp_free_memory(entry->handle, dev);
60405de4d8688d96dd05157c28db3ade5c9bc234kz /* Clean up maps that weren't set up by the driver. */
60405de4d8688d96dd05157c28db3ade5c9bc234kz return (0);
60405de4d8688d96dd05157c28db3ade5c9bc234kz mutex_init(&(dev->lock.lock_mutex), NULL, MUTEX_DRIVER, NULL);
d02310705313ee2fcefee164a4b26d1fa85e9d22miao chen - Sun Microsystems - Beijing China mutex_init(&(dev->dev_lock), "drmdev", MUTEX_DRIVER, NULL);
d02310705313ee2fcefee164a4b26d1fa85e9d22miao chen - Sun Microsystems - Beijing China mutex_init(&dev->irq_lock, "drmirq", MUTEX_DRIVER,
d02310705313ee2fcefee164a4b26d1fa85e9d22miao chen - Sun Microsystems - Beijing China (void *)dev->intr_block);
d02310705313ee2fcefee164a4b26d1fa85e9d22miao chen - Sun Microsystems - Beijing China mutex_init(&dev->drw_lock, "drmdrw", MUTEX_DRIVER, NULL);
d02310705313ee2fcefee164a4b26d1fa85e9d22miao chen - Sun Microsystems - Beijing China mutex_init(&dev->tasklet_lock, "drmtsk", MUTEX_DRIVER, NULL);
d02310705313ee2fcefee164a4b26d1fa85e9d22miao chen - Sun Microsystems - Beijing China dev->irq = pci_get_irq(dev);
60405de4d8688d96dd05157c28db3ade5c9bc234kz if (retcode != 0) {
60405de4d8688d96dd05157c28db3ade5c9bc234kz if (retcode != 0) {
60405de4d8688d96dd05157c28db3ade5c9bc234kz DRM_ERROR("drm_load: Cannot allocate memory for ctx bitmap");
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China if (dev->driver->use_gem == 1) {
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China retcode = drm_gem_init(dev);
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China DRM_ERROR("Cannot initialize graphics execution "
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China "manager (GEM)\n");
d0538f66491267879b7418b21ad78e3dcc2dcc83cg return (0);
d02310705313ee2fcefee164a4b26d1fa85e9d22miao chen - Sun Microsystems - Beijing China mutex_destroy(&dev->irq_lock);
d02310705313ee2fcefee164a4b26d1fa85e9d22miao chen - Sun Microsystems - Beijing China mutex_destroy(&dev->tasklet_lock);
60405de4d8688d96dd05157c28db3ade5c9bc234kz/* called when cleanup this module */
60405de4d8688d96dd05157c28db3ade5c9bc234kzstatic void
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China if (dev->driver->use_gem == 1) {
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China idr_list_free(&dev->object_name_idr);
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China mutex_destroy(&dev->object_name_lock);
d02310705313ee2fcefee164a4b26d1fa85e9d22miao chen - Sun Microsystems - Beijing China mutex_destroy(&dev->irq_lock);
d02310705313ee2fcefee164a4b26d1fa85e9d22miao chen - Sun Microsystems - Beijing China mutex_destroy(&dev->tasklet_lock);
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China dev->gtt_total = 0;
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China atomic_set(&dev->pin_memory, 0);
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China DRM_ERROR("drm_unload");
60405de4d8688d96dd05157c28db3ade5c9bc234kz/*ARGSUSED*/
fca314aae8ba1403ba891f2b0e7a172bcdc055c8cgdrm_open(drm_device_t *dev, drm_cminor_t *mp, int openflags,
fca314aae8ba1403ba891f2b0e7a172bcdc055c8cg retcode = drm_open_helper(dev, mp, openflags, otyp, credp);
60405de4d8688d96dd05157c28db3ade5c9bc234kz/*ARGSUSED*/
fca314aae8ba1403ba891f2b0e7a172bcdc055c8cgdrm_close(drm_device_t *dev, int minor, int flag, int otyp,
60405de4d8688d96dd05157c28db3ade5c9bc234kz * Begin inline drm_release
60405de4d8688d96dd05157c28db3ade5c9bc234kz DRM_DEBUG("Process %d dead, freeing lock for context %d",
d0538f66491267879b7418b21ad78e3dcc2dcc83cg } else if (dev->driver->reclaim_buffers_locked != NULL &&
60405de4d8688d96dd05157c28db3ade5c9bc234kz "retake lock not implemented yet");
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China if (dev->driver->use_dma) {
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China if (dev->driver->use_gem == 1) {
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China drm_gem_release(dev, fpriv);
0035d21c77a24d02faf34c10aabc120ca692efb5miao chen - Sun Microsystems - Beijing China if (dev->driver->postclose != NULL) {
60405de4d8688d96dd05157c28db3ade5c9bc234kz /* XXX Fix domain number (alpha hoses) */
60405de4d8688d96dd05157c28db3ade5c9bc234kz DRM_DEBUG("drm_get_businfo: pci bus: %d, pci slot :%d pci func %d",
60405de4d8688d96dd05157c28db3ade5c9bc234kz const char *s = NULL;
60405de4d8688d96dd05157c28db3ade5c9bc234kz if (s != NULL) {