rs780.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * Copyright 2008 Advanced Micro Devices, Inc.
  3. * Copyright 2008 Red Hat Inc.
  4. * Copyright 2009 Jerome Glisse.
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a
  7. * copy of this software and associated documentation files (the "Software"),
  8. * to deal in the Software without restriction, including without limitation
  9. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  10. * and/or sell copies of the Software, and to permit persons to whom the
  11. * Software is furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in
  14. * all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  19. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  20. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  21. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  22. * OTHER DEALINGS IN THE SOFTWARE.
  23. *
  24. * Authors: Dave Airlie
  25. * Alex Deucher
  26. * Jerome Glisse
  27. */
  28. #include "drmP.h"
  29. #include "radeon_reg.h"
  30. #include "radeon.h"
  31. /* rs780 depends on : */
  32. void rs600_mc_disable_clients(struct radeon_device *rdev);
  33. /* This files gather functions specifics to:
  34. * rs780
  35. *
  36. * Some of these functions might be used by newer ASICs.
  37. */
  38. int rs780_mc_wait_for_idle(struct radeon_device *rdev);
  39. void rs780_gpu_init(struct radeon_device *rdev);
  40. /*
  41. * MC
  42. */
  43. int rs780_mc_init(struct radeon_device *rdev)
  44. {
  45. rs780_gpu_init(rdev);
  46. /* FIXME: implement */
  47. rs600_mc_disable_clients(rdev);
  48. if (rs780_mc_wait_for_idle(rdev)) {
  49. printk(KERN_WARNING "Failed to wait MC idle while "
  50. "programming pipes. Bad things might happen.\n");
  51. }
  52. return 0;
  53. }
  54. void rs780_mc_fini(struct radeon_device *rdev)
  55. {
  56. /* FIXME: implement */
  57. }
  58. /*
  59. * Global GPU functions
  60. */
  61. void rs780_errata(struct radeon_device *rdev)
  62. {
  63. rdev->pll_errata = 0;
  64. }
  65. int rs780_mc_wait_for_idle(struct radeon_device *rdev)
  66. {
  67. /* FIXME: implement */
  68. return 0;
  69. }
  70. void rs780_gpu_init(struct radeon_device *rdev)
  71. {
  72. /* FIXME: implement */
  73. }
  74. /*
  75. * VRAM info
  76. */
  77. void rs780_vram_get_type(struct radeon_device *rdev)
  78. {
  79. /* FIXME: implement */
  80. }
  81. void rs780_vram_info(struct radeon_device *rdev)
  82. {
  83. rs780_vram_get_type(rdev);
  84. /* FIXME: implement */
  85. /* Could aper size report 0 ? */
  86. rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
  87. rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
  88. }