/*
*/
/*
* Copyright (c) 2012 Intel Corporation. All rights reserved.
*/
/**
* \file drm_ioctl.c
* IOCTL processing for DRM
*
* \author Rickard E. (Rik) Faith <faith@valinux.com>
* \author Gareth Hughes <gareth@valinux.com>
*/
/*
* Created: Fri Jan 8 09:01:26 1999 by faith@valinux.com
*
* Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
* Copyright 2000 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_io32.h"
/**
* Get the bus id.
*
* \param inode device inode.
* \param file_priv DRM file private.
* \param cmd command.
* \param arg user argument, pointing to a drm_unique structure.
* \return zero on success or a negative number on failure.
*
* Copies the bus id from drm_device::unique into user space.
*/
/* LINTED */
{
struct drm_unique *u = data;
return -EFAULT;
}
return -EINVAL;
}
return -EFAULT;
}
return 0;
}
/*
* Deprecated in DRM version 1.1, and will return EBUSY when setversion has
* requested version 1.1 or greater.
*/
/* LINTED */
{
return -EINVAL;
}
{
int len;
return -EBUSY;
return -ENOMEM;
DRM_ERROR("buffer overflow");
else
return 0;
}
/**
* Get a mapping information.
*
* \param inode device inode.
* \param file_priv DRM file private.
* \param cmd command.
* \param arg user argument, pointing to a drm_map structure.
*
* \return zero on success or a negative number on failure.
*
* Searches for the mapping with the specified offset and copies its information
* into userspace
*/
/* LINTED */
{
int idx;
int i;
if (idx < 0)
return -EINVAL;
i = 0;
if (i == idx) {
break;
}
i++;
}
return -EINVAL;
}
return 0;
}
/**
* Get client information.
*
* \param inode device inode.
* \param file_priv DRM file private.
* \param cmd command.
* \param arg user argument, pointing to a drm_client structure.
*
* \return zero on success or a negative number on failure.
*
* Searches for the client with the specified index and copies its information
* into userspace
*/
/* LINTED */
{
int idx;
int i;
i = 0;
if (i++ >= idx) {
return 0;
}
}
return -EINVAL;
}
/**
* Get statistics information.
*
* \param inode device inode.
* \param file_priv DRM file private.
* \param cmd command.
* \param arg user argument, pointing to a drm_stats structure.
*
* \return zero on success or a negative number on failure.
*/
/* LINTED E_FUNC_ARG_UNUSED */
{
int i;
else
}
return 0;
}
/**
*/
/* LINTED E_FUNC_ARG_UNUSED */
{
switch (req->capability) {
case DRM_CAP_DUMB_BUFFER:
break;
case DRM_CAP_VBLANK_HIGH_CRTC:
break;
break;
break;
default:
return -EINVAL;
}
return 0;
}
/**
* Setversion ioctl.
*
* \param inode device inode.
* \param file_priv DRM file private.
* \param cmd command.
* \param arg user argument, pointing to a drm_lock structure.
* \return zero on success or negative number on failure.
*
* Sets the requested interface version
*/
/* LINTED */
{
goto done;
}
sv->drm_di_minor);
/*
* Version 1.1 includes tying of DRM to specific device
*/
}
}
goto done;
}
/* OSOL_drm: if (dev->driver->set_version)
dev->driver->set_version(dev, sv); */
}
done:
return retcode;
}
/** No-op ioctl. */
/* LINTED */
{
DRM_DEBUG("\n");
return 0;
}