summaryrefslogtreecommitdiffstats
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2014-07-21[media] v4l: ctrls: Unlocked variants of v4l2_ctrl_s_ctrl{,_int64}()Sakari Ailus1-6/+20
Implement unlocked variants of v4l2_ctrl_s_ctrl() and v4l2_ctrl_s_ctrl_int64(). As drivers need to set controls as they access driver internal state elsewhere than in the control framework unlocked variants of these functions become handy. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-21[media] v4l: ctrls: Provide an unlocked variant of v4l2_ctrl_modify_range()Sakari Ailus1-4/+4
Drivers may use the v4l2_ctrl_modify_range() internally as part of other operations that need to be both serialised using a driver's lock which can also be used to serialise access to the control handler. Provide an unlocked version of the function, __v4l2_ctrl_modify_range() which then may be used by drivers for the purpose. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-21[media] saa7146: fix compile warningHans Verkuil1-7/+6
Fall-out from the recent struct v4l2_framebuffer change. drivers/media/common/saa7146/saa7146_fops.c: In function ‘saa7146_vv_init’: drivers/media/common/saa7146/saa7146_fops.c:536:6: warning: assignment from incompatible pointer type [enabled by default] fmt = &vv->ov_fb.fmt; ^ Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-21[media] staging/media/davinci_vpfe/dm365_ipipeif.c: fix negativity checkAndrey Utkin1-2/+3
[linux-3.16-rc5/drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:210]: (style) Checking if unsigned variable 'val' is less than zero. val = get_oneshot_mode(ipipeif->input); if (val < 0) { pr_err("ipipeif: links setup required"); return -EINVAL; } but static int get_oneshot_mode(enum ipipeif_input_entity input) Introduced temporary variable for negativity check. "val" is afterwards used in a lot of bitwise operations, so changing its type to signed is not safe, according to CERT C Secure Coding Standards chapter INT13-C: "Use bitwise operators only on unsigned operands" https://www.securecoding.cert.org/confluence/display/seccode/INT13-C.+Use+bitwise+operators+only+on+unsigned+operands Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80521 Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-21[media] adv7180: Remove duplicate unregister callIan Molton1-1/+0
This driver moved over to v4l2_async_unregister_subdev() but still retained a call to v4l2_unregister_subdev(). Remove. Signed-off-by: Ian Molton <ian.molton@codethink.co.uk> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-21[media] s5p-mfc: limit the size of the CPBpanpan liu1-3/+6
The CPB size is limited by the hardware. Add this limit to the s_fmt. Signed-off-by: panpan liu <panpan1.liu@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-21[media] coda: simplify IRAM setupPhilipp Zabel1-101/+74
OVL and BTP IRAM buffers are never used, setup the bits for for DBK/BIT/IP usage depending on CODA version in one place. Also, use a simple allocator function and group IRAM addresses and size in a coda_aux_buf structure. This is done in preparation for CODA960 support. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-21[media] coda: fix internal framebuffer allocation sizePhilipp Zabel1-2/+2
This error was introduced by 5677e3b04d3b3961200aa2bb9cc715e709eafeb9 "[media] coda: update CODA7541 to firmware 1.4.50". Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-21[media] coda: fix h.264 quantization parameter rangePhilipp Zabel1-2/+2
If bitrate is not set, the encoder is running in VBR mode, with the I- and P-frame quantization parameters configured from userspace. For the quantization parameters, 0 is a valid value. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-21[media] coda: fix readback of CODA_RET_DEC_SEQ_FRAME_NEEDPhilipp Zabel1-1/+1
Previously we'd add one to this value, allocating one additional, superfluous internal buffer. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-21[media] coda: fix decoder I/P/B frame detectionPhilipp Zabel1-9/+14
Currently the rotator unit is used to copy decoded frames out into buffers provided by videobuf2. Since the CODA reports the I/P/B frame type of the last decoded frame, and this frame will be copied out in a later device_run, depending on display order, we have to store the frame type until such time. This patch also adds the B-frame type. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-21[media] s5p-mfc: Fix selective sclk_mfc initJacek Anaszewski1-0/+24
fc906b6d "Remove special clock usage in driver" removed initialization of MFC special clock, arguing that there's no need to do it explicitly, since it's one of MFC gate clock's dependencies and gets enabled along with it. However, there's no promise of keeping this hierarchy across Exynos SoC releases, therefore this approach fails to provide a stable, portable solution. Out of all MFC versions, only v6 doesn't use special clock at all. For other versions log a message only in case clk_get fails, as not all the devices with the same MFC version require initializing the clock explicitly. Signed-off-by: Mateusz Zalega <m.zalega@samsung.com> Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-21[media] s5p: fix error code path when failing to allocate DMA memoryMaurizio Lombardi1-3/+2
In the s5p_mfc_alloc_firmware() function there are some mistakes where the code checks whether the DMA memory is properly allocated or not. First of all dma_alloc_coherent() returns NULL in case of error. The code also checked two times fw_virt_addr, ignoring the bank2_virt pointer. Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] zoran: remove duplicate ZR050_MO_COMP defineDan Carpenter1-1/+0
The ZR050_MO_COMP define is cut and pasted twice so we can delete the second instance. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] saa7164-dvb: Remove unnecessary null testHimangi Saraogi1-18/+14
This patch removes the null test on dvb. dvb is initialized at the beginning of the function to &port->dvb. Since port is dereferenced prior to the null test, port must be a valid pointer, and &port->dvb cannot be null. The following Coccinelle script is used for detecting the change: @r@ expression e,f; identifier g,y; statement S1,S2; @@ *e = &f->g <+... f->y ...+> *if (e != NULL || ...) S1 else S2 Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] radio-bcm2048.c: Fix some checkpatch.pl errorsLuke Hart1-10/+10
Fix the following warnings reported in radio-bcm2048.c: WARNING: else is not generally useful after a break or return 374: FILE: radio-bcm2048.c:374: + return 0; + } else { WARNING: else is not generally useful after a break or return 728: FILE: radio-bcm2048.c:728: + return BCM2048_DE_EMPHASIS_75us; + else WARNING: unchecked sscanf return value 1974: FILE: radio-bcm2048.c:1974: + sscanf(buf, mask, &value); \ WARNING: Missing a blank line after declarations 2245: FILE: radio-bcm2048.c:2245: + unsigned char tmpbuf[3]; + tmpbuf[i] = bdev->rds_info.radio_text[bdev->rd_index+i+2]; WARNING: Possible unnecessary 'out of memory' message 2601: FILE: radio-bcm2048.c:2601: + if (!bdev) { + dev_dbg(&client->dev, "Failed to alloc video device.\n"); The following error was left since it seems to be a false positive: ERROR: Macros with complex values should be enclosed in parenthesis +#define DEFINE_SYSFS_PROPERTY(prop, signal, size, mask, check) \ +property_write(prop, signal size, mask, check) \ +property_read(prop, size, mask) Signed-off-by: Luke Hart <luke.hart@birchleys.eu> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] media: pvrusb2: make logging code saneAndrey Utkin1-9/+3
The issue was discovered by static analysis. It turns out that code is somewhat insane, being if (x) {...} else { if (x) {...} } Edited it to do the only reasonable thing, which is to log the information about the failed call. The most descriptive logging commands set is taken from original code. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=79801 Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com> Acked-by: Mike Isely <isely@pobox.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] staging: media: bcm2048: radio-bcm2048.c - removed IRQF_DISABLED macroAnil Belur1-1/+1
- this patch removes IRQF_DISABLED macro, as this is deprecated/noop. Signed-off-by: Anil Belur <askb23@gmail.com> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] solo6x10: update GOP size, QP immediatelyAndrey Utkin1-0/+4
Previously, it was needed to reopen device to update GOP size and quantization parameter. Now we update device registers with new values immediately. Signed-off-by: Andrey Utkin <andrey.utkin@corp.bluecherry.net> Signed-off-by: Ismael Luceno <ismael.luceno@corp.bluecherry.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] solo6x10: expose encoder quantization setting as V4L2 controlAndrey Utkin1-0/+5
solo6*10 boards have configurable quantization parameter which takes values from 0 to 31, inclusively. This change enables setting it with ioctl VIDIOC_S_CTRL with id V4L2_CID_MPEG_VIDEO_H264_MIN_QP. Signed-off-by: Andrey Utkin <andrey.utkin@corp.bluecherry.net> Signed-off-by: Ismael Luceno <ismael.luceno@corp.bluecherry.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] staging/solo6x10: SOLO6X10 should select BITREVERSEGeert Uytterhoeven1-0/+1
If CONFIG_SOLO6X10=y, but CONFIG_BITREVERSE=m: drivers/built-in.o: In function `solo_osd_print': (.text+0x1c7a1f): undefined reference to `byte_rev_table' make: *** [vmlinux] Error 1 Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Ismael Luceno <ismael.luceno@corp.bluecherry.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] hdpvr: fix reported HDTV colorspaceHans Verkuil1-1/+1
The colorspace for HDTV is REC709, not SMPTE240M. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] cx23885: add support for Hauppauge ImpactVCB-eHans Verkuil3-1/+32
Add support for Hauppauge model 71100: WinTV-ImpactVCB-e (PCIe, Retail, half height) Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l2-ioctl: clips, clipcount and bitmap should not be zeroedHans Verkuil1-1/+25
Otherwise you cannot get the current clip and bitmap information from an overlay. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l2-ioctl: call g_selection before calling cropcapHans Verkuil1-22/+26
If the vidioc_cropcap op is implemented by the driver then the v4l2 core will call that directly. If g_selection is available, then the core cropcap implementation uses g_selection to fill in the bounds and defrect and it sets the pixelaspect to 1x1. But if both are available, then I would like to use g_selection to fill in defrect and bounds before calling cropcap. That way the driver's cropcap implementation doesn't have to set defrect or bounds. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l2-ioctl: clear reserved field of G/S_SELECTIONHans Verkuil1-2/+2
Be sure that the reserved fields are cleared. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l2-ioctl: remove pointless INFO_FL_CLEARHans Verkuil1-2/+2
The edid field is the last field of the struct, so there is nothing to clear. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l2-dev: don't debug poll unless the debug level > 2Hans Verkuil1-1/+1
Some applications poll a lot, so prevent the poll message from flooding the log. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l2-dev: streamon/off is only a valid ioctl for video, vbi and sdrHans Verkuil1-2/+2
The VIDIOC_STREAMON/OFF ioctls are not valid for radio devices, just like the other streaming I/O ioctls. Add the streamon/off ioctls to the other streaming I/O ioctls. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l2-ioctl.c: fix enum_freq_bands handlingHans Verkuil1-2/+5
If the driver supports enum_freq_bands, but only for certain device nodes, then it may return -ENOTTY. But in that case the code should fall into the fall-back case where the current tuner/modulator range is returned. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l2-ioctl.c: check vfl_type in ENUM_FMTHans Verkuil1-6/+8
The other format ioctls (g/s/try_fmt) all check if the passed buffer type makes sense for the device node's vfl_type. E.g. it makes no sense for a VBI buffer type to be passed through a video node instead of a vbi node. But this check was missing in ENUM_FMT which can cause a problem if you have both video and sdr device nodes. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: omap4iss: Signal fatal errors to the vb2 queueLaurent Pinchart1-9/+6
When a fatal error occurs in the pipeline signal it to the vb2 queue with a call to vb2_queue_error(). The queue will then take care to return -EIO when preparing buffers, remove the driver-specific code that now duplicates that check. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: omap4iss: Use the devm_* managed allocatorsLaurent Pinchart1-76/+8
This simplifies remove and error code paths. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: omap4iss: Add module debug parameterLaurent Pinchart1-0/+5
The parameter is used to initialize the video node debug field and activate the V4L debug infrastructure. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: omap4iss: Don't reinitialize the video qlock at every streamonLaurent Pinchart1-1/+1
Initialize the spin lock once only when initializing the video object. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: omap4iss: Copy paste error in iss_get_clocksVitaly Osipov1-1/+1
It makes more sense to return PTR_ERR(iss->iss_ctrlclk) here. The current code looks like an oversight in pasting the block just above this one. Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: omap4iss: tighten omap4iss dependenciesArnd Bergmann1-1/+1
The OMAP4 camera support depends on I2C and VIDEO_V4L2, both of which can be loadable modules. This causes build failures if we want the camera driver to be built-in. This can be solved by turning the option into "tristate", which unfortunately causes another problem, because the driver incorrectly calls a platform-internal interface for omap4_ctrl_pad_readl/omap4_ctrl_pad_writel. Instead, this patch just forbids the invalid configurations and ensures that the driver can only be built if all its dependencies are built-in. Cc: stable@vger.kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: vb2: Add fatal error condition flagLaurent Pinchart1-3/+36
When a fatal error occurs that render the device unusable, the only options for a driver to signal the error condition to userspace is to set the V4L2_BUF_FLAG_ERROR flag when dequeuing buffers and to return an error from the buffer prepare handler when queuing buffers. The buffer error flag indicates a transient error and can't be used by applications to detect fatal errors. Returning an error from vb2_qbuf() is thus the only real indication that a fatal error occurred. However, this is difficult to handle for multithreaded applications that requeue buffers from a thread other than the control thread. In particular the poll() call in the control thread will not notify userspace of the error. This patch adds an explicit mechanism to report fatal errors to userspace. Drivers can call the vb2_queue_error() function to signal a fatal error. From this moment on, buffer preparation will return -EIO to userspace, and vb2_poll() will set the POLLERR flag and return immediately. The error flag is cleared when cancelling the queue, either at stream off time (through vb2_streamoff) or when releasing the queue with vb2_queue_release(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: vb2: Don't return POLLERR during transient buffer underrunsLaurent Pinchart1-2/+3
The V4L2 specification states that "When the application did not call VIDIOC_QBUF or VIDIOC_STREAMON yet the poll() function succeeds, but sets the POLLERR flag in the revents field." The vb2_poll() function sets POLLERR when the queued buffers list is empty, regardless of whether this is caused by the stream not being active yet, or by a transient buffer underrun. Bring the implementation in line with the specification by returning POLLERR if no buffer has been queued only when the queue is not streaming. Buffer underruns during streaming are not treated specially anymore and just result in poll() blocking until the next event. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pawel Osciak <pawel@osciak.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: vsp1: uds: Fix scaling of alpha layerLaurent Pinchart5-35/+122
Pixel color components can be scaled using either bilinear interpolation or a multitap filter. The multitap filter provides better results, but can't be selected when the alpha layer need to be scaled down by more than 1/2. Disable alpha scaling when the input has a fixed alpha value, and program the UDS to output a fixed alpha value in that case. This ensures the multitap filter will be used whenever possible. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: vsp1: bru: Make the background color configurableLaurent Pinchart2-5/+49
Expose the background color to userspace through the V4L2_CID_BG_COLOR control. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: vsp1: bru: Support non-premultiplied colors at the BRU outputLaurent Pinchart1-2/+9
The BRU outputs premultiplied colors, enable color data normalization when the format configured at the output of the pipeline isn't premultiplied. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: vsp1: bru: Support premultiplied alpha at the BRU inputsLaurent Pinchart3-28/+50
Adjust the BRU blending formula to avoid the multiplication by alpha when the corresponding input format is premultiplied. As this requires access to the RPFs connected to the BRU inputs from the BRU module, store pointers to the RPFs in the BRU structure when validating the pipeline. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: vsp1: Add V4L2_CID_ALPHA_COMPONENT control supportLaurent Pinchart3-4/+104
The control is used to configure the fixed alpha channel value, when reading from memory in the RPF or writing to memory in the WPF. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: vsp1: Add alpha channel support to the memory portsLaurent Pinchart4-20/+41
Support ARGB formats on the RPF side by reading the alpha component from memory and on the WPF side by writing it to memory. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: vsp1: Switch to XRGB formatsLaurent Pinchart1-4/+22
The driver ignores the alpha component on output video nodes and hardcodes the alpha component to 0 on capture video nodes. Make this explicit by exposing XRGB formats. Compatibility with existing userspace applications is handled by selecting the XRGB format corresponding to the requested old RGB format. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: vsp1: wpf: Clear RPF to WPF association at stream off timeLaurent Pinchart1-0/+1
The VSP1 stores the video pipelines' input (RPF) to output (WPF) mappings in a WPF register. An RPF must never be associated with multiple WPFs, even if all of those WPFs but one are unused, otherwise the hardware won't function properly. The driver doesn't ensure this correctly as it never clears the mappings. An RPF used with one WPF and later with a different WPF will lead to malfunction, as it will be associated with two WPFs. Clear the mappings at stream off time to fix this. Reported-by: Damian Hobson-Garcia <dhobsong@igel.co.jp> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: vsp1: wpf: Simplify cast to pipeline structureLaurent Pinchart1-2/+1
Use the subdev pointer directly to_vsp1_pipeline() macro instead of casting from the subdev to the wpf object and back to the subdev. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: vsp1: sru: Make the intensity controllable during streamingLaurent Pinchart3-43/+61
The control value is currently stored in the SRU structure by the control set handler and written to the hardware at stream on time, making control set during streaming ineffective. Fix it by writing to the registers from within the control set handler. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: vsp1: sru: Fix the intensity control default valueLaurent Pinchart1-1/+11
The default value isn't set and defaults to 0, which isn't in the 1-6 min-max range. Fix it by setting the default value to 1. This shoud have been caught when checking the control handler error field at initialization time, but the check was missing. Add it. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>