diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-21 13:01:27 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-21 13:01:27 -0400 |
| commit | 0c8027d50c070859314a88aaff42453ff4f71819 (patch) | |
| tree | 440ecaefad24571853796df50eb2f238052dd3f2 /include | |
| parent | 1fc149933fd49a5b0e7738dc0853dbfbac4ae0e1 (diff) | |
| parent | 64131a87f2aae2ed9e05d8227c5b009ca6c50d98 (diff) | |
Merge tag 'media/v4.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab:
- a new frontend driver for new ATSC devices: lgdt3306a
- a new sensor driver: ov2659
- a new platform driver: xilinx
- the m88ts2022 tuner driver was merged at ts2020 driver
- the media controller gained experimental support for DVB and hybrid
devices
- lots of random cleanups, fixes and improvements on media drivers
* tag 'media/v4.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (404 commits)
[media] uvcvideo: add support for VIDIOC_QUERY_EXT_CTRL
[media] uvcvideo: fix cropcap v4l2-compliance failure
[media] media: omap3isp: remove unused clkdev
[media] coda: Add tracing support
[media] coda: drop dma_sync_single_for_device in coda_bitstream_queue
[media] coda: fix fill bitstream errors in nonstreaming case
[media] coda: call SEQ_END when the first queue is stopped
[media] coda: fail to start streaming if userspace set invalid formats
[media] coda: remove duplicate error messages for buffer allocations
[media] coda: move parameter buffer in together with context buffer allocation
[media] coda: allocate bitstream buffer from REQBUFS, size depends on the format
[media] coda: allocate per-context buffers from REQBUFS
[media] coda: use strlcpy instead of snprintf
[media] coda: bitstream payload is unsigned
[media] coda: fix double call to debugfs_remove
[media] coda: check kasprintf return value in coda_open
[media] coda: bitrate can only be set in kbps steps
[media] v4l2-mem2mem: no need to initialize b in v4l2_m2m_next_buf and v4l2_m2m_buf_remove
[media] s5p-mfc: set allow_zero_bytesused flag for vb2_queue_init
[media] coda: set allow_zero_bytesused flag for vb2_queue_init
...
Diffstat (limited to 'include')
25 files changed, 526 insertions, 212 deletions
diff --git a/include/dt-bindings/media/xilinx-vip.h b/include/dt-bindings/media/xilinx-vip.h new file mode 100644 index 000000000000..6298fec00685 --- /dev/null +++ b/include/dt-bindings/media/xilinx-vip.h | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | /* | ||
| 2 | * Xilinx Video IP Core | ||
| 3 | * | ||
| 4 | * Copyright (C) 2013-2015 Ideas on Board | ||
| 5 | * Copyright (C) 2013-2015 Xilinx, Inc. | ||
| 6 | * | ||
| 7 | * Contacts: Hyun Kwon <hyun.kwon@xilinx.com> | ||
| 8 | * Laurent Pinchart <laurent.pinchart@ideasonboard.com> | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License version 2 as | ||
| 12 | * published by the Free Software Foundation. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __DT_BINDINGS_MEDIA_XILINX_VIP_H__ | ||
| 16 | #define __DT_BINDINGS_MEDIA_XILINX_VIP_H__ | ||
| 17 | |||
| 18 | /* | ||
| 19 | * Video format codes as defined in "AXI4-Stream Video IP and System Design | ||
| 20 | * Guide". | ||
| 21 | */ | ||
| 22 | #define XVIP_VF_YUV_422 0 | ||
| 23 | #define XVIP_VF_YUV_444 1 | ||
| 24 | #define XVIP_VF_RBG 2 | ||
| 25 | #define XVIP_VF_YUV_420 3 | ||
| 26 | #define XVIP_VF_YUVA_422 4 | ||
| 27 | #define XVIP_VF_YUVA_444 5 | ||
| 28 | #define XVIP_VF_RGBA 6 | ||
| 29 | #define XVIP_VF_YUVA_420 7 | ||
| 30 | #define XVIP_VF_YUVD_422 8 | ||
| 31 | #define XVIP_VF_YUVD_444 9 | ||
| 32 | #define XVIP_VF_RGBD 10 | ||
| 33 | #define XVIP_VF_YUVD_420 11 | ||
| 34 | #define XVIP_VF_MONO_SENSOR 12 | ||
| 35 | #define XVIP_VF_CUSTOM2 13 | ||
| 36 | #define XVIP_VF_CUSTOM3 14 | ||
| 37 | #define XVIP_VF_CUSTOM4 15 | ||
| 38 | |||
| 39 | #endif /* __DT_BINDINGS_MEDIA_XILINX_VIP_H__ */ | ||
diff --git a/include/linux/fixp-arith.h b/include/linux/fixp-arith.h index 3089d7382325..d4686fe1cac7 100644 --- a/include/linux/fixp-arith.h +++ b/include/linux/fixp-arith.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef _FIXP_ARITH_H | 1 | #ifndef _FIXP_ARITH_H |
| 2 | #define _FIXP_ARITH_H | 2 | #define _FIXP_ARITH_H |
| 3 | 3 | ||
| 4 | #include <linux/math64.h> | ||
| 5 | |||
| 4 | /* | 6 | /* |
| 5 | * Simplistic fixed-point arithmetics. | 7 | * Simplistic fixed-point arithmetics. |
| 6 | * Hmm, I'm probably duplicating some code :( | 8 | * Hmm, I'm probably duplicating some code :( |
| @@ -29,59 +31,126 @@ | |||
| 29 | 31 | ||
| 30 | #include <linux/types.h> | 32 | #include <linux/types.h> |
| 31 | 33 | ||
| 32 | /* The type representing fixed-point values */ | 34 | static const s32 sin_table[] = { |
| 33 | typedef s16 fixp_t; | 35 | 0x00000000, 0x023be165, 0x04779632, 0x06b2f1d2, 0x08edc7b6, 0x0b27eb5c, |
| 36 | 0x0d61304d, 0x0f996a26, 0x11d06c96, 0x14060b67, 0x163a1a7d, 0x186c6ddd, | ||
| 37 | 0x1a9cd9ac, 0x1ccb3236, 0x1ef74bf2, 0x2120fb82, 0x234815ba, 0x256c6f9e, | ||
| 38 | 0x278dde6e, 0x29ac379f, 0x2bc750e8, 0x2ddf003f, 0x2ff31bdd, 0x32037a44, | ||
| 39 | 0x340ff241, 0x36185aee, 0x381c8bb5, 0x3a1c5c56, 0x3c17a4e7, 0x3e0e3ddb, | ||
| 40 | 0x3fffffff, 0x41ecc483, 0x43d464fa, 0x45b6bb5d, 0x4793a20f, 0x496af3e1, | ||
| 41 | 0x4b3c8c11, 0x4d084650, 0x4ecdfec6, 0x508d9210, 0x5246dd48, 0x53f9be04, | ||
| 42 | 0x55a6125a, 0x574bb8e5, 0x58ea90c2, 0x5a827999, 0x5c135399, 0x5d9cff82, | ||
| 43 | 0x5f1f5ea0, 0x609a52d1, 0x620dbe8a, 0x637984d3, 0x64dd894f, 0x6639b039, | ||
| 44 | 0x678dde6d, 0x68d9f963, 0x6a1de735, 0x6b598ea1, 0x6c8cd70a, 0x6db7a879, | ||
| 45 | 0x6ed9eba0, 0x6ff389de, 0x71046d3c, 0x720c8074, 0x730baeec, 0x7401e4bf, | ||
| 46 | 0x74ef0ebb, 0x75d31a5f, 0x76adf5e5, 0x777f903b, 0x7847d908, 0x7906c0af, | ||
| 47 | 0x79bc384c, 0x7a6831b8, 0x7b0a9f8c, 0x7ba3751c, 0x7c32a67c, 0x7cb82884, | ||
| 48 | 0x7d33f0c8, 0x7da5f5a3, 0x7e0e2e31, 0x7e6c924f, 0x7ec11aa3, 0x7f0bc095, | ||
| 49 | 0x7f4c7e52, 0x7f834ecf, 0x7fb02dc4, 0x7fd317b3, 0x7fec09e1, 0x7ffb025e, | ||
| 50 | 0x7fffffff | ||
| 51 | }; | ||
| 34 | 52 | ||
| 35 | #define FRAC_N 8 | 53 | /** |
| 36 | #define FRAC_MASK ((1<<FRAC_N)-1) | 54 | * __fixp_sin32() returns the sin of an angle in degrees |
| 55 | * | ||
| 56 | * @degrees: angle, in degrees, from 0 to 360. | ||
| 57 | * | ||
| 58 | * The returned value ranges from -0x7fffffff to +0x7fffffff. | ||
| 59 | */ | ||
| 60 | static inline s32 __fixp_sin32(int degrees) | ||
| 61 | { | ||
| 62 | s32 ret; | ||
| 63 | bool negative = false; | ||
| 37 | 64 | ||
| 38 | /* Not to be used directly. Use fixp_{cos,sin} */ | 65 | if (degrees > 180) { |
| 39 | static const fixp_t cos_table[46] = { | 66 | negative = true; |
| 40 | 0x0100, 0x00FF, 0x00FF, 0x00FE, 0x00FD, 0x00FC, 0x00FA, 0x00F8, | 67 | degrees -= 180; |
| 41 | 0x00F6, 0x00F3, 0x00F0, 0x00ED, 0x00E9, 0x00E6, 0x00E2, 0x00DD, | 68 | } |
| 42 | 0x00D9, 0x00D4, 0x00CF, 0x00C9, 0x00C4, 0x00BE, 0x00B8, 0x00B1, | 69 | if (degrees > 90) |
| 43 | 0x00AB, 0x00A4, 0x009D, 0x0096, 0x008F, 0x0087, 0x0080, 0x0078, | 70 | degrees = 180 - degrees; |
| 44 | 0x0070, 0x0068, 0x005F, 0x0057, 0x004F, 0x0046, 0x003D, 0x0035, | ||
| 45 | 0x002C, 0x0023, 0x001A, 0x0011, 0x0008, 0x0000 | ||
| 46 | }; | ||
| 47 | 71 | ||
| 72 | ret = sin_table[degrees]; | ||
| 48 | 73 | ||
| 49 | /* a: 123 -> 123.0 */ | 74 | return negative ? -ret : ret; |
| 50 | static inline fixp_t fixp_new(s16 a) | ||
| 51 | { | ||
| 52 | return a<<FRAC_N; | ||
| 53 | } | 75 | } |
| 54 | 76 | ||
| 55 | /* a: 0xFFFF -> -1.0 | 77 | /** |
| 56 | 0x8000 -> 1.0 | 78 | * fixp_sin32() returns the sin of an angle in degrees |
| 57 | 0x0000 -> 0.0 | 79 | * |
| 58 | */ | 80 | * @degrees: angle, in degrees. The angle can be positive or negative |
| 59 | static inline fixp_t fixp_new16(s16 a) | 81 | * |
| 82 | * The returned value ranges from -0x7fffffff to +0x7fffffff. | ||
| 83 | */ | ||
| 84 | static inline s32 fixp_sin32(int degrees) | ||
| 60 | { | 85 | { |
| 61 | return ((s32)a)>>(16-FRAC_N); | 86 | degrees = (degrees % 360 + 360) % 360; |
| 87 | |||
| 88 | return __fixp_sin32(degrees); | ||
| 62 | } | 89 | } |
| 63 | 90 | ||
| 64 | static inline fixp_t fixp_cos(unsigned int degrees) | 91 | /* cos(x) = sin(x + 90 degrees) */ |
| 92 | #define fixp_cos32(v) fixp_sin32((v) + 90) | ||
| 93 | |||
| 94 | /* | ||
| 95 | * 16 bits variants | ||
| 96 | * | ||
| 97 | * The returned value ranges from -0x7fff to 0x7fff | ||
| 98 | */ | ||
| 99 | |||
| 100 | #define fixp_sin16(v) (fixp_sin32(v) >> 16) | ||
| 101 | #define fixp_cos16(v) (fixp_cos32(v) >> 16) | ||
