mga_dma.c (182080) | mga_dma.c (189130) |
---|---|
1/* mga_dma.c -- DMA support for mga g200/g400 -*- linux-c -*- 2 * Created: Mon Dec 13 01:50:01 1999 by jhartmann@precisioninsight.com 3 */ 4/* Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. 5 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. 6 * All Rights Reserved. 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a --- 12 unchanged lines hidden (view full) --- 21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 22 * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 * DEALINGS IN THE SOFTWARE. 26 */ 27 28#include <sys/cdefs.h> | 1/* mga_dma.c -- DMA support for mga g200/g400 -*- linux-c -*- 2 * Created: Mon Dec 13 01:50:01 1999 by jhartmann@precisioninsight.com 3 */ 4/* Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. 5 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. 6 * All Rights Reserved. 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a --- 12 unchanged lines hidden (view full) --- 21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 22 * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 * DEALINGS IN THE SOFTWARE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/sys/dev/drm/mga_dma.c 182080 2008-08-23 20:59:12Z rnoland $"); | 29__FBSDID("$FreeBSD: head/sys/dev/drm/mga_dma.c 189130 2009-02-28 02:37:55Z rnoland $"); |
30 31/** 32 * \file mga_dma.c 33 * DMA support for MGA G200 / G400. 34 * 35 * \author Rickard E. (Rik) Faith <faith@valinux.com> 36 * \author Jeff Hartmann <jhartmann@valinux.com> 37 * \author Keith Whitwell <keith@tungstengraphics.com> --- 356 unchanged lines hidden (view full) --- 394 395/* ================================================================ 396 * DMA initialization, cleanup 397 */ 398 399int mga_driver_load(struct drm_device *dev, unsigned long flags) 400{ 401 drm_mga_private_t *dev_priv; | 30 31/** 32 * \file mga_dma.c 33 * DMA support for MGA G200 / G400. 34 * 35 * \author Rickard E. (Rik) Faith <faith@valinux.com> 36 * \author Jeff Hartmann <jhartmann@valinux.com> 37 * \author Keith Whitwell <keith@tungstengraphics.com> --- 356 unchanged lines hidden (view full) --- 394 395/* ================================================================ 396 * DMA initialization, cleanup 397 */ 398 399int mga_driver_load(struct drm_device *dev, unsigned long flags) 400{ 401 drm_mga_private_t *dev_priv; |
402 int ret; |
|
402 403 dev_priv = drm_alloc(sizeof(drm_mga_private_t), DRM_MEM_DRIVER); 404 if (!dev_priv) 405 return -ENOMEM; 406 407 dev->dev_private = (void *)dev_priv; 408 memset(dev_priv, 0, sizeof(drm_mga_private_t)); 409 410 dev_priv->usec_timeout = MGA_DEFAULT_USEC_TIMEOUT; 411 dev_priv->chipset = flags; 412 413 dev_priv->mmio_base = drm_get_resource_start(dev, 1); 414 dev_priv->mmio_size = drm_get_resource_len(dev, 1); 415 416 dev->counters += 3; 417 dev->types[6] = _DRM_STAT_IRQ; 418 dev->types[7] = _DRM_STAT_PRIMARY; 419 dev->types[8] = _DRM_STAT_SECONDARY; 420 | 403 404 dev_priv = drm_alloc(sizeof(drm_mga_private_t), DRM_MEM_DRIVER); 405 if (!dev_priv) 406 return -ENOMEM; 407 408 dev->dev_private = (void *)dev_priv; 409 memset(dev_priv, 0, sizeof(drm_mga_private_t)); 410 411 dev_priv->usec_timeout = MGA_DEFAULT_USEC_TIMEOUT; 412 dev_priv->chipset = flags; 413 414 dev_priv->mmio_base = drm_get_resource_start(dev, 1); 415 dev_priv->mmio_size = drm_get_resource_len(dev, 1); 416 417 dev->counters += 3; 418 dev->types[6] = _DRM_STAT_IRQ; 419 dev->types[7] = _DRM_STAT_PRIMARY; 420 dev->types[8] = _DRM_STAT_SECONDARY; 421 |
422 ret = drm_vblank_init(dev, 1); 423 424 if (ret) { 425 (void) mga_driver_unload(dev); 426 return ret; 427 } 428 |
|
421 return 0; 422} 423 424/** 425 * Bootstrap the driver for AGP DMA. 426 * 427 * \todo 428 * Investigate whether there is any benifit to storing the WARP microcode in --- 736 unchanged lines hidden --- | 429 return 0; 430} 431 432/** 433 * Bootstrap the driver for AGP DMA. 434 * 435 * \todo 436 * Investigate whether there is any benifit to storing the WARP microcode in --- 736 unchanged lines hidden --- |