media: rp1: cfe: Improve link validation for metadata
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tue, 3 Oct 2023 11:29:44 +0000 (14:29 +0300)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:35:22 +0000 (11:35 +0000)
commitc913cedb669b421bf6a084a5cc2f692e4942f771
treefa568b116277869b8693684621f861a4001de7dd
parentf6bdbc95d20dcf1fe47e9eb5949a6485d937194e
media: rp1: cfe: Improve link validation for metadata

Improve the link validation for metadata by:
- Allowing capture buffers that are larger than the incoming frame
  (instead of requiring exact match).

- Instead of assuming that a metadata unit ("pixel") is 8 bits, use
  find_format_by_code() to get the format and use the bit depth from
  there. E.g. bit depth for RAW10 metadata will be 10 bits, when we
  move to the upstream metadata formats.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
drivers/media/platform/raspberrypi/rp1_cfe/cfe.c