The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/drm/mach64_drv.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* mach64_drv.c -- ATI Rage 128 driver -*- linux-c -*-
    2  * Created: Mon Dec 13 09:47:27 1999 by faith@precisioninsight.com
    3  */
    4 /*-
    5  * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
    6  * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
    7  * All Rights Reserved.
    8  *
    9  * Permission is hereby granted, free of charge, to any person obtaining a
   10  * copy of this software and associated documentation files (the "Software"),
   11  * to deal in the Software without restriction, including without limitation
   12  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
   13  * and/or sell copies of the Software, and to permit persons to whom the
   14  * Software is furnished to do so, subject to the following conditions:
   15  *
   16  * The above copyright notice and this permission notice (including the next
   17  * paragraph) shall be included in all copies or substantial portions of the
   18  * Software.
   19  *
   20  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   21  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   22  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
   23  * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
   24  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
   25  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
   26  * OTHER DEALINGS IN THE SOFTWARE.
   27  *
   28  * Authors:
   29  *    Rickard E. (Rik) Faith <faith@valinux.com>
   30  *    Gareth Hughes <gareth@valinux.com>
   31  */
   32 
   33 #include <sys/cdefs.h>
   34 __FBSDID("$FreeBSD: releng/6.4/sys/dev/drm/mach64_drv.c 158686 2006-05-17 07:40:12Z anholt $");
   35 
   36 
   37 #include <sys/types.h>
   38 
   39 #include "dev/drm/drmP.h"
   40 #include "dev/drm/drm.h"
   41 #include "dev/drm/mach64_drm.h"
   42 #include "dev/drm/mach64_drv.h"
   43 #include "dev/drm/drm_pciids.h"
   44 
   45 /* drv_PCI_IDs comes from drm_pciids.h, generated from drm_pciids.txt. */
   46 static drm_pci_id_list_t mach64_pciidlist[] = {
   47         mach64_PCI_IDS
   48 };
   49 
   50 static void mach64_configure(drm_device_t *dev)
   51 {
   52         dev->driver.buf_priv_size       = 1; /* No dev_priv */
   53         dev->driver.lastclose           = mach64_driver_lastclose;
   54         dev->driver.vblank_wait         = mach64_driver_vblank_wait;
   55         dev->driver.irq_preinstall      = mach64_driver_irq_preinstall;
   56         dev->driver.irq_postinstall     = mach64_driver_irq_postinstall;
   57         dev->driver.irq_uninstall       = mach64_driver_irq_uninstall;
   58         dev->driver.irq_handler         = mach64_driver_irq_handler;
   59         dev->driver.dma_ioctl           = mach64_dma_buffers;
   60 
   61         dev->driver.ioctls              = mach64_ioctls;
   62         dev->driver.max_ioctl           = mach64_max_ioctl;
   63 
   64         dev->driver.name                = DRIVER_NAME;
   65         dev->driver.desc                = DRIVER_DESC;
   66         dev->driver.date                = DRIVER_DATE;
   67         dev->driver.major               = DRIVER_MAJOR;
   68         dev->driver.minor               = DRIVER_MINOR;
   69         dev->driver.patchlevel          = DRIVER_PATCHLEVEL;
   70 
   71         dev->driver.use_agp             = 1;
   72         dev->driver.use_mtrr            = 1;
   73         dev->driver.use_pci_dma         = 1;
   74         dev->driver.use_dma             = 1;
   75         dev->driver.use_irq             = 1;
   76         dev->driver.use_vbl_irq         = 1;
   77 }
   78 
   79 #ifdef __FreeBSD__
   80 static int
   81 mach64_probe(device_t dev)
   82 {
   83         return drm_probe(dev, mach64_pciidlist);
   84 }
   85 
   86 static int
   87 mach64_attach(device_t nbdev)
   88 {
   89         drm_device_t *dev = device_get_softc(nbdev);
   90 
   91         bzero(dev, sizeof(drm_device_t));
   92         mach64_configure(dev);
   93         return drm_attach(nbdev, mach64_pciidlist);
   94 }
   95 
   96 static device_method_t mach64_methods[] = {
   97         /* Device interface */
   98         DEVMETHOD(device_probe,         mach64_probe),
   99         DEVMETHOD(device_attach,        mach64_attach),
  100         DEVMETHOD(device_detach,        drm_detach),
  101 
  102         { 0, 0 }
  103 };
  104 
  105 static driver_t mach64_driver = {
  106         "drm",
  107         mach64_methods,
  108         sizeof(drm_device_t)
  109 };
  110 
  111 extern devclass_t drm_devclass;
  112 #if __FreeBSD_version >= 700010
  113 DRIVER_MODULE(mach64, vgapci, mach64_driver, drm_devclass, 0, 0);
  114 #else
  115 DRIVER_MODULE(mach64, pci, mach64_driver, drm_devclass, 0, 0);
  116 #endif
  117 MODULE_DEPEND(mach64, drm, 1, 1, 1);
  118 
  119 #elif defined(__NetBSD__) || defined(__OpenBSD__)
  120 CFDRIVER_DECL(mach64, DV_TTY, NULL);
  121 #endif

Cache object: d2ae100e4e981e695d309ddee18f02ba


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.