i915_drv.c revision 91fae47004cb3ccf0cf192ca6712326253ef8a01
/* BEGIN CSTYLED */
/*
* i915_drv.c -- Intel i915 driver -*- linux-c -*-
* Created: Wed Feb 14 17:10:04 2001 by gareth@valinux.com
*/
/*
* 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.
*
* Authors:
* Gareth Hughes <gareth@valinux.com>
*
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* I915 DRM Driver for Solaris
*
* This driver provides the hardware 3D acceleration support for Intel
* DRI (Direct Rendering Infrastructure). DRM (Direct Rendering Manager) here
* means the kernel device driver in DRI.
*
* I915 driver is a device dependent driver only, it depends on a misc module
* named drm for generic DRM operations.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "drmP.h"
#include "i915_drm.h"
#include "i915_drv.h"
#include "drm_pciids.h"
/*
* cb_ops entrypoint
*/
extern struct cb_ops drm_cb_ops;
/*
* module entrypoint
*/
/* drv_PCI_IDs comes from drm_pciids.h */
static drm_pci_id_list_t i915_pciidlist[] = {
};
extern void i915_init_ioctl_arrays(void);
/*
* Local routines
*/
static void i915_configure(drm_driver_t *);
/*
* DRM driver
*/
static drm_driver_t i915_driver = {0};
static struct dev_ops i915_dev_ops = {
DEVO_REV, /* devo_rev */
0, /* devo_refcnt */
i915_info, /* devo_getinfo */
nulldev, /* devo_identify */
nulldev, /* devo_probe */
i915_attach, /* devo_attach */
i915_detach, /* devo_detach */
nodev, /* devo_reset */
&drm_cb_ops, /* devo_cb_ops */
NULL, /* devo_bus_ops */
NULL /* power */
};
&mod_driverops, /* drv_modops */
"I915 DRM driver %I%", /* drv_linkinfo */
&i915_dev_ops, /* drv_dev_ops */
};
static struct modlinkage modlinkage = {
};
/*
* softstate head
*/
static void *i915_statep;
int
_init(void)
{
int error;
sizeof (drm_device_t), DRM_MAX_INSTANCES)) != 0)
return (error);
return (error);
}
return (error);
} /* _init() */
int
_fini(void)
{
int error;
return (error);
(void) ddi_soft_state_fini(&i915_statep);
return (0);
} /* _fini() */
int
{
} /* _info() */
static int
{
void *handle;
int unit;
if (cmd != DDI_ATTACH) {
DRM_ERROR("i915_attach: only attach op supported");
return (DDI_FAILURE);
}
return (DDI_FAILURE);
}
/*
* Call drm_supp_register to create minor nodes for us
*/
DRM_ERROR("i915_attach: drm_supp_register failed");
goto err_exit1;
}
/*
* After drm_supp_register, we can call drm_xxx routine
*/
DRM_ERROR("i915_open: "
"DRM current don't support this graphics card");
goto err_exit2;
}
/* call common attach code */
DRM_ERROR("i915_attach: drm_attach failed");
goto err_exit2;
}
return (DDI_SUCCESS);
(void) drm_supp_unregister(handle);
return (DDI_FAILURE);
} /* i915_attach() */
static int
{
int unit;
if (cmd != DDI_DETACH)
return (DDI_FAILURE);
return (DDI_FAILURE);
(void) drm_detach(statep);
return (DDI_SUCCESS);
} /* i915_detach() */
/*ARGSUSED*/
static int
{
int error = DDI_SUCCESS;
int unit;
switch (infocmd) {
case DDI_INFO_DEVT2DEVINFO:
error = DDI_FAILURE;
} else {
error = DDI_SUCCESS;
}
break;
case DDI_INFO_DEVT2INSTANCE:
error = DDI_SUCCESS;
break;
default:
error = DDI_FAILURE;
break;
}
return (error);
} /* i915_info() */
{
}