drm_pci.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Internal Header for the Direct Rendering Manager
  3. *
  4. * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
  5. * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  6. * Copyright (c) 2009-2010, Code Aurora Forum.
  7. * All rights reserved.
  8. *
  9. * Author: Rickard E. (Rik) Faith <faith@valinux.com>
  10. * Author: Gareth Hughes <gareth@valinux.com>
  11. *
  12. * Permission is hereby granted, free of charge, to any person obtaining a
  13. * copy of this software and associated documentation files (the "Software"),
  14. * to deal in the Software without restriction, including without limitation
  15. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  16. * and/or sell copies of the Software, and to permit persons to whom the
  17. * Software is furnished to do so, subject to the following conditions:
  18. *
  19. * The above copyright notice and this permission notice (including the next
  20. * paragraph) shall be included in all copies or substantial portions of the
  21. * Software.
  22. *
  23. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  24. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  25. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  26. * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
  27. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  28. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  29. * OTHER DEALINGS IN THE SOFTWARE.
  30. */
  31. #ifndef _DRM_PCI_H_
  32. #define _DRM_PCI_H_
  33. #include <linux/pci.h>
  34. struct drm_dma_handle;
  35. struct drm_device;
  36. struct drm_driver;
  37. struct drm_master;
  38. struct drm_dma_handle *drm_pci_alloc(struct drm_device *dev, size_t size,
  39. size_t align);
  40. void drm_pci_free(struct drm_device *dev, struct drm_dma_handle * dmah);
  41. int drm_legacy_pci_init(struct drm_driver *driver, struct pci_driver *pdriver);
  42. void drm_legacy_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);
  43. #ifdef CONFIG_PCI
  44. int drm_get_pci_dev(struct pci_dev *pdev,
  45. const struct pci_device_id *ent,
  46. struct drm_driver *driver);
  47. #else
  48. static inline int drm_get_pci_dev(struct pci_dev *pdev,
  49. const struct pci_device_id *ent,
  50. struct drm_driver *driver)
  51. {
  52. return -ENOSYS;
  53. }
  54. #endif
  55. #define DRM_PCIE_SPEED_25 1
  56. #define DRM_PCIE_SPEED_50 2
  57. #define DRM_PCIE_SPEED_80 4
  58. int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *speed_mask);
  59. int drm_pcie_get_max_link_width(struct drm_device *dev, u32 *mlw);
  60. #endif /* _DRM_PCI_H_ */