z180.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* Copyright (c) 2008-2013, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. */
  13. #ifndef __Z180_H
  14. #define __Z180_H
  15. #include "kgsl_device.h"
  16. #define DEVICE_2D_NAME "kgsl-2d"
  17. #define DEVICE_2D0_NAME "kgsl-2d0"
  18. #define DEVICE_2D1_NAME "kgsl-2d1"
  19. #define Z180_PACKET_SIZE 15
  20. #define Z180_PACKET_COUNT 8
  21. #define Z180_RB_SIZE (Z180_PACKET_SIZE*Z180_PACKET_COUNT \
  22. *sizeof(uint32_t))
  23. #define Z180_DEVICE(device) \
  24. KGSL_CONTAINER_OF(device, struct z180_device, dev)
  25. /* Wait a maximum of 10 seconds when trying to idle the core */
  26. #define Z180_IDLE_TIMEOUT (20 * 1000)
  27. struct z180_ringbuffer {
  28. unsigned int prevctx;
  29. struct kgsl_memdesc cmdbufdesc;
  30. };
  31. struct z180_device {
  32. struct kgsl_device dev; /* Must be first field in this struct */
  33. int current_timestamp;
  34. int timestamp;
  35. struct z180_ringbuffer ringbuffer;
  36. spinlock_t cmdwin_lock;
  37. };
  38. int z180_dump(struct kgsl_device *, int);
  39. int z180_idle(struct kgsl_device *);
  40. #endif /* __Z180_H */