eva_shared_def.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /**
  2. * SPDX-License-Identifier: GPL-2.0-only
  3. *
  4. * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
  5. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  6. */
  7. /**
  8. * This file contains definitions that are common to UMD and KMD
  9. * but shall not be added to the UAPI to allow for better UAPI
  10. * backward compatibility. Identical copies of this file must be
  11. * used by both UMD and KMD for desired functioning.
  12. */
  13. #ifndef _EVA_SHARED_DEF_H_
  14. #define _EVA_SHARED_DEF_H_
  15. /**
  16. * Structure corresponding to HFI_CVP_BUFFER_TYPE
  17. */
  18. struct cvp_buf_type {
  19. __s32 fd;
  20. __u32 size;
  21. __u32 offset;
  22. __u32 flags;
  23. __u32 reserved1;
  24. __u32 reserved2;
  25. __u32 fence_type;
  26. __u32 input_handle;
  27. __u32 output_handle;
  28. __u32 debug_flags;
  29. __u32 crc;
  30. };
  31. /**
  32. * Structures and macros for Warp-NCC Out-of-Band (OOB) buffer
  33. */
  34. #define EVA_KMD_WNCC_MAX_LAYERS 4
  35. #define EVA_KMD_WNCC_MAX_ADDRESSES 4095
  36. #define EVA_KMD_WNCC_MAX_SRC_BUFS 2400
  37. #define EVA_KMD_WNCC_SRC_BUF_ID_OFFSET 1
  38. struct eva_kmd_wncc_metadata {
  39. __u64 loc_x_dec : 12;
  40. __u64 loc_x_frac : 9;
  41. __u64 loc_y_dec : 12;
  42. __u64 loc_y_frac : 9;
  43. __u64 iova_lsb : 22; /* Populated in KMD */
  44. __u64 iova_msb : 10; /* Populated in KMD */
  45. __u64 scale_idx : 2;
  46. __s64 aff_coeff_3 : 13;
  47. __s64 aff_coeff_2 : 13;
  48. __s64 aff_coeff_1 : 13;
  49. __s64 aff_coeff_0 : 13;
  50. };
  51. struct eva_kmd_oob_wncc {
  52. __u32 metadata_bufs_offset;
  53. __u32 num_layers;
  54. struct eva_kmd_wncc_layer {
  55. __u32 num_addrs;
  56. struct eva_kmd_wncc_addr {
  57. __u32 buffer_id;
  58. __u32 offset;
  59. } addrs[EVA_KMD_WNCC_MAX_ADDRESSES];
  60. } layers[EVA_KMD_WNCC_MAX_LAYERS];
  61. };
  62. /**
  63. * Structure and macros for Out-of-Band (OOB) buffer
  64. * that may accompany HFI packet data
  65. */
  66. #define EVA_KMD_OOB_INVALID 0
  67. #define EVA_KMD_OOB_WNCC 1
  68. struct eva_kmd_oob_buf {
  69. __u32 oob_type;
  70. union {
  71. struct eva_kmd_oob_wncc wncc;
  72. };
  73. };
  74. #endif