lano1106_kcl_agp_13_4.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. --- 13.4/common/lib/modules/fglrx/build_mod/kcl_agp.c 2013-05-24 16:45:52.236740084 -0400
  2. +++ 13.4/common/lib/modules/fglrx/build_mod/kcl_agp.c 2013-05-24 16:49:29.283579408 -0400
  3. @@ -56,6 +56,43 @@ unsigned int KCL_AGP_IsInUse(void)
  4. return kcl_agp_is_in_use;
  5. }
  6. +/** \brief Find AGP caps registers in PCI config space
  7. + ** \param dev PCI device handle
  8. + ** \return Positive register index on success, negative errno on error
  9. + */
  10. +int ATI_API_CALL KCL_AGP_FindCapsRegisters(KCL_PCI_DevHandle dev)
  11. +{
  12. + u8 capndx;
  13. + u32 cap_id;
  14. +
  15. + if (!dev)
  16. + {
  17. + return -ENODEV;
  18. + }
  19. +
  20. + pci_read_config_byte((struct pci_dev*)dev, 0x34, &capndx);
  21. +
  22. + if (capndx == 0x00)
  23. + {
  24. + return -ENODATA;
  25. + }
  26. +
  27. + do
  28. + { // search capability list for AGP caps
  29. + pci_read_config_dword((struct pci_dev*)dev, capndx, &cap_id);
  30. +
  31. + if ((cap_id & 0xff) == 0x02)
  32. + {
  33. + return capndx;
  34. + }
  35. +
  36. + capndx = (cap_id >> 8) & 0xff;
  37. + }
  38. + while (capndx != 0x00);
  39. +
  40. + return -ENODATA;
  41. +}
  42. +
  43. #if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
  44. typedef struct {
  45. @@ -272,43 +309,6 @@ int ATI_API_CALL KCL_AGP_Enable(unsigned
  46. }
  47. }
  48. -/** \brief Find AGP caps registers in PCI config space
  49. - ** \param dev PCI device handle
  50. - ** \return Positive register index on success, negative errno on error
  51. - */
  52. -int ATI_API_CALL KCL_AGP_FindCapsRegisters(KCL_PCI_DevHandle dev)
  53. -{
  54. - u8 capndx;
  55. - u32 cap_id;
  56. -
  57. - if (!dev)
  58. - {
  59. - return -ENODEV;
  60. - }
  61. -
  62. - pci_read_config_byte((struct pci_dev*)dev, 0x34, &capndx);
  63. -
  64. - if (capndx == 0x00)
  65. - {
  66. - return -ENODATA;
  67. - }
  68. -
  69. - do
  70. - { // search capability list for AGP caps
  71. - pci_read_config_dword((struct pci_dev*)dev, capndx, &cap_id);
  72. -
  73. - if ((cap_id & 0xff) == 0x02)
  74. - {
  75. - return capndx;
  76. - }
  77. -
  78. - capndx = (cap_id >> 8) & 0xff;
  79. - }
  80. - while (capndx != 0x00);
  81. -
  82. - return -ENODATA;
  83. -}
  84. -
  85. /** \brief Get AGP caps
  86. ** \param dev PCI device handle
  87. ** \param caps pointer to caps vector