drm_agpsupport.c (153579) | drm_agpsupport.c (157617) |
---|---|
1/* drm_agpsupport.h -- DRM support for AGP/GART backend -*- linux-c -*- 2 * Created: Mon Dec 13 09:56:45 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 * --- 18 unchanged lines hidden (view full) --- 27 * 28 * Author: 29 * Rickard E. (Rik) Faith <faith@valinux.com> 30 * Gareth Hughes <gareth@valinux.com> 31 * 32 */ 33 34#include <sys/cdefs.h> | 1/* drm_agpsupport.h -- DRM support for AGP/GART backend -*- linux-c -*- 2 * Created: Mon Dec 13 09:56:45 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 * --- 18 unchanged lines hidden (view full) --- 27 * 28 * Author: 29 * Rickard E. (Rik) Faith <faith@valinux.com> 30 * Gareth Hughes <gareth@valinux.com> 31 * 32 */ 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: head/sys/dev/drm/drm_agpsupport.c 153579 2005-12-20 22:44:36Z jhb $"); | 35__FBSDID("$FreeBSD: head/sys/dev/drm/drm_agpsupport.c 157617 2006-04-09 20:45:45Z anholt $"); |
36 37#include "dev/drm/drmP.h" 38 39#ifdef __FreeBSD__ 40#include <pci/agpreg.h> 41#include <dev/pci/pcireg.h> 42#endif 43 44/* Returns 1 if AGP or 0 if not. */ 45static int 46drm_device_find_capability(drm_device_t *dev, int cap) 47{ | 36 37#include "dev/drm/drmP.h" 38 39#ifdef __FreeBSD__ 40#include <pci/agpreg.h> 41#include <dev/pci/pcireg.h> 42#endif 43 44/* Returns 1 if AGP or 0 if not. */ 45static int 46drm_device_find_capability(drm_device_t *dev, int cap) 47{ |
48 int ret; 49 50 if (dev->driver.device_is_agp != NULL) { 51 ret = (*dev->driver.device_is_agp)(dev); 52 53 if (ret != DRM_MIGHT_BE_AGP) { 54 return ret == 2; 55 } 56 } 57 | |
58#ifdef __FreeBSD__ 59#if __FreeBSD_version >= 700010 60 61 return (pci_find_extcap(dev->device, cap, NULL) == 0); 62#else 63 /* Code taken from agp.c. IWBNI that was a public interface. */ 64 u_int32_t status; 65 u_int8_t ptr, next; --- 33 unchanged lines hidden (view full) --- 99{ 100 if (dev->driver.device_is_agp != NULL) { 101 int ret; 102 103 /* device_is_agp returns a tristate, 0 = not AGP, 1 = definitely 104 * AGP, 2 = fall back to PCI capability 105 */ 106 ret = (*dev->driver.device_is_agp)(dev); | 48#ifdef __FreeBSD__ 49#if __FreeBSD_version >= 700010 50 51 return (pci_find_extcap(dev->device, cap, NULL) == 0); 52#else 53 /* Code taken from agp.c. IWBNI that was a public interface. */ 54 u_int32_t status; 55 u_int8_t ptr, next; --- 33 unchanged lines hidden (view full) --- 89{ 90 if (dev->driver.device_is_agp != NULL) { 91 int ret; 92 93 /* device_is_agp returns a tristate, 0 = not AGP, 1 = definitely 94 * AGP, 2 = fall back to PCI capability 95 */ 96 ret = (*dev->driver.device_is_agp)(dev); |
107 if (ret != 2) | 97 if (ret != DRM_MIGHT_BE_AGP) |
108 return ret; 109 } 110 111 return (drm_device_find_capability(dev, PCIY_AGP)); 112} 113 114int drm_device_is_pcie(drm_device_t *dev) 115{ --- 363 unchanged lines hidden --- | 98 return ret; 99 } 100 101 return (drm_device_find_capability(dev, PCIY_AGP)); 102} 103 104int drm_device_is_pcie(drm_device_t *dev) 105{ --- 363 unchanged lines hidden --- |