metafmt-c3-isp.rst 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. .. SPDX-License-Identifier: (GPL-2.0-only OR MIT)
  2. .. c:namespace:: V4L
  3. .. _v4l2-meta-fmt-c3isp-stats:
  4. .. _v4l2-meta-fmt-c3isp-params:
  5. ***********************************************************************
  6. V4L2_META_FMT_C3ISP_STATS ('C3ST'), V4L2_META_FMT_C3ISP_PARAMS ('C3PM')
  7. ***********************************************************************
  8. .. c3_isp_stats_info
  9. 3A Statistics
  10. =============
  11. The C3 ISP can collect different statistics over an input Bayer frame.
  12. Those statistics are obtained from the "c3-isp-stats" metadata capture video nodes,
  13. using the :c:type:`v4l2_meta_format` interface.
  14. They are formatted as described by the :c:type:`c3_isp_stats_info` structure.
  15. The statistics collected are Auto-white balance,
  16. Auto-exposure and Auto-focus information.
  17. .. c3_isp_params_cfg
  18. Configuration Parameters
  19. ========================
  20. The configuration parameters are passed to the c3-isp-params metadata output video node,
  21. using the :c:type:`v4l2_meta_format` interface. Rather than a single struct containing
  22. sub-structs for each configurable area of the ISP, parameters for the C3-ISP
  23. are defined as distinct structs or "blocks" which may be added to the data
  24. member of :c:type:`c3_isp_params_cfg`. Userspace is responsible for
  25. populating the data member with the blocks that need to be configured by the driver, but
  26. need not populate it with **all** the blocks, or indeed with any at all if there
  27. are no configuration changes to make. Populated blocks **must** be consecutive
  28. in the buffer. To assist both userspace and the driver in identifying the
  29. blocks each block-specific struct embeds
  30. :c:type:`c3_isp_params_block_header` as its first member and userspace
  31. must populate the type member with a value from
  32. :c:type:`c3_isp_params_block_type`. Once the blocks have been populated
  33. into the data buffer, the combined size of all populated blocks shall be set in
  34. the data_size member of :c:type:`c3_isp_params_cfg`. For example:
  35. .. code-block:: c
  36. struct c3_isp_params_cfg *params =
  37. (struct c3_isp_params_cfg *)buffer;
  38. params->version = C3_ISP_PARAM_BUFFER_V0;
  39. params->data_size = 0;
  40. void *data = (void *)params->data;
  41. struct c3_isp_params_awb_gains *gains =
  42. (struct c3_isp_params_awb_gains *)data;
  43. gains->header.type = C3_ISP_PARAMS_BLOCK_AWB_GAINS;
  44. gains->header.flags = C3_ISP_PARAMS_BLOCK_FL_ENABLE;
  45. gains->header.size = sizeof(struct c3_isp_params_awb_gains);
  46. gains->gr_gain = 256;
  47. gains->r_gain = 256;
  48. gains->b_gain = 256;
  49. gains->gb_gain = 256;
  50. data += sizeof(struct c3_isp__params_awb_gains);
  51. params->data_size += sizeof(struct c3_isp_params_awb_gains);
  52. struct c3_isp_params_awb_config *awb_cfg =
  53. (struct c3_isp_params_awb_config *)data;
  54. awb_cfg->header.type = C3_ISP_PARAMS_BLOCK_AWB_CONFIG;
  55. awb_cfg->header.flags = C3_ISP_PARAMS_BLOCK_FL_ENABLE;
  56. awb_cfg->header.size = sizeof(struct c3_isp_params_awb_config);
  57. awb_cfg->tap_point = C3_ISP_AWB_STATS_TAP_BEFORE_WB;
  58. awb_cfg->satur = 1;
  59. awb_cfg->horiz_zones_num = 32;
  60. awb_cfg->vert_zones_num = 24;
  61. params->data_size += sizeof(struct c3_isp_params_awb_config);
  62. Amlogic C3 ISP uAPI data types
  63. ===============================
  64. .. kernel-doc:: include/uapi/linux/media/amlogic/c3-isp-config.h