drm_stub.c revision 1494
/*
*/
/*
* Copyright (c) 2012, 2013 Intel Corporation. All rights reserved.
*/
/**
* \file drm_stub.h
* Stub support
*
* \author Rickard E. (Rik) Faith <faith@valinux.com>
*/
/*
* Created: Fri Jan 19 10:48:35 2001 by faith@acm.org
*
* Copyright 2001 VA Linux Systems, Inc., Sunnyvale, California.
* 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,
* 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
* 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.
*/
#include "drmP.h"
#include "drm_core.h"
#include "drm_linux_list.h"
struct idr drm_minors_idr;
{
int new_id;
int ret;
switch (type) {
case DRM_MINOR_LEGACY:
break;
case DRM_MINOR_CONTROL:
break;
case DRM_MINOR_RENDER:
break;
case DRM_MINOR_VGATEXT:
break;
case DRM_MINOR_AGPMASTER:
break;
default:
return -EINVAL;
}
if (ret) {
return ret;
}
return -EINVAL;
}
return new_id;
}
{
struct drm_master *master;
int i;
if (!master)
return NULL;
for (i = 0; i < DRM_HASH_SIZE; i++) {
}
return master;
}
{
return master;
}
{
int i;
}
}
master->unique_len = 0;
}
for (i = 0; i < DRM_HASH_SIZE; i++) {
}
}
}
{
}
/* LINTED */
{
int ret = 0;
return 0;
return -EINVAL;
return -EINVAL;
}
}
}
return 0;
}
/* LINTED */
{
return -EINVAL;
return -EINVAL;
return 0;
}
struct drm_driver *driver)
{
int retcode;
/* the DRM has 6 basic counters */
if (retcode) {
DRM_ERROR("Cannot allocate memory for context bitmap.\n");
goto error_out_unreg;
}
if (retcode) {
DRM_ERROR("Cannot initialize graphics execution "
"manager (GEM)\n");
goto error_out_unreg;
}
}
DRM_ERROR("Failed to create drm workqueue.\n");
goto error_out_unreg;
}
return 0;
(void)drm_lastclose(dev);
return retcode;
}
/**
* Get a secondary minor number.
*
* \param dev device data structure
* \param sec-minor structure to hold the assigned minor
* \return negative number on failure.
*
* Search an empty entry and initialize it to the given parameters, and
* create the proc init entry via proc_init(). This routines assigns
* minor numbers to secondary heads of multi-headed cards
*/
{
int ret;
int minor_id;
DRM_DEBUG("\n");
if (minor_id < 0)
return minor_id;
if (!new_minor) {
goto err_idr;
}
if (type == DRM_MINOR_LEGACY)
else if (type == DRM_MINOR_CONTROL)
else if (type == DRM_MINOR_RENDER)
else if (type == DRM_MINOR_VGATEXT)
else if (type == DRM_MINOR_AGPMASTER)
if (ret)
goto err_g2;
return 0;
return ret;
}
/**
* Register.
*
* \return zero on success or a negative number on failure.
*
* Attempt to gets inter module "drm" information. If we are first
* then register the character device and inter module information.
* Try and register, if we fail to register, backout previous work.
*/
{
int ret;
DRM_DEBUG("\n");
DRM_ERROR("DRM: Fill_in_dev failed");
goto err_g1;
}
goto err_g2;
}
if (drm_core_has_AGP(dev)) {
goto err_g1;
}
if (ret)
goto err_g3;
}
goto err_g4;
if (ret)
goto err_g5;
}
if (drm_init_kstats(dev)) {
DRM_ERROR("init kstats error");
goto err_g5;
}
return 0;
if (drm_core_has_AGP(dev))
return ret;
}
/**
* Put a secondary minor number.
*
* \param sec_minor - structure to be released
* \return always zero
*
* Cleans up the proc resources. Not legal for this to be the
* last minor released.
*
*/
{
return 0;
}
/**
* Called via drm_exit() at module unload time or when pci device is
* unplugged.
*
* Cleans up all DRM device, calling drm_lastclose().
*
* \sa drm_init
*/
{
struct drm_driver *driver;
DRM_DEBUG("\n");
if (!dev) {
DRM_ERROR("cleanup called no dev\n");
return;
}
(void) drm_lastclose(dev);
}
if (drm_core_has_AGP(dev))
}