cam_jpeg.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
  2. /*
  3. * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __UAPI_CAM_JPEG_H__
  6. #define __UAPI_CAM_JPEG_H__
  7. #include <media/cam_defs.h>
  8. /* enc, dma, cdm(enc/dma) are used in querycap */
  9. #define CAM_JPEG_DEV_TYPE_ENC 0
  10. #define CAM_JPEG_DEV_TYPE_DMA 1
  11. #define CAM_JPEG_DEV_TYPE_MAX 2
  12. #define CAM_JPEG_NUM_DEV_PER_RES_MAX 1
  13. /* definitions needed for jpeg aquire device */
  14. #define CAM_JPEG_RES_TYPE_ENC 0
  15. #define CAM_JPEG_RES_TYPE_DMA 1
  16. #define CAM_JPEG_RES_TYPE_MAX 2
  17. /* packet opcode types */
  18. #define CAM_JPEG_OPCODE_ENC_UPDATE 0
  19. #define CAM_JPEG_OPCODE_DMA_UPDATE 1
  20. /* ENC input port resource type */
  21. #define CAM_JPEG_ENC_INPUT_IMAGE 0x0
  22. /* ENC output port resource type */
  23. #define CAM_JPEG_ENC_OUTPUT_IMAGE 0x1
  24. #define CAM_JPEG_ENC_IO_IMAGES_MAX 0x2
  25. /* DMA input port resource type */
  26. #define CAM_JPEG_DMA_INPUT_IMAGE 0x0
  27. /* DMA output port resource type */
  28. #define CAM_JPEG_DMA_OUTPUT_IMAGE 0x1
  29. #define CAM_JPEG_DMA_IO_IMAGES_MAX 0x2
  30. #define CAM_JPEG_IMAGE_MAX 0x2
  31. /**
  32. * struct cam_jpeg_dev_ver - Device information for particular hw type
  33. *
  34. * This is used to get device version info of JPEG ENC, JPEG DMA
  35. * from hardware and use this info in CAM_QUERY_CAP IOCTL
  36. *
  37. * @size : Size of struct passed
  38. * @dev_type: Hardware type for the cap info(jpeg enc, jpeg dma)
  39. * @hw_ver: Major, minor and incr values of a device version
  40. */
  41. struct cam_jpeg_dev_ver {
  42. __u32 size;
  43. __u32 dev_type;
  44. struct cam_hw_version hw_ver;
  45. };
  46. /**
  47. * struct cam_jpeg_query_cap_cmd - JPEG query device capability payload
  48. *
  49. * @dev_iommu_handle: Jpeg iommu handles for secure/non secure
  50. * modes
  51. * @cdm_iommu_handle: Iommu handles for secure/non secure modes
  52. * @num_enc: Number of encoder
  53. * @num_dma: Number of dma
  54. * @dev_ver: Returned device capability array
  55. */
  56. struct cam_jpeg_query_cap_cmd {
  57. struct cam_iommu_handle dev_iommu_handle;
  58. struct cam_iommu_handle cdm_iommu_handle;
  59. __u32 num_enc;
  60. __u32 num_dma;
  61. struct cam_jpeg_dev_ver dev_ver[CAM_JPEG_DEV_TYPE_MAX];
  62. };
  63. /**
  64. * struct cam_jpeg_res_info - JPEG output resource info
  65. *
  66. * @format: Format of the resource
  67. * @width: Width in pixels
  68. * @height: Height in lines
  69. * @fps: Fps
  70. */
  71. struct cam_jpeg_res_info {
  72. __u32 format;
  73. __u32 width;
  74. __u32 height;
  75. __u32 fps;
  76. };
  77. /**
  78. * struct cam_jpeg_acquire_dev_info - An JPEG device info
  79. *
  80. * @dev_type: Device type (ENC/DMA)
  81. * @reserved: Reserved Bytes
  82. * @in_res: In resource info
  83. * @in_res: Iut resource info
  84. */
  85. struct cam_jpeg_acquire_dev_info {
  86. __u32 dev_type;
  87. __u32 reserved;
  88. struct cam_jpeg_res_info in_res;
  89. struct cam_jpeg_res_info out_res;
  90. };
  91. /**
  92. * struct cam_jpeg_config_inout_param_info - JPEG Config time
  93. * input output params
  94. *
  95. * @clk_index: Input Param- clock selection index.(-1 default)
  96. * @output_size: Output Param - jpeg encode/dma output size in
  97. * bytes
  98. */
  99. struct cam_jpeg_config_inout_param_info {
  100. __s32 clk_index;
  101. __s32 output_size;
  102. };
  103. #endif /* __UAPI_CAM_JPEG_H__ */