]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Feb 2017 10:19:53 +0000 (11:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Feb 2017 10:19:53 +0000 (11:19 +0100)
added patches:
videodev2.h-go-back-to-limited-range-y-cbcr-for-srgb-and-adobergb.patch

queue-4.9/series
queue-4.9/videodev2.h-go-back-to-limited-range-y-cbcr-for-srgb-and-adobergb.patch [new file with mode: 0644]

index 8b2e43fcef2a1c2ef88a5578f2dd7fb14de02b6a..7155cd2a5b8a63c9112ee12dd65bacfe99a8a9fd 100644 (file)
@@ -19,3 +19,4 @@ ntb-ntb_transport-fix-debugfs_remove_recursive.patch
 ntb-ntb_perf-missing-dmaengine_unmap_put.patch
 ntb_transport-pick-an-unused-queue.patch
 bcache-make-gc-wakeup-sane-remove-set_task_state.patch
+videodev2.h-go-back-to-limited-range-y-cbcr-for-srgb-and-adobergb.patch
diff --git a/queue-4.9/videodev2.h-go-back-to-limited-range-y-cbcr-for-srgb-and-adobergb.patch b/queue-4.9/videodev2.h-go-back-to-limited-range-y-cbcr-for-srgb-and-adobergb.patch
new file mode 100644 (file)
index 0000000..fb63f14
--- /dev/null
@@ -0,0 +1,110 @@
+From 35879ee4769099905fa3bda0b21e73d434e2df6a Mon Sep 17 00:00:00 2001
+From: Hans Verkuil <hverkuil@xs4all.nl>
+Date: Fri, 10 Feb 2017 07:18:36 -0200
+Subject: [media] videodev2.h: go back to limited range Y'CbCr for SRGB and, ADOBERGB
+
+From: Hans Verkuil <hverkuil@xs4all.nl>
+
+commit 35879ee4769099905fa3bda0b21e73d434e2df6a upstream.
+
+This reverts 'commit 7e0739cd9c40 ("[media] videodev2.h: fix
+sYCC/AdobeYCC default quantization range").
+
+The problem is that many drivers can convert R'G'B' content (often
+from sensors) to Y'CbCr, but they all produce limited range Y'CbCr.
+
+To stay backwards compatible the default quantization range for
+sRGB and AdobeRGB Y'CbCr encoding should be limited range, not full
+range, even though the corresponding standards specify full range.
+
+Update the V4L2_MAP_QUANTIZATION_DEFAULT define accordingly and
+also update the documentation.
+
+Fixes: 7e0739cd9c40 ("[media] videodev2.h: fix sYCC/AdobeYCC default quantization range")
+Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+
+---
+ Documentation/media/uapi/v4l/pixfmt-007.rst |   23 +++++++++++++++++------
+ include/uapi/linux/videodev2.h              |    7 +++----
+ 2 files changed, 20 insertions(+), 10 deletions(-)
+
+--- a/Documentation/media/uapi/v4l/pixfmt-007.rst
++++ b/Documentation/media/uapi/v4l/pixfmt-007.rst
+@@ -211,7 +211,13 @@ Colorspace sRGB (V4L2_COLORSPACE_SRGB)
+ The :ref:`srgb` standard defines the colorspace used by most webcams
+ and computer graphics. The default transfer function is
+ ``V4L2_XFER_FUNC_SRGB``. The default Y'CbCr encoding is
+-``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is full range.
++``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited range.
++
++Note that the :ref:`sycc` standard specifies full range quantization,
++however all current capture hardware supported by the kernel convert
++R'G'B' to limited range Y'CbCr. So choosing full range as the default
++would break how applications interpret the quantization range.
++
+ The chromaticities of the primary colors and the white reference are:
+@@ -276,7 +282,7 @@ the following ``V4L2_YCBCR_ENC_601`` enc
+ Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
+ [-0.5…0.5]. This transform is identical to one defined in SMPTE
+-170M/BT.601. The Y'CbCr quantization is full range.
++170M/BT.601. The Y'CbCr quantization is limited range.
+ .. _col-adobergb:
+@@ -288,10 +294,15 @@ The :ref:`adobergb` standard defines the
+ graphics that use the AdobeRGB colorspace. This is also known as the
+ :ref:`oprgb` standard. The default transfer function is
+ ``V4L2_XFER_FUNC_ADOBERGB``. The default Y'CbCr encoding is
+-``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is full
+-range. The chromaticities of the primary colors and the white reference
+-are:
++``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited
++range.
++Note that the :ref:`oprgb` standard specifies full range quantization,
++however all current capture hardware supported by the kernel convert
++R'G'B' to limited range Y'CbCr. So choosing full range as the default
++would break how applications interpret the quantization range.
++
++The chromaticities of the primary colors and the white reference are:
+ .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+@@ -344,7 +355,7 @@ the following ``V4L2_YCBCR_ENC_601`` enc
+ Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
+ [-0.5…0.5]. This transform is identical to one defined in SMPTE
+-170M/BT.601. The Y'CbCr quantization is full range.
++170M/BT.601. The Y'CbCr quantization is limited range.
+ .. _col-bt2020:
+--- a/include/uapi/linux/videodev2.h
++++ b/include/uapi/linux/videodev2.h
+@@ -349,8 +349,8 @@ enum v4l2_quantization {
+       /*
+        * The default for R'G'B' quantization is always full range, except
+        * for the BT2020 colorspace. For Y'CbCr the quantization is always
+-       * limited range, except for COLORSPACE_JPEG, SRGB, ADOBERGB,
+-       * XV601 or XV709: those are full range.
++       * limited range, except for COLORSPACE_JPEG, XV601 or XV709: those
++       * are full range.
+        */
+       V4L2_QUANTIZATION_DEFAULT     = 0,
+       V4L2_QUANTIZATION_FULL_RANGE  = 1,
+@@ -365,8 +365,7 @@ enum v4l2_quantization {
+ #define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb, colsp, ycbcr_enc) \
+       (((is_rgb) && (colsp) == V4L2_COLORSPACE_BT2020) ? V4L2_QUANTIZATION_LIM_RANGE : \
+        (((is_rgb) || (ycbcr_enc) == V4L2_YCBCR_ENC_XV601 || \
+-        (ycbcr_enc) == V4L2_YCBCR_ENC_XV709 || (colsp) == V4L2_COLORSPACE_JPEG) || \
+-        (colsp) == V4L2_COLORSPACE_ADOBERGB || (colsp) == V4L2_COLORSPACE_SRGB ? \
++        (ycbcr_enc) == V4L2_YCBCR_ENC_XV709 || (colsp) == V4L2_COLORSPACE_JPEG) ? \
+        V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE))
+ enum v4l2_priority {