Re: [PATCH] [media] s5p-mfc: Add a control for IVF format for VP8 encoder
On Wed, May 14, 2014 at 11:12 PM, Kamil Debski k.deb...@samsung.com wrote: Hi Pawel, Hans, I think we talked some time ago on IRC about this patch. If I remember correctly, the conclusion was that it would be better to use a specific pixel formats for this kind of out codec output. Akin to: V4L2_PIX_FMT_H264 'H264' H264 video elementary stream with start codes. V4L2_PIX_FMT_H264_NO_SC 'AVC1' H264 video elementary stream without start codes. Could you confirm this? Hi Kamil. Yes, that was the conclusion. Pawel Best wishes, -- Kamil Debski Samsung RD Institute Poland -Original Message- From: Arun Kumar K [mailto:arunkk.sams...@gmail.com] On Behalf Of Arun Kumar K Sent: Thursday, March 06, 2014 7:04 AM To: linux-media@vger.kernel.org; linux-samsung-...@vger.kernel.org Cc: k.deb...@samsung.com; s.nawro...@samsung.com; posc...@chromium.org; arunkk.sams...@gmail.com Subject: [PATCH] [media] s5p-mfc: Add a control for IVF format for VP8 encoder From: Pawel Osciak posc...@chromium.org Add a control to enable/disable IVF output stream format for VP8 encode. Set the IVF format output to disabled as default. Signed-off-by: Pawel Osciak posc...@chromium.org Signed-off-by: Arun Kumar K arun...@samsung.com --- Documentation/DocBook/media/v4l/controls.xml|8 drivers/media/platform/s5p-mfc/s5p_mfc_common.h |1 + drivers/media/platform/s5p-mfc/s5p_mfc_enc.c| 11 +++ drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c |2 ++ drivers/media/v4l2-core/v4l2-ctrls.c|1 + include/uapi/linux/v4l2-controls.h |1 + 6 files changed, 24 insertions(+) diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml index 0e1770c..07fb64a 100644 --- a/Documentation/DocBook/media/v4l/controls.xml +++ b/Documentation/DocBook/media/v4l/controls.xml @@ -3222,6 +3222,14 @@ V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD as a golden frame./entry Acceptable values are 0, 1, 2 and 3 corresponding to encoder profiles 0, 1, 2 and 3./entry /row + rowentry/entry/row + row + entry spanname=idconstantV4L2_CID_MPEG_VIDEO_VPX_IVF_FORMAT/constantn bsp;/entry + entryboolean/entry + /row + rowentry spanname=descrOutputs the VP8 encoded stream in IVF file format./entry + /row + rowentry/entry/row /tbody /tgroup diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h index 5c28cc3..4d17df9 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h @@ -418,6 +418,7 @@ struct s5p_mfc_vp8_enc_params { u8 rc_frame_qp; u8 rc_p_frame_qp; u8 profile; + bool ivf; }; /** diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c index df83cd1..a67913e 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c @@ -676,6 +676,14 @@ static struct mfc_control controls[] = { .step = 1, .default_value = 0, }, + { + .id = V4L2_CID_MPEG_VIDEO_VPX_IVF_FORMAT, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .minimum = 0, + .maximum = 1, + .step = 1, + .default_value = 0, + }, }; #define NUM_CTRLS ARRAY_SIZE(controls) @@ -1636,6 +1644,9 @@ static int s5p_mfc_enc_s_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_MPEG_VIDEO_VPX_PROFILE: p-codec.vp8.profile = ctrl-val; break; + case V4L2_CID_MPEG_VIDEO_VPX_IVF_FORMAT: + p-codec.vp8.ivf = ctrl-val; + break; default: v4l2_err(dev-v4l2_dev, Invalid control, id=%d, val=%d\n, ctrl-id, ctrl-val); diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c index f64621a..90edb19 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c @@ -1243,6 +1243,8 @@ static int s5p_mfc_set_enc_params_vp8(struct s5p_mfc_ctx *ctx) /* VP8 specific params */ reg = 0; + /* Bit set to 1 disables IVF stream format. */ + reg |= p_vp8-ivf ? 0 : (0x1 12); reg |= (p_vp8-imd_4x4 0x1) 10; switch (p_vp8-num_partitions) { case V4L2_CID_MPEG_VIDEO_VPX_1_PARTITION: diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2- core/v4l2-ctrls.c index e9e12c4..19e78df 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -752,6 +752,7 @@ const char *v4l2_ctrl_get_name(u32 id) case
[PATCH 1/1] smiapp: I2C address is the last part of the subdev name
The I2C address of the sensor device was in the middle of the sub-device name and not in the end as it should have been. The smiapp sub-device names will change from e.g. vs6555 1-0010 pixel array to vs6555 pixel array 1-0010. Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com --- This was already supposed to be fixed by [media] smiapp: Use I2C adapter ID and address in the sub-device name but the I2C address indeed was in the middle of the sub-device name and not in the end as it should have been. drivers/media/i2c/smiapp/smiapp-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index db3d5a6..2413d3c 100644 --- a/drivers/media/i2c/smiapp/smiapp-core.c +++ b/drivers/media/i2c/smiapp/smiapp-core.c @@ -2543,9 +2543,9 @@ static int smiapp_registered(struct v4l2_subdev *subdev) } snprintf(this-sd.name, -sizeof(this-sd.name), %s %d-%4.4x %s, -sensor-minfo.name, i2c_adapter_id(client-adapter), -client-addr, _this-name); +sizeof(this-sd.name), %s %s %d-%4.4x, +sensor-minfo.name, _this-name, +i2c_adapter_id(client-adapter), client-addr); this-sink_fmt.width = sensor-limits[SMIAPP_LIMIT_X_ADDR_MAX] + 1; -- 1.8.3.2 -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v7 2/3] [media] rc: add sunxi-ir driver
On Thu, May 15, 2014 at 03:56:41AM +0600, Alexander Bersenev wrote: This patch adds driver for sunxi IR controller. It is based on Alexsey Shestacov's work based on the original driver supplied by Allwinner. Signed-off-by: Alexander Bersenev b...@hackerdom.ru Signed-off-by: Alexsey Shestacov wingr...@linux-sunxi.org --- drivers/media/rc/Kconfig | 10 ++ drivers/media/rc/Makefile| 1 + drivers/media/rc/sunxi-cir.c | 334 +++ 3 files changed, 345 insertions(+) create mode 100644 drivers/media/rc/sunxi-cir.c diff --git a/drivers/media/rc/Kconfig b/drivers/media/rc/Kconfig index 8fbd377..9427fad 100644 --- a/drivers/media/rc/Kconfig +++ b/drivers/media/rc/Kconfig @@ -343,4 +343,14 @@ config RC_ST If you're not sure, select N here. +config IR_SUNXI +tristate SUNXI IR remote control +depends on RC_CORE +depends on ARCH_SUNXI +---help--- + Say Y if you want to use sunXi internal IR Controller + + To compile this driver as a module, choose M here: the module will + be called sunxi-ir. + endif #RC_DEVICES diff --git a/drivers/media/rc/Makefile b/drivers/media/rc/Makefile index f8b54ff..9ee9ee7 100644 --- a/drivers/media/rc/Makefile +++ b/drivers/media/rc/Makefile @@ -32,4 +32,5 @@ obj-$(CONFIG_IR_GPIO_CIR) += gpio-ir-recv.o obj-$(CONFIG_IR_IGUANA) += iguanair.o obj-$(CONFIG_IR_TTUSBIR) += ttusbir.o obj-$(CONFIG_RC_ST) += st_rc.o +obj-$(CONFIG_IR_SUNXI) += sunxi-cir.o obj-$(CONFIG_IR_IMG) += img-ir/ diff --git a/drivers/media/rc/sunxi-cir.c b/drivers/media/rc/sunxi-cir.c new file mode 100644 index 000..25eb175 --- /dev/null +++ b/drivers/media/rc/sunxi-cir.c @@ -0,0 +1,334 @@ +/* + * Driver for Allwinner sunXi IR controller + * + * Copyright (C) 2014 Alexsey Shestacov wingr...@linux-sunxi.org + * Copyright (C) 2014 Alexander Bersenev b...@hackerdom.ru + * + * Based on sun5i-ir.c: + * Copyright (C) 2007-2012 Daniel Wang + * Allwinner Technology Co., Ltd. www.allwinnertech.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include linux/clk.h +#include linux/interrupt.h +#include linux/module.h +#include linux/of_platform.h +#include media/rc-core.h + +#define SUNXI_IR_DEV sunxi-ir + +/* Registers */ +/* IR Control */ +#define SUNXI_IR_CTL_REG 0x00 +/* Rx Config */ +#define SUNXI_IR_RXCTL_REG0x10 +/* Rx Data */ +#define SUNXI_IR_RXFIFO_REG 0x20 +/* Rx Interrupt Enable */ +#define SUNXI_IR_RXINT_REG0x2C +/* Rx Interrupt Status */ +#define SUNXI_IR_RXSTA_REG0x30 +/* IR Sample Config */ +#define SUNXI_IR_CIR_REG 0x34 + +/* Global Enable for IR_CTL Register */ +#define REG_CTL_GEN BIT(0) +/* RX block enable for IR_CTL Register */ +#define REG_CTL_RXEN BIT(1) +/* CIR mode for IR_CTL Register */ +#define REG_CTL_MD(BIT(4)|BIT(5)) + +/* IR_RXCTL_REG Register Receiver Pulse Polarity Invert flag */ +#define REG_RXCTL_RPPIBIT(2) + +/* IR_RXINT_REG Register fields */ +#define REG_RXINT_ROI_EN BIT(0) /* Rx FIFO Overflow */ +#define REG_RXINT_RPEI_EN BIT(1) /* Rx Packet End */ +#define REG_RXINT_RAI_EN BIT(4) /* Rx FIFO Data Available */ +/* Rx FIFO available byte level */ +#define REG_RXINT_RAL__MASK (BIT(8)|BIT(9)|BIT(10)|BIT(11)) +#define REG_RXINT_RAL__SHIFT 8 +static inline uint32_t REG_RXINT_RAL(uint16_t val) +{ + return (val REG_RXINT_RAL__SHIFT) REG_RXINT_RAL__MASK; +} + +/* CIR_REG register noise threshold */ +#define REG_CIR_NTHR__MASK (BIT(2)|BIT(3)|BIT(4)|BIT(5)|BIT(6)|BIT(7)) +#define REG_CIR_NTHR__SHIFT 2 +static inline uint32_t REG_CIR_NTHR(uint16_t val) +{ + return (val REG_CIR_NTHR__SHIFT) REG_CIR_NTHR__MASK; +} +/* CIR_REG register idle threshold */ +#define REG_CIR_ITHR__MASK (BIT(8)|BIT(9)|BIT(10)|BIT(11)|BIT(12)|BIT(13) \ + |BIT(14)|BIT(15)) +#define REG_CIR_ITHR__SHIFT 8 +static inline uint32_t REG_CIR_ITHR(uint16_t val) +{ + return (val REG_CIR_ITHR__SHIFT) REG_CIR_ITHR__MASK; +} + +/* RXSTA_REG Register RX FIFO Available Counter */ +#define REG_RXSTA_RAC__SHIFT 8 +#define REG_RXSTA_RAC__MASK 0x3f + +/* Clear all interrupt status value */ +#define REG_RXSTA_CLEARALL0xff + +/* Hardware supported fifo size */ +#define SUNXI_IR_FIFO_SIZE16 +/* How many messages in FIFO trigger IRQ */ +#define TRIGGER_LEVEL 8 +/* Required frequency for IR0 or IR1 clock in
RE: [PATCH v2] [media] s5p-mfc: Dequeue sequence header after STREAMON
Hi Arun, From: linux-media-ow...@vger.kernel.org [mailto:linux-media- ow...@vger.kernel.org] On Behalf Of Arun Kumar K Sent: Wednesday, May 14, 2014 10:10 AM Hi Hans, On 05/14/14 12:39, Hans Verkuil wrote: On 05/14/2014 08:29 AM, Arun Kumar K wrote: MFCv6 encoder needs specific minimum number of buffers to be queued in the CAPTURE plane. This minimum number will be known only when the sequence header is generated. So we used to allow STREAMON on the CAPTURE plane only after sequence header is generated and checked with the minimum buffer requirement. But this causes a problem that we call a vb2_buffer_done for the sequence header buffer before doing a STREAON on the CAPTURE plane. How could this ever have worked? Buffers aren't queued to the driver until STREAMON is called, and calling vb2_buffer_done for a buffer that is not queued first to the driver will mess up internal data (q- queued_count for one). This worked till now because __enqueue_in_driver is called first and then start_streaming qop is called. In MFCv6, the start_streaming driver callback used to wait till sequence header interrupt is received and it used to do vb2_buffer_done in that interrupt context. So it happened after buffers are enqueued in driver and before completing the vb2_streamon. This used to still work fine until this patch was merged - b3379c6 : vb2: only call start_streaming if sufficient buffers are queued Are you testing with CONFIG_VIDEO_ADV_DEBUG set? If not, you should do so. That will check whether all the vb2 calls are balanced. BTW, that's a small typo in s5p_mfc_enc.c (search for 'inavlid'). I got it. Will post a patch fixing them. Thanks for spotting this. This problem should also come in earlier MFC firmware versions if the application calls STREAMON on CAPTURE with some delay after doing STREAMON on OUTPUT. You can also play around with the min_buffers_needed field. My rule-of-thumb is that when start_streaming is called everything should be ready to stream. It is painful for drivers to have to keep track of the 'do I have enough buffers' status. For that reason I introduced the min_buffers_needed field. What I believe you can do here is to set it initially to a large value, preventing start_streaming from being called, and once you really know the minimum number of buffers that you need it can be updated again to the actual value. If a large value is kept in min_buffers_needed, there will be some unnecessary memory initialization needed for say 16 full HD raw YUV buffers when actual needed is only 4. And once the encoding is started, updating the min_buffers_needed to actual value doesnt give any advantage as nobody checks for it after that. So the whole idea is to not enforce a worst case buffer allocation requirement beforehand itself. I hope the current scheme of things works well for the requirement. I was looking in the code of the MFC encoder and handling of this situation seems wrong to me. You say that a minimum number of buffers has to be queued for MFC encoder to work. But this number is not checked in s5p_mfc_ctx_ready in s5p_mfc_enc.c. It is only checked during reqbufs. This way it does not ensure that there is a minimum number of buffers queued. Also there is a control V4L2_CID_MIN_BUFFERS_FOR_CAPTURE, maybe it could be used in this context? Another thing - you say that header is generated to a CAPTURE buffer before STREAMON on CAPTURE was done. Is this correct? Can the hardware/driver write to a queued buffer without streaming enabled? Hans, Sylwester? Arun, is there a way to guess the needed number of buffers from controls? Isn't this related with number of B frames? I understand how this affects the number of buffers for OUTPUT, but I thought that a single CAPTURE buffer is always enough. I understood that a generated compressed stream is no longer used after it was created and its processing is finished. I think we need some discussion on this patch. Best wishes, -- Kamil Debski Samsung RD Institute Poland -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [GIT PULL FOR v3.16] UVC gadget driver fixes
Hi, On Fri, May 09, 2014 at 02:27:34PM +0200, Laurent Pinchart wrote: Hi Felipe, Could you please pull the following three patches for v3.16 ? They've been reviewed on the linux-media and linux-usb mailing list. ok, are these patches being merged in any other tree ? I don't usually take pull requests, only patches, so if these aren't merged anyway, I'll cherry-pick them as patches. -- balbi signature.asc Description: Digital signature
Re: [GIT PULL FOR v3.16] UVC gadget driver fixes
Hi Felipe, On Thursday 15 May 2014 10:39:45 Felipe Balbi wrote: On Fri, May 09, 2014 at 02:27:34PM +0200, Laurent Pinchart wrote: Hi Felipe, Could you please pull the following three patches for v3.16 ? They've been reviewed on the linux-media and linux-usb mailing list. ok, are these patches being merged in any other tree ? I don't usually take pull requests, only patches, so if these aren't merged anyway, I'll cherry-pick them as patches. They're not, so feel free to cherry-pick them. -- Regards, Laurent Pinchart signature.asc Description: This is a digitally signed message part.
[GIT PULL FOR v3.16] mt9p031 fixes
Hi Mauro, The following changes since commit ba0d342ecc21fbbe2f6c178f4479944d1fb34f3b: saa7134-alsa: include vmalloc.h (2014-05-13 23:05:15 -0300) are available in the git repository at: git://linuxtv.org/pinchartl/media.git sensors/next for you to fetch changes up to a3a7145c6cecbd9752311b8ae1e431f6755ad5f3: mt9p031: Fix BLC configuration restore when disabling test pattern (2014-05-16 02:43:50 +0200) Laurent Pinchart (2): mt9p031: Really disable Black Level Calibration in test pattern mode mt9p031: Fix BLC configuration restore when disabling test pattern drivers/media/i2c/mt9p031.c | 53 +++-- 1 file changed, 39 insertions(+), 14 deletions(-) -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
cron job: media_tree daily build: OK
This message is generated daily by a cron job that builds media_tree for the kernels and architectures in the list below. Results of the daily build of media_tree: date: Fri May 16 04:00:15 CEST 2014 git branch: test git hash: ba0d342ecc21fbbe2f6c178f4479944d1fb34f3b gcc version:i686-linux-gcc (GCC) 4.8.2 sparse version: v0.5.0-11-g38d1124 host hardware: x86_64 host os:3.14-1.slh.1-amd64 linux-git-arm-at91: OK linux-git-arm-davinci: OK linux-git-arm-exynos: OK linux-git-arm-mx: OK linux-git-arm-omap: OK linux-git-arm-omap1: OK linux-git-arm-pxa: OK linux-git-blackfin: OK linux-git-i686: OK linux-git-m32r: OK linux-git-mips: OK linux-git-powerpc64: OK linux-git-sh: OK linux-git-x86_64: OK linux-2.6.31.14-i686: OK linux-2.6.32.27-i686: OK linux-2.6.33.7-i686: OK linux-2.6.34.7-i686: OK linux-2.6.35.9-i686: OK linux-2.6.36.4-i686: OK linux-2.6.37.6-i686: OK linux-2.6.38.8-i686: OK linux-2.6.39.4-i686: OK linux-3.0.60-i686: OK linux-3.1.10-i686: OK linux-3.2.37-i686: OK linux-3.3.8-i686: OK linux-3.4.27-i686: OK linux-3.5.7-i686: OK linux-3.6.11-i686: OK linux-3.7.4-i686: OK linux-3.8-i686: OK linux-3.9.2-i686: OK linux-3.10.1-i686: OK linux-3.11.1-i686: OK linux-3.12-i686: OK linux-3.13-i686: OK linux-3.14-i686: OK linux-3.15-rc1-i686: OK linux-2.6.31.14-x86_64: OK linux-2.6.32.27-x86_64: OK linux-2.6.33.7-x86_64: OK linux-2.6.34.7-x86_64: OK linux-2.6.35.9-x86_64: OK linux-2.6.36.4-x86_64: OK linux-2.6.37.6-x86_64: OK linux-2.6.38.8-x86_64: OK linux-2.6.39.4-x86_64: OK linux-3.0.60-x86_64: OK linux-3.1.10-x86_64: OK linux-3.2.37-x86_64: OK linux-3.3.8-x86_64: OK linux-3.4.27-x86_64: OK linux-3.5.7-x86_64: OK linux-3.6.11-x86_64: OK linux-3.7.4-x86_64: OK linux-3.8-x86_64: OK linux-3.9.2-x86_64: OK linux-3.10.1-x86_64: OK linux-3.11.1-x86_64: OK linux-3.12-x86_64: OK linux-3.13-x86_64: OK linux-3.14-x86_64: OK linux-3.15-rc1-x86_64: OK apps: OK spec-git: OK sparse version: v0.5.0-11-g38d1124 sparse: ERRORS Detailed results are available here: http://www.xs4all.nl/~hverkuil/logs/Friday.log Full logs are available here: http://www.xs4all.nl/~hverkuil/logs/Friday.tar.bz2 The Media Infrastructure API from this daily build is here: http://www.xs4all.nl/~hverkuil/spec/media.html -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html