1450N/A * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. 1450N/A * \author Rickard E. (Rik) Faith <faith@valinux.com> 1450N/A * \author Daryll Strauss <daryll@valinux.com> 1450N/A * \author Gareth Hughes <gareth@valinux.com> 1450N/A * Created: Mon Jan 4 08:58:31 1999 by faith@valinux.com 1450N/A * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. 1450N/A * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. 1450N/A * Copyright (c) 2009, 2013, Intel Corporation. 1450N/A * Permission is hereby granted, free of charge, to any person obtaining a 1450N/A * copy of this software and associated documentation files (the "Software"), 1450N/A * to deal in the Software without restriction, including without limitation 1450N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense, 1450N/A * and/or sell copies of the Software, and to permit persons to whom the 1450N/A * Software is furnished to do so, subject to the following conditions: 1450N/A * The above copyright notice and this permission notice (including the next 1450N/A * paragraph) shall be included in all copies or substantial portions of the 1450N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1450N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1450N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 1450N/A * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 1450N/A * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 1450N/A * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 1450N/A * OTHER DEALINGS IN THE SOFTWARE. 1450N/A /* OSOL_drm: moved from drm_fill_in_dev */ 1450N/A /* OSOL_drm: moved from drm_get_dev */ 1450N/A /* setup the grouping for the legacy output */ 1450N/A * The kernel's context could be created here, but is now created 1450N/A * in drm_dma_enqueue. This is more resource-efficient for 1450N/A * hardware that does not do DMA, but may mean that 1450N/A * drm_select_queue fails between the time the interrupt is 1450N/A * initialized and the time the queues are initialized. 1450N/A * \return zero on success or a negative number on failure. 1450N/A * Searches the DRM device with the same minor number, calls open_helper(), and 1450N/A * increments the device open count. If the open count was previous at zero, 1450N/A * i.e., it's the first that the device is open, then calls setup(). 1450N/A * Creates and initializes a drm_file structure for the file private data in \p 1450N/A * filp and add it into the double linked list in \p dev. 1450N/A /* for compatibility root is always authenticated */ 1450N/A /* if there is no current master make this fd it */ 1450N/A /* take another reference for the copy in the local file priv */ 1450N/A /* drop both references if this fails */ 1450N/A /* drop both references if this fails */ 1450N/A /* get a reference to the master */ 1450N/A /* Remove unconsumed events */ 1450N/A * \return zero on success or a negative number on failure. 1450N/A * If the hardware lock is held then free it, and take it again for the kernel 1450N/A * context since it's necessary to reclaim buffers. Unlink the file private 1450N/A * data from its list and free it. Decreases the open count and if it reaches 1450N/A * zero calls drm_lastclose(). 1450N/A /* ======================================================== 1450N/A /* Release any auth tokens that might point to this file_priv, 1450N/A (do that under the drm_global_mutex) */ 1450N/A /* if the master has gone away we can't do anything with the lock */ 1450N/A * Since the master is disappearing, so is the 1450N/A /* drop the reference held my the minor */ 1450N/A /* drop the reference held my the file priv */ 1450N/A /* ========================================================