npcm-video.rst 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. .. SPDX-License-Identifier: GPL-2.0
  2. .. include:: <isonum.txt>
  3. NPCM video driver
  4. =================
  5. This driver is used to control the Video Capture/Differentiation (VCD) engine
  6. and Encoding Compression Engine (ECE) present on Nuvoton NPCM SoCs. The VCD can
  7. capture a frame from digital video input and compare two frames in memory, and
  8. the ECE can compress the frame data into HEXTILE format.
  9. Driver-specific Controls
  10. ------------------------
  11. V4L2_CID_NPCM_CAPTURE_MODE
  12. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  13. The VCD engine supports two modes:
  14. - COMPLETE mode:
  15. Capture the next complete frame into memory.
  16. - DIFF mode:
  17. Compare the incoming frame with the frame stored in memory, and updates the
  18. differentiated frame in memory.
  19. Application can use ``V4L2_CID_NPCM_CAPTURE_MODE`` control to set the VCD mode
  20. with different control values (enum v4l2_npcm_capture_mode):
  21. - ``V4L2_NPCM_CAPTURE_MODE_COMPLETE``: will set VCD to COMPLETE mode.
  22. - ``V4L2_NPCM_CAPTURE_MODE_DIFF``: will set VCD to DIFF mode.
  23. V4L2_CID_NPCM_RECT_COUNT
  24. ~~~~~~~~~~~~~~~~~~~~~~~~
  25. If using V4L2_PIX_FMT_HEXTILE format, VCD will capture frame data and then ECE
  26. will compress the data into HEXTILE rectangles and store them in V4L2 video
  27. buffer with the layout defined in Remote Framebuffer Protocol:
  28. ::
  29. (RFC 6143, https://www.rfc-editor.org/rfc/rfc6143.html#section-7.6.1)
  30. +--------------+--------------+-------------------+
  31. | No. of bytes | Type [Value] | Description |
  32. +--------------+--------------+-------------------+
  33. | 2 | U16 | x-position |
  34. | 2 | U16 | y-position |
  35. | 2 | U16 | width |
  36. | 2 | U16 | height |
  37. | 4 | S32 | encoding-type (5) |
  38. +--------------+--------------+-------------------+
  39. | HEXTILE rectangle data |
  40. +-------------------------------------------------+
  41. Application can get the video buffer through VIDIOC_DQBUF, and followed by
  42. calling ``V4L2_CID_NPCM_RECT_COUNT`` control to get the number of HEXTILE
  43. rectangles in this buffer.
  44. References
  45. ----------
  46. include/uapi/linux/npcm-video.h
  47. **Copyright** |copy| 2022 Nuvoton Technologies