armada_drm.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #define DRM_ARMADA_GEM_CREATE 0x00
  12. #define DRM_ARMADA_GEM_MMAP 0x02
  13. #define DRM_ARMADA_GEM_PWRITE 0x03
  14. #define ARMADA_IOCTL(dir, name, str) \
  15. DRM_##dir(DRM_COMMAND_BASE + DRM_ARMADA_##name, struct drm_armada_##str)
  16. struct drm_armada_gem_create {
  17. uint32_t handle;
  18. uint32_t size;
  19. };
  20. #define DRM_IOCTL_ARMADA_GEM_CREATE \
  21. ARMADA_IOCTL(IOWR, GEM_CREATE, gem_create)
  22. struct drm_armada_gem_mmap {
  23. uint32_t handle;
  24. uint32_t pad;
  25. uint64_t offset;
  26. uint64_t size;
  27. uint64_t addr;
  28. };
  29. #define DRM_IOCTL_ARMADA_GEM_MMAP \
  30. ARMADA_IOCTL(IOWR, GEM_MMAP, gem_mmap)
  31. struct drm_armada_gem_pwrite {
  32. uint64_t ptr;
  33. uint32_t handle;
  34. uint32_t offset;
  35. uint32_t size;
  36. };
  37. #define DRM_IOCTL_ARMADA_GEM_PWRITE \
  38. ARMADA_IOCTL(IOW, GEM_PWRITE, gem_pwrite)
  39. #endif