armada_drm.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (C) 2012 Russell King
  3. * With inspiration from the i915 driver
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. */
  9. #ifndef DRM_ARMADA_IOCTL_H
  10. #define DRM_ARMADA_IOCTL_H
  11. #include "drm.h"
  12. #if defined(__cplusplus)
  13. extern "C" {
  14. #endif
  15. #define DRM_ARMADA_GEM_CREATE 0x00
  16. #define DRM_ARMADA_GEM_MMAP 0x02
  17. #define DRM_ARMADA_GEM_PWRITE 0x03
  18. #define ARMADA_IOCTL(dir, name, str) \
  19. DRM_##dir(DRM_COMMAND_BASE + DRM_ARMADA_##name, struct drm_armada_##str)
  20. struct drm_armada_gem_create {
  21. uint32_t handle;
  22. uint32_t size;
  23. };
  24. #define DRM_IOCTL_ARMADA_GEM_CREATE \
  25. ARMADA_IOCTL(IOWR, GEM_CREATE, gem_create)
  26. struct drm_armada_gem_mmap {
  27. uint32_t handle;
  28. uint32_t pad;
  29. uint64_t offset;
  30. uint64_t size;
  31. uint64_t addr;
  32. };
  33. #define DRM_IOCTL_ARMADA_GEM_MMAP \
  34. ARMADA_IOCTL(IOWR, GEM_MMAP, gem_mmap)
  35. struct drm_armada_gem_pwrite {
  36. uint64_t ptr;
  37. uint32_t handle;
  38. uint32_t offset;
  39. uint32_t size;
  40. };
  41. #define DRM_IOCTL_ARMADA_GEM_PWRITE \
  42. ARMADA_IOCTL(IOW, GEM_PWRITE, gem_pwrite)
  43. #if defined(__cplusplus)
  44. }
  45. #endif
  46. #endif