Skip to content

Instantly share code, notes, and snippets.

@devarsht
Created June 7, 2024 08:57
Show Gist options
  • Save devarsht/0bd2e90b7352ed4831252a7962fff65d to your computer and use it in GitHub Desktop.
Save devarsht/0bd2e90b7352ed4831252a7962fff65d to your computer and use it in GitHub Desktop.
v13_rangediff.txt
1: ee3aa2f8cca5 < -: ------------ kunit/fortify: Fix memcmp() test to be amplitude agnostic
2: 95c55c62bae7 < -: ------------ Add linux-next specific files for 20240523
3: 63cf8110893d ! 1: 0a3b9b6c590b media: dt-bindings: Add Imagination E5010 JPEG Encoder
@@ Commit message
Minimum resolution supported is 64x64 and Maximum resolution supported is
8192x8192.
- [1]: AM62A TRM (Section 7.6 is for JPEG Encoder)
- Link: https://www.ti.com/lit/pdf/spruj16
-
+ Link: https://www.ti.com/lit/pdf/spruj16 [1] (Section 7.6 JPEG Encoder)
Co-developed-by: David Huang <d-huang@ti.com>
Signed-off-by: David Huang <d-huang@ti.com>
Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Rob Herring <robh@kernel.org>
## Documentation/devicetree/bindings/media/img,e5010-jpeg-enc.yaml (new) ##
@@
4: 6ee43ea57ef8 ! 2: 6160f47f700d media: imagination: Add E5010 JPEG Encoder driver
@@ Commit message
Signed-off-by: David Huang <d-huang@ti.com>
Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
## MAINTAINERS ##
@@ MAINTAINERS: F: drivers/auxdisplay/img-ascii-lcd.c
@@ drivers/media/platform/imagination/e5010-jpeg-enc.c (new)
+static void e5010_stop_streaming(struct vb2_queue *q)
+{
+ struct e5010_context *ctx = vb2_get_drv_priv(q);
-+ struct e5010_q_data *queue;
-+
-+ queue = get_queue(ctx, q->type);
+
+ e5010_vb2_buffers_return(q, VB2_BUF_STATE_ERROR);
+
5: 54bf8c4913bb ! 3: 10f9078ca9e8 media: v4l2-jpeg: Export reference quantization and huffman tables
@@ Commit message
file.
Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
- ---
- V11: No change
- V10: Add description for new macros introduced in this patchset
- V1->V9: No change (Patch introduced in V7)
## drivers/media/v4l2-core/v4l2-jpeg.c ##
@@
@@ drivers/media/v4l2-core/v4l2-jpeg.c: MODULE_LICENSE("GPL");
+/* Luma and chroma qp tables to achieve 50% compression quality
+ * This is as per example in Annex K.1 of ITU-T.81
+ */
-+const u8 luma_qt[] = {
++static const u8 luma_qt[] = {
+ 16, 11, 10, 16, 24, 40, 51, 61,
+ 12, 12, 14, 19, 26, 58, 60, 55,
+ 14, 13, 16, 24, 40, 57, 69, 56,
@@ drivers/media/v4l2-core/v4l2-jpeg.c: MODULE_LICENSE("GPL");
+ 72, 92, 95, 98, 112, 100, 103, 99
+};
+
-+const u8 chroma_qt[] = {
++static const u8 chroma_qt[] = {
+ 17, 18, 24, 47, 99, 99, 99, 99,
+ 18, 21, 26, 66, 99, 99, 99, 99,
+ 24, 26, 56, 99, 99, 99, 99, 99,
@@ drivers/media/v4l2-core/v4l2-jpeg.c: MODULE_LICENSE("GPL");
+};
+
+/* Zigzag scan pattern */
-+const u8 zigzag[] = {
++static const u8 zigzag[] = {
+ 0, 1, 8, 16, 9, 2, 3, 10,
+ 17, 24, 32, 25, 18, 11, 4, 5,
+ 12, 19, 26, 33, 40, 48, 41, 34,
@@ drivers/media/v4l2-core/v4l2-jpeg.c: MODULE_LICENSE("GPL");
+ * data stream. Specifies the huffman table used for encoding the luminance DC
+ * coefficient differences. The table represents Table K.3 of ITU-T.81
+ */
-+const u8 luma_dc_ht[] = {
++static const u8 luma_dc_ht[] = {
+ 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B
@@ drivers/media/v4l2-core/v4l2-jpeg.c: MODULE_LICENSE("GPL");
+ * data stream. Specifies the huffman table used for encoding the luminance AC
+ * coefficients. The table represents Table K.5 of ITU-T.81
+ */
-+const u8 luma_ac_ht[] = {
++static const u8 luma_ac_ht[] = {
+ 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04,
+ 0x00, 0x00, 0x01, 0x7D, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
+ 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32,
@@ drivers/media/v4l2-core/v4l2-jpeg.c: MODULE_LICENSE("GPL");
+ * Specifies the huffman table used for encoding the chrominance DC coefficient differences.
+ * The table represents Table K.4 of ITU-T.81
+ */
-+const u8 chroma_dc_ht[] = {
++static const u8 chroma_dc_ht[] = {
+ 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B
@@ drivers/media/v4l2-core/v4l2-jpeg.c: MODULE_LICENSE("GPL");
+ * data stream. Specifies the huffman table used for encoding the chrominance
+ * AC coefficients. The table represents Table K.6 of ITU-T.81
+ */
-+const u8 chroma_ac_ht[] = {
++static const u8 chroma_ac_ht[] = {
+ 0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05, 0x04, 0x04,
+ 0x00, 0x01, 0x02, 0x77, 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
+ 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81,
@@ drivers/media/v4l2-core/v4l2-jpeg.c: int v4l2_jpeg_parse_huffman_tables(void *bu
+/**
+ * v4l2_jpeg_get_reference_quantization_tables - Get reference quantization
+ * tables as defined in ITU-T.81
-+ * @*ref_luma_qt: Output variable pointing to luma quantization table
-+ * @*ref_chroma_qt: Output variable pointint to chroma quantization table
++ * @ref_luma_qt: Output variable pointing to luma quantization table
++ * @ref_chroma_qt: Output variable pointing to chroma quantization table
+ */
+void v4l2_jpeg_get_reference_quantization_tables(const u8 **ref_luma_qt, const
+ u8 **ref_chroma_qt)
@@ drivers/media/v4l2-core/v4l2-jpeg.c: int v4l2_jpeg_parse_huffman_tables(void *bu
+
+/**
+ * v4l2_jpeg_get_zig_zag_scan - Get zigzag scan table as defined in ITU-T.81
-+ * @*ref_zigzag: Output variable pointing to zigzag scan table
++ * @ref_zigzag: Output variable pointing to zigzag scan table
+ */
+void v4l2_jpeg_get_zig_zag_scan(const u8 **ref_zigzag)
+{
@@ drivers/media/v4l2-core/v4l2-jpeg.c: int v4l2_jpeg_parse_huffman_tables(void *bu
+/**
+ * v4l2_jpeg_get_reference_huffman_tables - Get reference huffman tables as
+ * defined in ITU-T.81
-+ * @*ref_luma_dc_ht : Output variable pointing to huffman table for luma DC
-+ * @*ref_luma_ac_ht : Output variable pointing to huffman table for luma AC
-+ * @*ref_chroma_dc_ht : Output variable pointing to huffman table for chroma DC
-+ * @*ref_chroma_ac_ht : Output variable pointing to huffman table for chroma AC
++ * @ref_luma_dc_ht : Output variable pointing to huffman table for luma DC
++ * @ref_luma_ac_ht : Output variable pointing to huffman table for luma AC
++ * @ref_chroma_dc_ht : Output variable pointing to huffman table for chroma DC
++ * @ref_chroma_ac_ht : Output variable pointing to huffman table for chroma AC
+ */
+void v4l2_jpeg_get_reference_huffman_tables(const u8 **ref_luma_dc_ht,
+ const u8 **ref_luma_ac_ht,
-: ------------ > 4: 13afb89fd47c media: Documentation: Document v4l2-jpeg helper functions
6: 1b448a7433b2 ! 5: 95b27db54f39 media: imagination: Use exported tables from v4l2-jpeg core
@@ Commit message
Use exported huffman and quantization tables from v4l2-jpeg core library.
Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
+ ## drivers/media/platform/imagination/Kconfig ##
+@@ drivers/media/platform/imagination/Kconfig: config VIDEO_E5010_JPEG_ENC
+ select VIDEOBUF2_DMA_CONTIG
+ select VIDEOBUF2_VMALLOC
+ select V4L2_MEM2MEM_DEV
++ select V4L2_JPEG_HELPER
+ help
+ This is a video4linux2 M2M driver for Imagination E5010 JPEG encoder,
+ which supports JPEG and MJPEG baseline encoding of YUV422 and YUV420
## drivers/media/platform/imagination/e5010-jpeg-enc.c ##
@@
7: 2d9e710eedc9 ! 6: 0c966b0eb4f1 media: verisilicon : Use exported tables from v4l2-jpeg for hantro codec
@@ Commit message
Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Acked-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+
+ ## drivers/media/platform/verisilicon/Kconfig ##
+@@ drivers/media/platform/verisilicon/Kconfig: config VIDEO_HANTRO
+ select VIDEOBUF2_VMALLOC
+ select V4L2_MEM2MEM_DEV
+ select V4L2_H264
++ select V4L2_JPEG_HELPER
+ select V4L2_VP9
+ help
+ Support for the Hantro IP based Video Processing Units present on
## drivers/media/platform/verisilicon/hantro_jpeg.c ##
@@
8: 59cb1eb9e480 ! 7: 40f96fe44b30 math.h: Add macros for rounding to closest value
@@ Commit message
* roundclosest(17, 5) = 15
Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
- ---
- NOTE: This patch is inspired from the Mentor Graphics IPU driver [1]
- which uses similar macro locally and which is updated in further patch
- in the series to use this generic macro instead along with other drivers
- having similar requirements.
-
- [1]:
- https://elixir.bootlin.com/linux/v6.8.9/source/drivers/gpu/ipu-v3/ipu-image-convert.c#L480
+ Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
## include/linux/math.h ##
@@
-: ------------ > 8: b414e7e86af8 math.h: Use kernel-doc syntax for divison macros
9: 1d877e8f1549 ! 9: 7ed8c4276f29 Documentation: core-api: Add math.h macros and functions
@@ Metadata
## Commit message ##
Documentation: core-api: Add math.h macros and functions
- Add documentation for rounding, scaling, absolute value and difference,
- 32-bit division related macros and functions exported by math.h header
- file.
+ Add documentation for rounding, scaling, absolute value and 32-bit division
+ related macros and functions exported by math.h header file.
Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
- ---
+ Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
## Documentation/core-api/kernel-api.rst ##
@@ Documentation/core-api/kernel-api.rst: Division Functions
10: 5db25a1b8b99 ! 10: 34f8b7a4c6c5 lib: add basic KUnit test for lib/math
@@ Commit message
Signed-off-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: David Gow <davidgow@google.com>
+ Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
[devarsht: Rebase to 6.9, remove kernel.h, update Kconfig and change license to GPL]
Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
## lib/math/Kconfig ##
@@ lib/math/Kconfig: config PRIME_NUMBERS
11: 348609611395 ! 11: 9ea454c21a13 lib: math_kunit: Add tests for new macros related to rounding to nearest value
@@ Commit message
Add tests for round_closest_up/down and roundclosest macros which round
to nearest multiple of specified argument. These are tested with kunit
- tool as shared here [1].
-
- [1]: https://gist.github.com/devarsht/3f9042825be3da4e133b8f4eda067876
+ tool as shared here [1] :
+ Link: https://gist.github.com/devarsht/3f9042825be3da4e133b8f4eda067876 [1]
Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
- ---
+ Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
## lib/math/math_kunit.c ##
@@ lib/math/math_kunit.c: static void round_down_test(struct kunit *test)
12: 1ff191bb3cd7 ! 12: 283fced4567a media: imagination: Round to closest multiple for cropping region
@@ Commit message
crop/compose rectangle as close as possible to the requested
one."
- [1] :
- https://www.kernel.org/doc/Documentation/userspace-api/media/v4l/vidioc-g-selection.rst
-
+ Link: https://www.kernel.org/doc/Documentation/userspace-api/media/v4l/vidioc-g-selection.rst [1]
Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
- ---
## drivers/media/platform/imagination/e5010-jpeg-enc.c ##
@@ drivers/media/platform/imagination/e5010-jpeg-enc.c: static int e5010_s_selection(struct file *file, void *fh, struct v4l2_selection
13: 8310345b3e51 ! 13: 6b84ddbe621f gpu: ipu-v3: Use generic macro for rounding closest to specified value
@@ Commit message
is functionally same as the previously used local macro round_closest().
Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
- ---
## drivers/gpu/ipu-v3/ipu-image-convert.c ##
@@ drivers/gpu/ipu-v3/ipu-image-convert.c: static int calc_image_resize_coefficients(struct ipu_image_convert_ctx *ctx,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment