armada_drm.h 1.2 KB

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