/*
*/
/*
* radeon_drv.c -- ATI Radeon 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>
*
*/
#include "drmP.h"
#include "drm.h"
#include "radeon_drm.h"
#include "radeon_drv.h"
#include "drm_pciids.h"
#ifdef __sparc
#include "efb.h"
#endif /* sparc */
/*
* cb_ops entrypoint
*/
extern struct cb_ops drm_cb_ops;
/* drv_PCI_IDs comes from drm_pciids.h */
};
/*
* module entrypoint
*/
extern void radeon_init_ioctl_arrays(void);
/*
* Local routines
*/
static void radeon_configure(drm_driver_t *);
/*
* DRM driver
*/
/*
* Common device operations structure for all DRM drivers
*/
#ifdef __sparc
nodev, /* cb_open */
nodev, /* cb_close */
nodev, /* cb_strategy */
nodev, /* cb_print */
nodev, /* cb_dump */
nodev, /* cb_read */
nodev, /* cb_write */
efb_ioctl, /* cb_ioctl */
nodev, /* cb_devmap */
nodev, /* cb_mmap */
NULL, /* cb_segmap */
nochpoll, /* cb_chpoll */
ddi_prop_op, /* cb_prop_op */
0, /* cb_stream */
};
DEVO_REV, /* devo_rev */
0, /* devo_refcnt */
radeon_info, /* devo_getinfo */
nulldev, /* devo_identify */
nulldev, /* devo_probe */
radeon_attach, /* devo_attach */
radeon_detach, /* devo_detach */
nodev, /* devo_reset */
&efb_cb_ops, /* devo_cb_ops */
NULL, /* devo_bus_ops */
NULL /* power */
};
&mod_driverops, /* drv_modops */
"efb DRM driver 1.4", /* drv_linkinfo */
&efb_dev_ops, /* drv_dev_ops */
};
#else
DEVO_REV, /* devo_rev */
0, /* devo_refcnt */
radeon_info, /* devo_getinfo */
nulldev, /* devo_identify */
nulldev, /* devo_probe */
radeon_attach, /* devo_attach */
radeon_detach, /* devo_detach */
nodev, /* devo_reset */
&drm_cb_ops, /* devo_cb_ops */
NULL, /* devo_bus_ops */
NULL /* power */
};
&mod_driverops, /* drv_modops */
"radeon DRM driver 1.4", /* drv_linkinfo */
&radeon_dev_ops, /* drv_dev_ops */
};
#endif
};
/*
* softstate head
*/
void *radeon_statep;
int
_init(void)
{
int error;
sizeof (drm_device_t), DRM_MAX_INSTANCES)) != 0)
return (error);
#ifdef __sparc
#endif /* sparc */
return (error);
}
return (error);
} /* _init() */
int
_fini(void)
{
int error;
return (error);
(void) ddi_soft_state_fini(&radeon_statep);
return (0);
} /* _fini() */
int
{
} /* _info() */
static int
{
void *handle;
int unit;
if (cmd != DDI_ATTACH) {
DRM_ERROR("radeon_attach: only attach op supported");
return (DDI_FAILURE);
}
"radeon_attach: alloc softstate failed unit=%d", unit);
return (DDI_FAILURE);
}
/*
* Call drm_supp_register to create minor nodes for us
*/
DRM_ERROR("radeon_attach: drm_supp_register failed");
goto err_exit1;
}
/*
* After drm_supp_register, we can call drm_xxx routine
*/
DRM_ERROR("radeon_open: "
"DRM current don't support this graphics card");
goto err_exit2;
}
/* call common attach code */
DRM_ERROR("radeon_attach: drm_attach failed");
goto err_exit2;
}
#ifdef __sparc
goto err_exit2;
}
#endif /* sparc */
return (DDI_SUCCESS);
(void) drm_supp_unregister(handle);
return (DDI_FAILURE);
} /* radeon_attach() */
static int
{
int unit;
if (cmd != DDI_DETACH)
return (DDI_FAILURE);
return (DDI_FAILURE);
#ifdef __sparc
(void) efb_detach(statep);
#endif /* sparc */
(void) drm_detach(statep);
return (DDI_SUCCESS);
} /* radeon_detach() */
/*ARGSUSED*/
static int
{
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);
} /* radeon_info() */
static void
{
} /* radeon_configure() */