All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/5] STM32 DCMI camera interface crop support
@ 2017-07-28 10:04 ` Hugues Fruchet
  0 siblings, 0 replies; 40+ messages in thread
From: Hugues Fruchet @ 2017-07-28 10:04 UTC (permalink / raw)
  To: Maxime Coquelin, Alexandre Torgue, Mauro Carvalho Chehab, Hans Verkuil
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-media,
	Benjamin Gaignard, Yannick Fertre, Hugues Fruchet

This patchset implements crop feature of Digital Camera Memory Interface
(DCMI) of STMicroelectronics STM32 SoC series, allowing user to crop
at pixel level inside sensor captured frame.

This patchset follows discussions initiated from a first submission of DCMI
crop support, see [1].

First part of patches brings few fixes and cleanup in DCMI driver
to prepare support of crop through g_/s_selection interface in latest
commit.

This has been tested on STM32F746G-DISCO + STM32F4DIS-CAM extension
running OV9655 sensor, using a modified version of yavta [2] utility
to support crop through S_SELECTION(V4L2_SEL_TGT_CROP) ioctl:
 yavta -s 480x272 -n 1 --capture=2 /dev/video0 --crop=0,0,480,272

v4l2-compliance cropping test is failed due to OV9655 sensor supporting
several discrete frame sizes and crop support added by DCMI interface [3]:
  fail: v4l2-test-formats.cpp(1266): node->frmsizes_count[pixfmt] > 1
    test Cropping: FAIL
If sensor is restricted to only a single supported resolution, test is OK.
Compliance test should be adapted to support this case.


[1] http://www.mail-archive.com/linux-media@vger.kernel.org/msg114652.html
[2] http://git.ideasonboard.org/?p=yavta.git;a=summary
[3] see v4l2-compliance test report below

===========
= history =
===========
version 1:
  - Initial version

===================
= v4l2-compliance =
===================
Below is the v4l2-compliance report for this current version of the DCMI camera interface.
v4l2-compliance has been built from v4l-utils-1.12.5.

~ # v4l2-compliance -s -f -d /dev/video0
v4l2-compliance SHA   : f5f45e17ee98a0ebad7836ade2b34ceec909d751

Driver Info:
        Driver name   : stm32-dcmi
        Card type     : STM32 Camera Memory Interface
        Bus info      : platform:dcmi
        Driver version: 4.12.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/video0 (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 (Not Supported)
        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: 2 Private Controls: 0

        Format ioctls:
                test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
                test VIDIOC_G/S_PARM: OK (Not Supported)
                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)
                fail: v4l2-test-formats.cpp(1266): node->frmsizes_count[pixfmt] > 1
                test Cropping: FAIL
                test Composing: OK (Not Supported)
                fail: v4l2-test-formats.cpp(1633): node->can_scale && node->frmsizes_count[v4l_format_g_pixelformat(&cur)]
                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: OK
        test USERPTR: OK (Not Supported)
        test DMABUF: Cannot test, specify --expbuf-device

Stream using all formats:
        test MMAP for Format RGBP, Frame Size 160x120:
                Crop 160x120@0x0, Stride 320, Field None: OK
                Crop 0x0@0x0, Stride 320, Field None, SelTest: OK
                Crop 160x120@0x0, Stride 320, Field None, SelTest: OK
        test MMAP for Format RGBP, Frame Size 160x120:
                Crop 160x120@0x0, Stride 320, Field None: OK
        test MMAP for Format RGBP, Frame Size 160x120:
                Crop 160x120@0x0, Stride 320, Field None: OK

Total: 51, Succeeded: 50, Failed: 1, Warnings: 0


Hugues Fruchet (5):
  [media] stm32-dcmi: catch dma submission error
  [media] stm32-dcmi: revisit control register handling
  [media] stm32-dcmi: cleanup variable/fields namings
  [media] stm32-dcmi: set default format at open()
  [media] stm32-dcmi: g_/s_selection crop support

 drivers/media/platform/stm32/stm32-dcmi.c | 527 +++++++++++++++++++++++++-----
 1 file changed, 448 insertions(+), 79 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 40+ messages in thread
* [PATCH v1 0/5] Camera support on STM32F746G-DISCO board
@ 2017-06-22 15:12 Hugues Fruchet
  2017-06-22 15:12   ` Hugues Fruchet
  0 siblings, 1 reply; 40+ messages in thread
From: Hugues Fruchet @ 2017-06-22 15:12 UTC (permalink / raw)
  To: Maxime Coquelin, Alexandre Torgue, Mauro Carvalho Chehab, Hans Verkuil
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-media,
	Benjamin Gaignard, Yannick Fertre, Hugues Fruchet

This patchset enables OV9655 camera support of STM32F4DIS-CAM extension
board plugged on connector P1 of STM32F746G-DISCO board.

Tested by doing a fullscreen preview with a modified version of yavta [1]
which redirects captured frames to framebuffer:
 yavta -s 480x272 -n 1 --capture=-1 /dev/video0 -D (note the unofficial
 "-D" option for "Display output")

First part of patches brings few fixes in DCMI driver and introduces
internal crop support in order to enable fullscreen preview (480x272)
by cropping VGA sensor output.

Second part relates to devicetree and configuration to enable DCMI on
STM32F746 MCU then enable DCMI and OV9655 support on STM32F746G-DISCO [2].

[1] http://git.ideasonboard.org/?p=yavta.git;a=summary
[2] due to STM32F746G-DISCO support not yet in media tree (4.13-rc1),
    devicetree patches related to STM32F746G-DISCO are not yet provided.

===========
= history =
===========
version 1:
  - Initial submission for code review with restrictions [2].


Hugues Fruchet (5):
  [media] stm32-dcmi: catch dma submission error
  [media] stm32-dcmi: revisit control register handling
  [media] stm32-dcmi: crop sensor image to match user resolution
  ARM: dts: stm32: Enable DCMI support on STM32F746 MCU
  ARM: configs: stm32: DCMI + OV9655 camera support

 arch/arm/boot/dts/stm32f746.dtsi          | 31 +++++++++++++
 arch/arm/configs/stm32_defconfig          |  9 ++++
 drivers/media/platform/stm32/stm32-dcmi.c | 72 ++++++++++++++++++++++++++-----
 3 files changed, 101 insertions(+), 11 deletions(-)

-- 
1.9.1

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

end of thread, other threads:[~2017-08-21 10:23 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-28 10:04 [PATCH v1 0/5] STM32 DCMI camera interface crop support Hugues Fruchet
2017-07-28 10:04 ` Hugues Fruchet
2017-07-28 10:04 ` Hugues Fruchet
2017-07-28 10:04 ` [PATCH v1 1/5] [media] stm32-dcmi: catch dma submission error Hugues Fruchet
2017-07-28 10:04   ` Hugues Fruchet
2017-07-28 10:04   ` Hugues Fruchet
2017-07-28 10:04 ` [PATCH v1 2/5] [media] stm32-dcmi: revisit control register handling Hugues Fruchet
2017-07-28 10:04   ` Hugues Fruchet
2017-07-28 10:04   ` Hugues Fruchet
2017-07-28 10:05 ` [PATCH v1 3/5] [media] stm32-dcmi: cleanup variable/fields namings Hugues Fruchet
2017-07-28 10:05   ` Hugues Fruchet
2017-07-28 10:05   ` Hugues Fruchet
2017-08-04 11:51   ` Hans Verkuil
2017-08-04 11:51     ` Hans Verkuil
2017-08-04 11:51     ` Hans Verkuil
2017-07-28 10:05 ` [PATCH v1 4/5] [media] stm32-dcmi: set default format at open() Hugues Fruchet
2017-07-28 10:05   ` Hugues Fruchet
2017-07-28 10:05   ` Hugues Fruchet
2017-08-04 12:00   ` Hans Verkuil
2017-08-04 12:00     ` Hans Verkuil
2017-08-04 12:00     ` Hans Verkuil
2017-08-21 10:20     ` Hugues FRUCHET
2017-08-21 10:20       ` Hugues FRUCHET
2017-08-21 10:20       ` Hugues FRUCHET
2017-08-21 10:20       ` Hugues FRUCHET
2017-07-28 10:05 ` [PATCH v1 5/5] [media] stm32-dcmi: g_/s_selection crop support Hugues Fruchet
2017-07-28 10:05   ` Hugues Fruchet
2017-07-28 10:05   ` Hugues Fruchet
2017-07-30  4:26   ` kbuild test robot
2017-07-30  4:26     ` kbuild test robot
2017-07-30  4:26     ` kbuild test robot
2017-08-04 12:26   ` Hans Verkuil
2017-08-04 12:26     ` Hans Verkuil
2017-08-21 10:19     ` Hugues FRUCHET
2017-08-21 10:19       ` Hugues FRUCHET
2017-08-21 10:19       ` Hugues FRUCHET
2017-08-21 10:19       ` Hugues FRUCHET
  -- strict thread matches above, loose matches on Subject: below --
2017-06-22 15:12 [PATCH v1 0/5] Camera support on STM32F746G-DISCO board Hugues Fruchet
2017-06-22 15:12 ` [PATCH v1 1/5] [media] stm32-dcmi: catch dma submission error Hugues Fruchet
2017-06-22 15:12   ` Hugues Fruchet
2017-06-22 15:12   ` Hugues Fruchet

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.