All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv3 0/6] Fix rcar-vin field handling
@ 2016-09-02 16:44 Niklas Söderlund
  2016-09-02 16:44 ` [PATCHv3 1/6] media: adv7180: fill in mbus format in set_fmt Niklas Söderlund
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Niklas Söderlund @ 2016-09-02 16:44 UTC (permalink / raw)
  To: linux-media, linux-renesas-soc, sergei.shtylyov, hans.verkuil
  Cc: slongerbeam, lars, mchehab, Niklas Söderlund

Hi,

This series deals with how fields are handled in the rcar-vin driver.  
The current state is that the user is forced to use whatever field type 
is set by the subdevice. This series allows the user to freely choose 
the filed type.

It fixes the current handling of V4L2_FIELD_INTERLACED so that it 
depends on the current video standard to select between TB or BT mode 
(if the video standard can be determined that is). It also adds support 
for V4L2_FIELD_ALTERNATE.

All work is based on top of media-tree and is tested on Koelsch. Output 
of 'v4l2-compliance -fs' is attached bellow and I have tested all fields 
using qv4l2 and it looks OK to me. I need to disable 'Enable Video 
Scaling' in the 'Capture' Menu for ODD/EVEN/ALTERNATE or I get a 
horizontally stretched image. Also for ALTERNATE the 1 line difference 
between the fields are noticeable. The image jumps up/down 1 line for 
each other field, but I guess that is normal since the fields are 
different right?

# v4l2-compliance -d 2 -fs
v4l2-compliance SHA   : a737a6161485fffb70bf51e4fd7f6e2d910174c1

Driver Info:
	Driver name   : rcar_vin
	Card type     : R_Car_VIN
	Bus info      : platform:e6ef1000.video
	Driver version: 4.8.0
	Capabilities  : 0x85200001
		Video Capture
		Read/Write
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps   : 0x05200001
		Video Capture
		Read/Write
		Streaming
		Extended Pix Format

Compliance test for device /dev/video2 (not using libv4l2):

Required ioctls:
	test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
	test second video open: OK
	test VIDIOC_QUERYCAP: OK
	test VIDIOC_G/S_PRIORITY: OK
	test for unlimited opens: OK

Debug ioctls:
	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
	test VIDIOC_LOG_STATUS: OK

Input ioctls:
	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
	test VIDIOC_ENUMAUDIO: OK (Not Supported)
	test VIDIOC_G/S/ENUMINPUT: OK
	test VIDIOC_G/S_AUDIO: OK (Not Supported)
	Inputs: 1 Audio Inputs: 0 Tuners: 0

Output ioctls:
	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
	Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
	test VIDIOC_ENUM/G/S/QUERY_STD: OK
	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
	test VIDIOC_G/S_EDID: OK (Not Supported)

Test input 0:

	Control ioctls:
		test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
		test VIDIOC_QUERYCTRL: OK
		test VIDIOC_G/S_CTRL: OK
		test VIDIOC_G/S/TRY_EXT_CTRLS: OK
		test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
		test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
		Standard Controls: 5 Private Controls: 1

	Format ioctls:
		test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
		test VIDIOC_G/S_PARM: OK
		test VIDIOC_G_FBUF: OK (Not Supported)
		test VIDIOC_G_FMT: OK
		test VIDIOC_TRY_FMT: OK
		test VIDIOC_S_FMT: OK
		test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
		test Cropping: OK
		test Composing: OK
		test Scaling: OK

	Codec ioctls:
		test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
		test VIDIOC_G_ENC_INDEX: OK (Not Supported)
		test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

	Buffer ioctls:
		test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
		test VIDIOC_EXPBUF: OK

Test input 0:

Streaming ioctls:
	test read/write: OK
	test MMAP: OKg
	test USERPTR: OK (Not Supported)
	test DMABUF: Cannot test, specify --expbuf-device

Stream using all formats:
	test MMAP for Format NV16, Frame Size 2x4:
		Crop 720x576@0x0, Compose 6x4@0x0, Stride 32, Field None: OKg
		Crop 720x288@0x0, Compose 6x4@0x0, Stride 32, Field Top: OKg
		Crop 720x288@0x0, Compose 6x4@0x0, Stride 32, Field Bottom: OKg
		Crop 720x288@0x0, Compose 6x4@0x0, Stride 32, Field Interlaced: OKg
		Crop 720x288@0x0, Compose 6x4@0x0, Stride 32, Field Alternating: OKg
		Crop 720x288@0x0, Compose 6x4@0x0, Stride 32, Field Interlaced Top-Bottom: OKg
		Crop 720x288@0x0, Compose 6x4@0x0, Stride 32, Field Interlaced Bottom-Top: OKg
	test MMAP for Format NV16, Frame Size 2048x2048:
		Crop 720x576@0x0, Compose 2048x2048@0x0, Stride 2048, Field None: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 2048, Field Top: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 2048, Field Bottom: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 2048, Field Interlaced: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 2048, Field Alternating: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 2048, Field Interlaced Top-Bottom: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 2048, Field Interlaced Bottom-Top: OKg
	test MMAP for Format NV16, Frame Size 736x576:
		Crop 720x576@0x0, Compose 736x576@0x0, Stride 736, Field None: OKg
		Crop 720x288@0x0, Compose 736x576@0x0, Stride 736, Field Top: OKg
		Crop 720x288@0x0, Compose 736x576@0x0, Stride 736, Field Bottom: OKg
		Crop 720x288@0x0, Compose 736x576@0x0, Stride 736, Field Interlaced: OKg
		Crop 720x288@0x0, Compose 736x576@0x0, Stride 736, Field Alternating: OKg
		Crop 720x288@0x0, Compose 736x576@0x0, Stride 736, Field Interlaced Top-Bottom: OKg
		Crop 720x288@0x0, Compose 736x576@0x0, Stride 736, Field Interlaced Bottom-Top: OKg
	test MMAP for Format YUYV, Frame Size 32x4:
		Crop 720x576@0x0, Compose 32x4@0x0, Stride 64, Field None: OKg
		Crop 720x288@0x0, Compose 32x4@0x0, Stride 64, Field Top: OKg
		Crop 720x288@0x0, Compose 32x4@0x0, Stride 64, Field Bottom: OKg
		Crop 720x288@0x0, Compose 32x4@0x0, Stride 64, Field Interlaced: OKg
		Crop 720x288@0x0, Compose 32x4@0x0, Stride 64, Field Alternating: OKg
		Crop 720x288@0x0, Compose 32x4@0x0, Stride 64, Field Interlaced Top-Bottom: OKg
		Crop 720x288@0x0, Compose 32x4@0x0, Stride 64, Field Interlaced Bottom-Top: OKg
	test MMAP for Format YUYV, Frame Size 2048x2048:
		Crop 720x576@0x0, Compose 2048x2048@0x0, Stride 4096, Field None: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Top: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Bottom: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Interlaced: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Alternating: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Interlaced Top-Bottom: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Interlaced Bottom-Top: OKg
	test MMAP for Format YUYV, Frame Size 736x576:
		Crop 720x576@0x0, Compose 736x576@0x0, Stride 1472, Field None: OKg
		Crop 720x288@0x0, Compose 736x576@0x0, Stride 1472, Field Top: OKg
		Crop 720x288@0x0, Compose 736x576@0x0, Stride 1472, Field Bottom: OKg
		Crop 720x288@0x0, Compose 736x576@0x0, Stride 1472, Field Interlaced: OKg
		Crop 720x288@0x0, Compose 736x576@0x0, Stride 1472, Field Alternating: OKg
		Crop 720x288@0x0, Compose 736x576@0x0, Stride 1472, Field Interlaced Top-Bottom: OKg
		Crop 720x288@0x0, Compose 736x576@0x0, Stride 1472, Field Interlaced Bottom-Top: OKg
	test MMAP for Format UYVY, Frame Size 2x4:
		Crop 720x576@0x0, Compose 2x4@0x0, Stride 4, Field None: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 4, Field Top: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 4, Field Bottom: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 4, Field Interlaced: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 4, Field Alternating: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 4, Field Interlaced Top-Bottom: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 4, Field Interlaced Bottom-Top: OKg
	test MMAP for Format UYVY, Frame Size 2048x2048:
		Crop 720x576@0x0, Compose 2048x2048@0x0, Stride 4096, Field None: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Top: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Bottom: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Interlaced: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Alternating: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Interlaced Top-Bottom: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Interlaced Bottom-Top: OKg
	test MMAP for Format UYVY, Frame Size 720x576:
		Crop 720x576@0x0, Compose 720x576@0x0, Stride 1440, Field None: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 1440, Field Top: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 1440, Field Bottom: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 1440, Field Interlaced: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 1440, Field Alternating: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 1440, Field Interlaced Top-Bottom: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 1440, Field Interlaced Bottom-Top: OKg
	test MMAP for Format RGBP, Frame Size 2x4:
		Crop 720x576@0x0, Compose 2x4@0x0, Stride 4, Field None: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 4, Field Top: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 4, Field Bottom: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 4, Field Interlaced: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 4, Field Alternating: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 4, Field Interlaced Top-Bottom: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 4, Field Interlaced Bottom-Top: OKg
	test MMAP for Format RGBP, Frame Size 2048x2048:
		Crop 720x576@0x0, Compose 2048x2048@0x0, Stride 4096, Field None: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Top: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Bottom: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Interlaced: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Alternating: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Interlaced Top-Bottom: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Interlaced Bottom-Top: OKg
	test MMAP for Format RGBP, Frame Size 720x576:
		Crop 720x576@0x0, Compose 720x576@0x0, Stride 1440, Field None: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 1440, Field Top: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 1440, Field Bottom: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 1440, Field Interlaced: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 1440, Field Alternating: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 1440, Field Interlaced Top-Bottom: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 1440, Field Interlaced Bottom-Top: OKg
	test MMAP for Format XR15, Frame Size 2x4:
		Crop 720x576@0x0, Compose 2x4@0x0, Stride 4, Field None: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 4, Field Top: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 4, Field Bottom: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 4, Field Interlaced: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 4, Field Alternating: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 4, Field Interlaced Top-Bottom: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 4, Field Interlaced Bottom-Top: OKg
	test MMAP for Format XR15, Frame Size 2048x2048:
		Crop 720x576@0x0, Compose 2048x2048@0x0, Stride 4096, Field None: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Top: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Bottom: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Interlaced: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Alternating: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Interlaced Top-Bottom: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 4096, Field Interlaced Bottom-Top: OKg
	test MMAP for Format XR15, Frame Size 720x576:
		Crop 720x576@0x0, Compose 720x576@0x0, Stride 1440, Field None: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 1440, Field Top: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 1440, Field Bottom: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 1440, Field Interlaced: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 1440, Field Alternating: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 1440, Field Interlaced Top-Bottom: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 1440, Field Interlaced Bottom-Top: OKg
	test MMAP for Format XR24, Frame Size 2x4:
		Crop 720x576@0x0, Compose 2x4@0x0, Stride 8, Field None: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 8, Field Top: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 8, Field Bottom: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 8, Field Interlaced: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 8, Field Alternating: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 8, Field Interlaced Top-Bottom: OKg
		Crop 720x288@0x0, Compose 2x4@0x0, Stride 8, Field Interlaced Bottom-Top: OKg
	test MMAP for Format XR24, Frame Size 2048x2048:
		Crop 720x576@0x0, Compose 2048x2048@0x0, Stride 8192, Field None: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 8192, Field Top: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 8192, Field Bottom: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 8192, Field Interlaced: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 8192, Field Alternating: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 8192, Field Interlaced Top-Bottom: OKg
		Crop 720x288@0x0, Compose 2048x2048@0x0, Stride 8192, Field Interlaced Bottom-Top: OKg
	test MMAP for Format XR24, Frame Size 720x576:
		Crop 720x576@0x0, Compose 720x576@0x0, Stride 2880, Field None: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 2880, Field Top: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 2880, Field Bottom: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 2880, Field Interlaced: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 2880, Field Alternating: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 2880, Field Interlaced Top-Bottom: OKg
		Crop 720x288@0x0, Compose 720x576@0x0, Stride 2880, Field Interlaced Bottom-Top: OKg

Total: 172, Succeeded: 172, Failed: 0, Warnings: 0

* Changes since v2
- Dropped the patch from Steve Longerbeam which changed the filed type 
  reported by the adv7180 since discussion is still ongoing on how to 
  best solve it. It was this patch that sparked this series so that the 
  rcar-vin driver could be able to handle the V4L2_FIELD_ALTERNATE type 
  which was suggested by Steve's patch for the adv7180 at some point.
- Reorderd the order of the patches so the 'media: adv7180: fill in mbus 
  format in set_fmt' is first in the series as the rcar-vin patches 
  depends on the mbus format being set in set_fmt. This was overlooked 
  in previous versions..
- Fixed spelling and a style error pointed out by Sergei Shtylyov, thanks!
- Rebased on top of latest media-tree master branch which have picked up 
  some other rcar-vin cleanup patches to ease the merge.

* Changes since v1
- Added patch so that V4L2_FIELD_INTERLACED is not treated the same as 
  V4L2_FIELD_INTERLACED_TB. Instead G_STD will be used to get the video 
  standard and make a TB/BT decision based on that.
- Add changelog to Stevens patch which I dropped by mistake when I 
  applied it to my tree.
- Add better commit message, comment explaining that INTERLACED will be 
  used as the default if the subdeivce uses ALTERNATE field mode and 
  implements G_STD.

Niklas Söderlund (6):
  media: adv7180: fill in mbus format in set_fmt
  media: rcar-vin: make V4L2_FIELD_INTERLACED standard dependent
  media: rcar-vin: allow field to be changed
  media: rcar-vin: fix bug in scaling
  media: rcar-vin: fix height for TOP and BOTTOM fields
  media: rcar-vin: add support for V4L2_FIELD_ALTERNATE

 drivers/media/i2c/adv7180.c                 |   6 +-
 drivers/media/platform/rcar-vin/rcar-dma.c  |  35 +++++--
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 156 +++++++++++++++++-----------
 3 files changed, 126 insertions(+), 71 deletions(-)

-- 
2.9.3


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCHv3 1/6] media: adv7180: fill in mbus format in set_fmt
  2016-09-02 16:44 [PATCHv3 0/6] Fix rcar-vin field handling Niklas Söderlund
@ 2016-09-02 16:44 ` Niklas Söderlund
  2016-09-02 16:44 ` [PATCHv3 2/6] media: rcar-vin: make V4L2_FIELD_INTERLACED standard dependent Niklas Söderlund
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Niklas Söderlund @ 2016-09-02 16:44 UTC (permalink / raw)
  To: linux-media, linux-renesas-soc, sergei.shtylyov, hans.verkuil
  Cc: slongerbeam, lars, mchehab, Niklas Söderlund

If the V4L2_SUBDEV_FORMAT_TRY is used in set_fmt the width, height etc
would not be filled.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/i2c/adv7180.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 515ea6a..50efecc 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -711,6 +711,7 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd,
 {
 	struct adv7180_state *state = to_state(sd);
 	struct v4l2_mbus_framefmt *framefmt;
+	int ret;
 
 	switch (format->format.field) {
 	case V4L2_FIELD_NONE:
@@ -722,8 +723,9 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd,
 		break;
 	}
 
+	ret = adv7180_mbus_fmt(sd,  &format->format);
+
 	if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE) {
-		framefmt = &format->format;
 		if (state->field != format->format.field) {
 			state->field = format->format.field;
 			adv7180_set_power(state, false);
@@ -735,7 +737,7 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd,
 		*framefmt = format->format;
 	}
 
-	return adv7180_mbus_fmt(sd, framefmt);
+	return ret;
 }
 
 static int adv7180_g_mbus_config(struct v4l2_subdev *sd,
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCHv3 2/6] media: rcar-vin: make V4L2_FIELD_INTERLACED standard dependent
  2016-09-02 16:44 [PATCHv3 0/6] Fix rcar-vin field handling Niklas Söderlund
  2016-09-02 16:44 ` [PATCHv3 1/6] media: adv7180: fill in mbus format in set_fmt Niklas Söderlund
@ 2016-09-02 16:44 ` Niklas Söderlund
  2016-09-02 16:44 ` [PATCHv3 3/6] media: rcar-vin: allow field to be changed Niklas Söderlund
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Niklas Söderlund @ 2016-09-02 16:44 UTC (permalink / raw)
  To: linux-media, linux-renesas-soc, sergei.shtylyov, hans.verkuil
  Cc: slongerbeam, lars, mchehab, Niklas Söderlund

The field V4L2_FIELD_INTERLACED is standard dependent and should not
unconditionally be equivalent to V4L2_FIELD_INTERLACED_TB.

This patch adds a check to see if the video standard can be obtained and
if it's a 60 Hz format. If the condition is met V4L2_FIELD_INTERLACED
is treated as V4L2_FIELD_INTERLACED_BT if not as
V4L2_FIELD_INTERLACED_TB.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/platform/rcar-vin/rcar-dma.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c
index 46abdb0..d57801b 100644
--- a/drivers/media/platform/rcar-vin/rcar-dma.c
+++ b/drivers/media/platform/rcar-vin/rcar-dma.c
@@ -131,6 +131,7 @@ static u32 rvin_read(struct rvin_dev *vin, u32 offset)
 static int rvin_setup(struct rvin_dev *vin)
 {
 	u32 vnmc, dmr, dmr2, interrupts;
+	v4l2_std_id std;
 	bool progressive = false, output_is_yuv = false, input_is_yuv = false;
 
 	switch (vin->format.field) {
@@ -141,6 +142,14 @@ static int rvin_setup(struct rvin_dev *vin)
 		vnmc = VNMC_IM_EVEN;
 		break;
 	case V4L2_FIELD_INTERLACED:
+		/* Default to TB */
+		vnmc = VNMC_IM_FULL;
+		/* Use BT if video standard can be read and is 60 Hz format */
+		if (!v4l2_subdev_call(vin_to_source(vin), video, g_std, &std)) {
+			if (std & V4L2_STD_525_60)
+				vnmc = VNMC_IM_FULL | VNMC_FOC;
+		}
+		break;
 	case V4L2_FIELD_INTERLACED_TB:
 		vnmc = VNMC_IM_FULL;
 		break;
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCHv3 3/6] media: rcar-vin: allow field to be changed
  2016-09-02 16:44 [PATCHv3 0/6] Fix rcar-vin field handling Niklas Söderlund
  2016-09-02 16:44 ` [PATCHv3 1/6] media: adv7180: fill in mbus format in set_fmt Niklas Söderlund
  2016-09-02 16:44 ` [PATCHv3 2/6] media: rcar-vin: make V4L2_FIELD_INTERLACED standard dependent Niklas Söderlund
@ 2016-09-02 16:44 ` Niklas Söderlund
  2016-09-02 16:44 ` [PATCHv3 4/6] media: rcar-vin: fix bug in scaling Niklas Söderlund
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Niklas Söderlund @ 2016-09-02 16:44 UTC (permalink / raw)
  To: linux-media, linux-renesas-soc, sergei.shtylyov, hans.verkuil
  Cc: slongerbeam, lars, mchehab, Niklas Söderlund

The driver forced whatever field was set by the source subdevice to be
used. This patch allows the user to change from the default field.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 62ca7e3..88bfee3 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -102,6 +102,7 @@ static int __rvin_try_format_source(struct rvin_dev *vin,
 	struct v4l2_subdev_format format = {
 		.which = which,
 	};
+	enum v4l2_field field;
 	int ret;
 
 	sd = vin_to_source(vin);
@@ -114,12 +115,16 @@ static int __rvin_try_format_source(struct rvin_dev *vin,
 
 	format.pad = vin->src_pad_idx;
 
+	field = pix->field;
+
 	ret = v4l2_subdev_call(sd, pad, set_fmt, pad_cfg, &format);
 	if (ret < 0 && ret != -ENOIOCTLCMD)
 		goto done;
 
 	v4l2_fill_pix_format(pix, &format.format);
 
+	pix->field = field;
+
 	source->width = pix->width;
 	source->height = pix->height;
 
@@ -143,6 +148,10 @@ static int __rvin_try_format(struct rvin_dev *vin,
 	rwidth = pix->width;
 	rheight = pix->height;
 
+	/* Keep current field if no specific one is asked for */
+	if (pix->field == V4L2_FIELD_ANY)
+		pix->field = vin->format.field;
+
 	/*
 	 * Retrieve format information and select the current format if the
 	 * requested format isn't supported.
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCHv3 4/6] media: rcar-vin: fix bug in scaling
  2016-09-02 16:44 [PATCHv3 0/6] Fix rcar-vin field handling Niklas Söderlund
                   ` (2 preceding siblings ...)
  2016-09-02 16:44 ` [PATCHv3 3/6] media: rcar-vin: allow field to be changed Niklas Söderlund
@ 2016-09-02 16:44 ` Niklas Söderlund
  2016-09-02 16:45 ` [PATCHv3 5/6] media: rcar-vin: fix height for TOP and BOTTOM fields Niklas Söderlund
  2016-09-02 16:45 ` [PATCHv3 6/6] media: rcar-vin: add support for V4L2_FIELD_ALTERNATE Niklas Söderlund
  5 siblings, 0 replies; 7+ messages in thread
From: Niklas Söderlund @ 2016-09-02 16:44 UTC (permalink / raw)
  To: linux-media, linux-renesas-soc, sergei.shtylyov, hans.verkuil
  Cc: slongerbeam, lars, mchehab, Niklas Söderlund

It was not possible to scale beyond the image size of the video source
limitation. The output frame would be bigger but the captured image was
limited to the size of the video source.

The error was that the crop boundary was set after the requested frame
size and not the video source size. This patch breaks out the resetting
of the crop, compose and format to separate functions so the error wont
creep back.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 105 ++++++++++++++--------------
 1 file changed, 54 insertions(+), 51 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 88bfee3..47d8d97 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -92,6 +92,54 @@ static u32 rvin_format_sizeimage(struct v4l2_pix_format *pix)
  * V4L2
  */
 
+static void rvin_reset_crop_compose(struct rvin_dev *vin)
+{
+	vin->crop.top = vin->crop.left = 0;
+	vin->crop.width = vin->source.width;
+	vin->crop.height = vin->source.height;
+
+	vin->compose.top = vin->compose.left = 0;
+	vin->compose.width = vin->format.width;
+	vin->compose.height = vin->format.height;
+}
+
+static int rvin_reset_format(struct rvin_dev *vin)
+{
+	struct v4l2_subdev_format fmt = {
+		.which = V4L2_SUBDEV_FORMAT_ACTIVE,
+	};
+	struct v4l2_mbus_framefmt *mf = &fmt.format;
+	int ret;
+
+	fmt.pad = vin->src_pad_idx;
+
+	ret = v4l2_subdev_call(vin_to_source(vin), pad, get_fmt, NULL, &fmt);
+	if (ret)
+		return ret;
+
+	vin->format.width	= mf->width;
+	vin->format.height	= mf->height;
+	vin->format.colorspace	= mf->colorspace;
+	vin->format.field	= mf->field;
+
+	switch (vin->format.field) {
+	case V4L2_FIELD_TOP:
+	case V4L2_FIELD_BOTTOM:
+	case V4L2_FIELD_NONE:
+	case V4L2_FIELD_INTERLACED_TB:
+	case V4L2_FIELD_INTERLACED_BT:
+	case V4L2_FIELD_INTERLACED:
+		break;
+	default:
+		vin->format.field = V4L2_FIELD_NONE;
+		break;
+	}
+
+	rvin_reset_crop_compose(vin);
+
+	return 0;
+}
+
 static int __rvin_try_format_source(struct rvin_dev *vin,
 				    u32 which,
 				    struct v4l2_pix_format *pix,
@@ -255,6 +303,8 @@ static int rvin_s_fmt_vid_cap(struct file *file, void *priv,
 
 	vin->format = f->fmt.pix;
 
+	rvin_reset_crop_compose(vin);
+
 	return 0;
 }
 
@@ -446,35 +496,14 @@ static int rvin_querystd(struct file *file, void *priv, v4l2_std_id *a)
 static int rvin_s_std(struct file *file, void *priv, v4l2_std_id a)
 {
 	struct rvin_dev *vin = video_drvdata(file);
-	struct v4l2_subdev *sd = vin_to_source(vin);
-	struct v4l2_subdev_format fmt = {
-		.which = V4L2_SUBDEV_FORMAT_ACTIVE,
-	};
-	struct v4l2_mbus_framefmt *mf = &fmt.format;
-	int ret = v4l2_subdev_call(sd, video, s_std, a);
+	int ret;
 
+	ret = v4l2_subdev_call(vin_to_source(vin), video, s_std, a);
 	if (ret < 0)
 		return ret;
 
 	/* Changing the standard will change the width/height */
-	ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &fmt);
-	if (ret) {
-		vin_err(vin, "Failed to get initial format\n");
-		return ret;
-	}
-
-	vin->format.width = mf->width;
-	vin->format.height = mf->height;
-
-	vin->crop.top = vin->crop.left = 0;
-	vin->crop.width = mf->width;
-	vin->crop.height = mf->height;
-
-	vin->compose.top = vin->compose.left = 0;
-	vin->compose.width = mf->width;
-	vin->compose.height = mf->height;
-
-	return 0;
+	return rvin_reset_format(vin);
 }
 
 static int rvin_g_std(struct file *file, void *priv, v4l2_std_id *a)
@@ -779,10 +808,6 @@ static void rvin_notify(struct v4l2_subdev *sd,
 
 int rvin_v4l2_probe(struct rvin_dev *vin)
 {
-	struct v4l2_subdev_format fmt = {
-		.which = V4L2_SUBDEV_FORMAT_ACTIVE,
-	};
-	struct v4l2_mbus_framefmt *mf = &fmt.format;
 	struct video_device *vdev = &vin->vdev;
 	struct v4l2_subdev *sd = vin_to_source(vin);
 	int pad_idx, ret;
@@ -839,31 +864,9 @@ int rvin_v4l2_probe(struct rvin_dev *vin)
 		return -EINVAL;
 
 	vin->src_pad_idx = pad_idx;
-	fmt.pad = vin->src_pad_idx;
-
-	/* Try to improve our guess of a reasonable window format */
-	ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &fmt);
-	if (ret) {
-		vin_err(vin, "Failed to get initial format\n");
-		return ret;
-	}
 
-	/* Set default format */
-	vin->format.width	= mf->width;
-	vin->format.height	= mf->height;
-	vin->format.colorspace	= mf->colorspace;
-	vin->format.field	= mf->field;
 	vin->format.pixelformat	= RVIN_DEFAULT_FORMAT;
-
-
-	/* Set initial crop and compose */
-	vin->crop.top = vin->crop.left = 0;
-	vin->crop.width = mf->width;
-	vin->crop.height = mf->height;
-
-	vin->compose.top = vin->compose.left = 0;
-	vin->compose.width = mf->width;
-	vin->compose.height = mf->height;
+	rvin_reset_format(vin);
 
 	ret = video_register_device(&vin->vdev, VFL_TYPE_GRABBER, -1);
 	if (ret) {
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCHv3 5/6] media: rcar-vin: fix height for TOP and BOTTOM fields
  2016-09-02 16:44 [PATCHv3 0/6] Fix rcar-vin field handling Niklas Söderlund
                   ` (3 preceding siblings ...)
  2016-09-02 16:44 ` [PATCHv3 4/6] media: rcar-vin: fix bug in scaling Niklas Söderlund
@ 2016-09-02 16:45 ` Niklas Söderlund
  2016-09-02 16:45 ` [PATCHv3 6/6] media: rcar-vin: add support for V4L2_FIELD_ALTERNATE Niklas Söderlund
  5 siblings, 0 replies; 7+ messages in thread
From: Niklas Söderlund @ 2016-09-02 16:45 UTC (permalink / raw)
  To: linux-media, linux-renesas-soc, sergei.shtylyov, hans.verkuil
  Cc: slongerbeam, lars, mchehab, Niklas Söderlund

The height used for V4L2_FIELD_TOP and V4L2_FIELD_BOTTOM where wrong.
The frames only contain one field so the height should be half of the
frame.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 47d8d97..1392514 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -125,6 +125,8 @@ static int rvin_reset_format(struct rvin_dev *vin)
 	switch (vin->format.field) {
 	case V4L2_FIELD_TOP:
 	case V4L2_FIELD_BOTTOM:
+		vin->format.height /= 2;
+		break;
 	case V4L2_FIELD_NONE:
 	case V4L2_FIELD_INTERLACED_TB:
 	case V4L2_FIELD_INTERLACED_BT:
@@ -220,21 +222,13 @@ static int __rvin_try_format(struct rvin_dev *vin,
 	/* Limit to source capabilities */
 	__rvin_try_format_source(vin, which, pix, source);
 
-	/* If source can't match format try if VIN can scale */
-	if (source->width != rwidth || source->height != rheight)
-		rvin_scale_try(vin, pix, rwidth, rheight);
-
-	/* HW limit width to a multiple of 32 (2^5) for NV16 else 2 (2^1) */
-	walign = vin->format.pixelformat == V4L2_PIX_FMT_NV16 ? 5 : 1;
-
-	/* Limit to VIN capabilities */
-	v4l_bound_align_image(&pix->width, 2, RVIN_MAX_WIDTH, walign,
-			      &pix->height, 4, RVIN_MAX_HEIGHT, 2, 0);
-
 	switch (pix->field) {
-	case V4L2_FIELD_NONE:
 	case V4L2_FIELD_TOP:
 	case V4L2_FIELD_BOTTOM:
+		pix->height /= 2;
+		source->height /= 2;
+		break;
+	case V4L2_FIELD_NONE:
 	case V4L2_FIELD_INTERLACED_TB:
 	case V4L2_FIELD_INTERLACED_BT:
 	case V4L2_FIELD_INTERLACED:
@@ -244,6 +238,17 @@ static int __rvin_try_format(struct rvin_dev *vin,
 		break;
 	}
 
+	/* If source can't match format try if VIN can scale */
+	if (source->width != rwidth || source->height != rheight)
+		rvin_scale_try(vin, pix, rwidth, rheight);
+
+	/* HW limit width to a multiple of 32 (2^5) for NV16 else 2 (2^1) */
+	walign = vin->format.pixelformat == V4L2_PIX_FMT_NV16 ? 5 : 1;
+
+	/* Limit to VIN capabilities */
+	v4l_bound_align_image(&pix->width, 2, RVIN_MAX_WIDTH, walign,
+			      &pix->height, 4, RVIN_MAX_HEIGHT, 2, 0);
+
 	pix->bytesperline = max_t(u32, pix->bytesperline,
 				  rvin_format_bytesperline(pix));
 	pix->sizeimage = max_t(u32, pix->sizeimage,
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCHv3 6/6] media: rcar-vin: add support for V4L2_FIELD_ALTERNATE
  2016-09-02 16:44 [PATCHv3 0/6] Fix rcar-vin field handling Niklas Söderlund
                   ` (4 preceding siblings ...)
  2016-09-02 16:45 ` [PATCHv3 5/6] media: rcar-vin: fix height for TOP and BOTTOM fields Niklas Söderlund
@ 2016-09-02 16:45 ` Niklas Söderlund
  5 siblings, 0 replies; 7+ messages in thread
From: Niklas Söderlund @ 2016-09-02 16:45 UTC (permalink / raw)
  To: linux-media, linux-renesas-soc, sergei.shtylyov, hans.verkuil
  Cc: slongerbeam, lars, mchehab, Niklas Söderlund

The HW can capture both ODD and EVEN fields in separate buffers so it's
possible to support V4L2_FIELD_ALTERNATE. This patch add support for
this mode.

At probe time and when S_STD is called the driver will default to use
V4L2_FIELD_INTERLACED if the subdevice reports V4L2_FIELD_ALTERNATE. The
driver will only change the field type if the subdevice implements
G_STD, if not it will keep the default at V4L2_FIELD_ALTERNATE.

The user can always explicitly ask for V4L2_FIELD_ALTERNATE in S_FMT and
the driver will use that field format.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/platform/rcar-vin/rcar-dma.c  | 26 ++++++++++++++++++++------
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 13 +++++++++++++
 2 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c
index d57801b..1da95ab 100644
--- a/drivers/media/platform/rcar-vin/rcar-dma.c
+++ b/drivers/media/platform/rcar-vin/rcar-dma.c
@@ -95,6 +95,7 @@
 /* Video n Module Status Register bits */
 #define VNMS_FBS_MASK		(3 << 3)
 #define VNMS_FBS_SHIFT		3
+#define VNMS_FS			(1 << 2)
 #define VNMS_AV			(1 << 1)
 #define VNMS_CA			(1 << 0)
 
@@ -156,6 +157,7 @@ static int rvin_setup(struct rvin_dev *vin)
 	case V4L2_FIELD_INTERLACED_BT:
 		vnmc = VNMC_IM_FULL | VNMC_FOC;
 		break;
+	case V4L2_FIELD_ALTERNATE:
 	case V4L2_FIELD_NONE:
 		if (vin->continuous) {
 			vnmc = VNMC_IM_ODD_EVEN;
@@ -329,15 +331,26 @@ static bool rvin_capture_active(struct rvin_dev *vin)
 	return rvin_read(vin, VNMS_REG) & VNMS_CA;
 }
 
-static int rvin_get_active_slot(struct rvin_dev *vin)
+static int rvin_get_active_slot(struct rvin_dev *vin, u32 vnms)
 {
 	if (vin->continuous)
-		return (rvin_read(vin, VNMS_REG) & VNMS_FBS_MASK)
-			>> VNMS_FBS_SHIFT;
+		return (vnms & VNMS_FBS_MASK) >> VNMS_FBS_SHIFT;
 
 	return 0;
 }
 
+static enum v4l2_field rvin_get_active_field(struct rvin_dev *vin, u32 vnms)
+{
+	if (vin->format.field == V4L2_FIELD_ALTERNATE) {
+		/* If FS is set it's a Even field */
+		if (vnms & VNMS_FS)
+			return V4L2_FIELD_BOTTOM;
+		return V4L2_FIELD_TOP;
+	}
+
+	return vin->format.field;
+}
+
 static void rvin_set_slot_addr(struct rvin_dev *vin, int slot, dma_addr_t addr)
 {
 	const struct rvin_video_format *fmt;
@@ -878,7 +891,7 @@ static bool rvin_fill_hw(struct rvin_dev *vin)
 static irqreturn_t rvin_irq(int irq, void *data)
 {
 	struct rvin_dev *vin = data;
-	u32 int_status;
+	u32 int_status, vnms;
 	int slot;
 	unsigned int sequence, handled = 0;
 	unsigned long flags;
@@ -905,7 +918,8 @@ static irqreturn_t rvin_irq(int irq, void *data)
 	}
 
 	/* Prepare for capture and update state */
-	slot = rvin_get_active_slot(vin);
+	vnms = rvin_read(vin, VNMS_REG);
+	slot = rvin_get_active_slot(vin, vnms);
 	sequence = vin->sequence++;
 
 	vin_dbg(vin, "IRQ %02d: %d\tbuf0: %c buf1: %c buf2: %c\tmore: %d\n",
@@ -920,7 +934,7 @@ static irqreturn_t rvin_irq(int irq, void *data)
 		goto done;
 
 	/* Capture frame */
-	vin->queue_buf[slot]->field = vin->format.field;
+	vin->queue_buf[slot]->field = rvin_get_active_field(vin, vnms);
 	vin->queue_buf[slot]->sequence = sequence;
 	vin->queue_buf[slot]->vb2_buf.timestamp = ktime_get_ns();
 	vb2_buffer_done(&vin->queue_buf[slot]->vb2_buf, VB2_BUF_STATE_DONE);
diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 1392514..61e9b59 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -122,9 +122,21 @@ static int rvin_reset_format(struct rvin_dev *vin)
 	vin->format.colorspace	= mf->colorspace;
 	vin->format.field	= mf->field;
 
+	/*
+	 * If the subdevice uses ALTERNATE field mode and G_STD is
+	 * implemented use the VIN HW to combine the two fields to
+	 * one INTERLACED frame. The ALTERNATE field mode can still
+	 * be requested in S_FMT and be respected, this is just the
+	 * default which is applied at probing or when S_STD is called.
+	 */
+	if (vin->format.field == V4L2_FIELD_ALTERNATE &&
+	    v4l2_subdev_has_op(vin_to_source(vin), video, g_std))
+		vin->format.field = V4L2_FIELD_INTERLACED;
+
 	switch (vin->format.field) {
 	case V4L2_FIELD_TOP:
 	case V4L2_FIELD_BOTTOM:
+	case V4L2_FIELD_ALTERNATE:
 		vin->format.height /= 2;
 		break;
 	case V4L2_FIELD_NONE:
@@ -225,6 +237,7 @@ static int __rvin_try_format(struct rvin_dev *vin,
 	switch (pix->field) {
 	case V4L2_FIELD_TOP:
 	case V4L2_FIELD_BOTTOM:
+	case V4L2_FIELD_ALTERNATE:
 		pix->height /= 2;
 		source->height /= 2;
 		break;
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-09-02 16:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-02 16:44 [PATCHv3 0/6] Fix rcar-vin field handling Niklas Söderlund
2016-09-02 16:44 ` [PATCHv3 1/6] media: adv7180: fill in mbus format in set_fmt Niklas Söderlund
2016-09-02 16:44 ` [PATCHv3 2/6] media: rcar-vin: make V4L2_FIELD_INTERLACED standard dependent Niklas Söderlund
2016-09-02 16:44 ` [PATCHv3 3/6] media: rcar-vin: allow field to be changed Niklas Söderlund
2016-09-02 16:44 ` [PATCHv3 4/6] media: rcar-vin: fix bug in scaling Niklas Söderlund
2016-09-02 16:45 ` [PATCHv3 5/6] media: rcar-vin: fix height for TOP and BOTTOM fields Niklas Söderlund
2016-09-02 16:45 ` [PATCHv3 6/6] media: rcar-vin: add support for V4L2_FIELD_ALTERNATE Niklas Söderlund

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.