armada_drm.h 1.1 KB

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