nova_drm.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* SPDX-License-Identifier: MIT */
  2. #ifndef __NOVA_DRM_H__
  3. #define __NOVA_DRM_H__
  4. #include "drm.h"
  5. /* DISCLAIMER: Do not use, this is not a stable uAPI.
  6. *
  7. * This uAPI serves only testing purposes as long as this driver is still in
  8. * development. It is required to implement and test infrastructure which is
  9. * upstreamed in the context of this driver. See also [1].
  10. *
  11. * [1] https://lore.kernel.org/dri-devel/Zfsj0_tb-0-tNrJy@cassiopeiae/T/#u
  12. */
  13. #if defined(__cplusplus)
  14. extern "C" {
  15. #endif
  16. /*
  17. * NOVA_GETPARAM_VRAM_BAR_SIZE
  18. *
  19. * Query the VRAM BAR size in bytes.
  20. */
  21. #define NOVA_GETPARAM_VRAM_BAR_SIZE 0x1
  22. /**
  23. * struct drm_nova_getparam - query GPU and driver metadata
  24. */
  25. struct drm_nova_getparam {
  26. /**
  27. * @param: The identifier of the parameter to query.
  28. */
  29. __u64 param;
  30. /**
  31. * @value: The value for the specified parameter.
  32. */
  33. __u64 value;
  34. };
  35. /**
  36. * struct drm_nova_gem_create - create a new DRM GEM object
  37. */
  38. struct drm_nova_gem_create {
  39. /**
  40. * @handle: The handle of the new DRM GEM object.
  41. */
  42. __u32 handle;
  43. /**
  44. * @pad: 32 bit padding, should be 0.
  45. */
  46. __u32 pad;
  47. /**
  48. * @size: The size of the new DRM GEM object.
  49. */
  50. __u64 size;
  51. };
  52. /**
  53. * struct drm_nova_gem_info - query DRM GEM object metadata
  54. */
  55. struct drm_nova_gem_info {
  56. /**
  57. * @handle: The handle of the DRM GEM object to query.
  58. */
  59. __u32 handle;
  60. /**
  61. * @pad: 32 bit padding, should be 0.
  62. */
  63. __u32 pad;
  64. /**
  65. * @size: The size of the DRM GEM obejct.
  66. */
  67. __u64 size;
  68. };
  69. #define DRM_NOVA_GETPARAM 0x00
  70. #define DRM_NOVA_GEM_CREATE 0x01
  71. #define DRM_NOVA_GEM_INFO 0x02
  72. /* Note: this is an enum so that it can be resolved by Rust bindgen. */
  73. enum {
  74. DRM_IOCTL_NOVA_GETPARAM = DRM_IOWR(DRM_COMMAND_BASE + DRM_NOVA_GETPARAM,
  75. struct drm_nova_getparam),
  76. DRM_IOCTL_NOVA_GEM_CREATE = DRM_IOWR(DRM_COMMAND_BASE + DRM_NOVA_GEM_CREATE,
  77. struct drm_nova_gem_create),
  78. DRM_IOCTL_NOVA_GEM_INFO = DRM_IOWR(DRM_COMMAND_BASE + DRM_NOVA_GEM_INFO,
  79. struct drm_nova_gem_info),
  80. };
  81. #if defined(__cplusplus)
  82. }
  83. #endif
  84. #endif /* __NOVA_DRM_H__ */