Skip to content

media: imx: Add Rec.709 and limited range encoding support

Steve Longerbeam dri-devel linux-arm-kernel linux-fbdev linux-media lkml stable 8 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest5 patches 8 repliesIn review
  2. v75 patches 1 replySuperseded
  3. v67 patches 7 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v57 patches0 repliesSuperseded
v44 patches12 repliesSuperseded
v34 patches2 repliesSuperseded
v24 patches0 repliesSuperseded
v13 patches3 repliesSuperseded

Changes in v8 from the cover letter

- removed the Fixes: and cc: stable in patch "Fully describe colorspace conversions". This patch is too difficult to backport to stable trees. No functional changes in this version.

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5gpu: ipu-v3: ipu-ic: Fix saturation bit offset in TPMEMdrivers/gpu/ipu-v3/ipu-ic.c+1 -10 replies
2/5gpu: ipu-v3: ipu-ic: Fully describe colorspace conversionsdrivers/gpu/ipu-v3/Makefile drivers/gpu/ipu-v3/ipu-ic-csc.c drivers/gpu/ipu-v3/ipu-ic.c +3 more+271 -1180 replies
3/5gpu: ipu-v3: ipu-ic-csc: Add support for limited range encodingdrivers/gpu/ipu-v3/ipu-ic-csc.c+166 -140 replies
4/5gpu: ipu-v3: ipu-ic-csc: Add support for Rec.709 encodingdrivers/gpu/ipu-v3/ipu-ic-csc.c+134 -50 replies
5/5media: imx: Try colorimetry at both sink and source padsdrivers/staging/media/imx/imx-ic-prp.c drivers/staging/media/imx/imx-ic-prpencvf.c drivers/staging/media/imx/imx-media-csi.c +4 more+62 -628 replies

Reviews trailers per patch

2 of 5 patches have a Reviewed-by or Acked-by.

PatchPhilipp ZabelHans Verkuil
1/5R-b
2/5
3/5
4/5
5/5A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v8 thread

Cover letter [PATCH v8 0/5] media: imx: Add Rec.709 and limited range encoding support

This patchset adds support for Rec.709 encoding and inverse encoding, and encoding between both full-range and limited-range quantization for both YUV and RGB, to ipu-ic. The imx-media driver can now support both BT.601 and Rec.709 encoding, and limited and full-range quantization.

History:
v8:
- removed the Fixes: and cc: stable in patch "Fully describe colorspace conversions". This patch is too difficult to backport to stable trees. No functional changes in this version.

v7:
- removed the run-time transformation of coefficients from full-range to limited-range, and instead hard-code all the coefficient tables.
- moved the coefficient tables into a new module ipu-ic-csc.c.
- introduced ipu_ic_calc_csc() which pre-determines coefficients, which are then passed to ipu_ic_task_init(_rsc)() as a filled 'struct ipu_ic_csc'.
- added support for limited-range RGB.

v6:
- tweak some of the coefficients slightly, they were not getting rounded correctly.
- move the introduction of calc_csc_coeffs() to an earlier patch for easier patch readability.

v5:
- the hard-coded encode coefficients now convert only between full-range quantization. A new function is added to transform the coefficients to limited-range at input or output.
- add a bug fix patch for saturation bit in TPMEM register.
- add a patch to fully describe input and output colorspace to the IC task init functions.
- add imx_media_try_colorimetry(), called at all sink/source pad try_fmt.

v4:
- fix a compile error in init_csc(), reported by Tim Harvey.

v3:
- fix some inconsistent From: and Signed-off-by:'s. No functional changes.

v2:
- rename ic_csc_rgb2rgb matrix to ic_csc_identity.
- only return "Unsupported YCbCr encoding" error if inf != outf, since if inf == outf, the identity matrix can be used. Reported by Tim Harvey.
- move ic_route check above default colorimetry checks, and fill default colorspace for ic_route, otherwise it's not possible to set BT.709 encoding for ic routes.

Steve Longerbeam (5):
gpu: ipu-v3: ipu-ic: Fix saturation bit offset in TPMEM
gpu: ipu-v3: ipu-ic: Fully describe colorspace conversions
gpu: ipu-v3: ipu-ic-csc: Add support for limited range encoding
gpu: ipu-v3: ipu-ic-csc: Add support for Rec.709 encoding
media: imx: Try colorimetry at both sink and source pads

 drivers/gpu/ipu-v3/Makefile                 |   4 +-
 drivers/gpu/ipu-v3/ipu-ic-csc.c             | 410 ++++++++++++++++++++
 drivers/gpu/ipu-v3/ipu-ic.c                 | 138 +++----
 drivers/gpu/ipu-v3/ipu-image-convert.c      |  28 +-
 drivers/staging/media/imx/imx-ic-prp.c      |   6 +-
 drivers/staging/media/imx/imx-ic-prpencvf.c |  42 +-
 drivers/staging/media/imx/imx-media-csi.c   |  19 +-
 drivers/staging/media/imx/imx-media-utils.c |  73 ++--
 drivers/staging/media/imx/imx-media-vdic.c  |   5 +-
 drivers/staging/media/imx/imx-media.h       |   5 +-
 drivers/staging/media/imx/imx7-media-csi.c  |   8 +-
 include/video/imx-ipu-v3.h                  |  56 ++-
 12 files changed, 614 insertions(+), 180 deletions(-)
 create mode 100644 drivers/gpu/ipu-v3/ipu-ic-csc.c
Signature · 1 line
2.17.1