Hi Adam,
Thank you for responding. Yes, I removed the MT9P031_8MSB_ONLY definition in "mt9p031.c". There were also some changes required in "board-omap3logic.c". Then I rebuilt the kernel.
Below are the simplest commands I could boil down to, consisting of 2 "media-ctl" commands to setup the pipeline, and "yavta" to acquire the image. After the 2nd media-ctl command, it attempts to set SGRBG12 format, but then gives up and set SGRBS8 format. (I also tried SGRBG10, but it had the same response.) Notice that the yavta command does everything right, up to the VIDIOC_QBUF command, but during the VIDIOC_STREAMON command, it fails "Invalid argument" and then quits. If I use SGRBG8 format, everything runs fine. (I suspect that there is some code somewhere in the driver that specifies the camera only supports 8-bit mode, but where would that code reside ??)
Greg
DM-37x# media-ctl -v -r -l '"mt9p031":0->"OMAP3 ISP CCDC":0[1], "OMAP3 ISP CCDC":1->"OMAP3 ISP CCDC output":0[1]'
Opening media device /dev/media0
Enumerating entities
Found 16 entities
Enumerating pads and links
Resetting all links to inactive
Setting up link 16:0 -> 5:0 [1]
Setting up link 5:1 -> 6:0 [1]
DM-37x# media-ctl -v -f '"mt9p031":0 [SGRBG12 1600x1600 (507,226)/1600x1600], "OMAP3 ISP CCDC":1 [SGRBG12 1600x1600]'
Opening media device /dev/media0
Enumerating entities
Found 16 entities
Enumerating pads and links
Setting up crop rectangle (507,22[ 96.929626] omap_device: omap_i2c.2: new wor
st case activate latency 0: 305175
6)/1600x1600 on pad mt9p031 2-0048/0
Crop rectangle set: (508,226)/1600x1600
Setting up format SGRBG12 1600x1600 on pad mt9p031 2-0048/0
Format set: SGRBG8 1600x1600
Setting up format SGRBG8 1600x1600 on pad OMAP3 ISP CCDC/0
Format set: SGRBG8 1600x1600
Setting up format SGRBG12 1600x1600 on pad OMAP3 ISP CCDC/1
Format set: SGRBG8 1600x1600
DM-37x# yavta -f SGRBG12 -s 1600x1600 --capture=1 --file=image.raw /dev/video2
Device /dev/video2 opened.
Device `OMAP3 ISP CCDC output' on `media' is a video capture device.
Video format set: SGRBG12 (32314142) 1600x1600 buffer size 5120000
Video format: SGRBG12 (32314142) 1600x1600 buffer size 5120000
8 buffers requested.
length: 5120000 offset: 0
Buffer 0 mapped at address 0x4027e000.
length: 5120000 offset: 5120000
Buffer 1 mapped at address 0x40763000.
length: 5120000 offset: 10240000
Buffer 2 mapped at address 0x40cb6000.
length: 5120000 offset: 15360000
Buffer 3 mapped at address 0x411f1000.
length: 5120000 offset: 20480000
Buffer 4 mapped at address 0x416f1000.
length: 5120000 offset: 25600000
Buffer 5 mapped at address 0x41c33000.
length: 5120000 offset: 30720000
Buffer 6 mapped at address 0x421a9000.
length: 5120000 offset: 35840000
Buffer 7 mapped at address 0x426aa000.
Unable to start streaming: Invalid argument (22).
8 buffers released.
DM-37x# media-ctl -p
Opening media device /dev/media0
Enumerating entities
Found 16 entities
Enumerating pads and links
Media controller API version 0.0.0
Media device information
------------------------
driver omap3isp
model TI OMAP3 ISP
serial
bus info
hw revision 0x0
driver version 0.0.0
Device topology
- entity 1: OMAP3 ISP CCP2 (2 pads, 2 links)
type V4L2 subdev subtype Unknown
device node name /dev/v4l-subdev0
pad0: Sink [SGRBG10 4096x4096]
<- "OMAP3 ISP CCP2 input":0 []
pad1: Source [SGRBG10 4096x4096]
-> "OMAP3 ISP CCDC":0 []
- entity 2: OMAP3 ISP CCP2 input (1 pad, 1 link)
type Node subtype V4L
device node name /dev/video0
pad0: Source
-> "OMAP3 ISP CCP2":0 []
- entity 3: OMAP3 ISP CSI2a (2 pads, 2 links)
type V4L2 subdev subtype Unknown
device node name /dev/v4l-subdev1
pad0: Sink [SGRBG10 4096x4096]
pad1: Source [SGRBG10 4096x4096]
-> "OMAP3 ISP CSI2a output":0 []
-> "OMAP3 ISP CCDC":0 []
- entity 4: OMAP3 ISP CSI2a output (1 pad, 1 link)
type Node subtype V4L
device node name /dev/video1
pad0: Sink
<- "OMAP3 ISP CSI2a":1 []
- entity 5: OMAP3 ISP CCDC (3 pads, 9 links)
type V4L2 subdev subtype Unknown
device node name /dev/v4l-subdev2
pad0: Sink [SGRBG8 1600x1600]
<- "OMAP3 ISP CCP2":1 []
<- "OMAP3 ISP CSI2a":1 []
<- "mt9p031 2-0048":0 [ENABLED]
pad1: Source [SGRBG8 1600x1600]
-> "OMAP3 ISP CCDC output":0 [ENABLED]
-> "OMAP3 ISP resizer":0 []
pad2: Source [SGRBG8 1600x1599]
-> "OMAP3 ISP preview":0 []
-> "OMAP3 ISP AEWB":0 [ENABLED,IMMUTABLE]
-> "OMAP3 ISP AF":0 [ENABLED,IMMUTABLE]
-> "OMAP3 ISP histogram":0 [ENABLED,IMMUTABLE]
- entity 6: OMAP3 ISP CCDC output (1 pad, 1 link)
type Node subtype V4L
device node name /dev/video2
pad0: Sink
<- "OMAP3 ISP CCDC":1 [ENABLED]
- entity 7: OMAP3 ISP preview (2 pads, 4 links)
type V4L2 subdev subtype Unknown
device node name /dev/v4l-subdev3
pad0: Sink [SGRBG10 4096x4096]
<- "OMAP3 ISP CCDC":2 []
<- "OMAP3 ISP preview input":0 []
pad1: Source [YUYV 4082x4088]
-> "OMAP3 ISP preview output":0 []
-> "OMAP3 ISP resizer":0 []
- entity 8: OMAP3 ISP preview input (1 pad, 1 link)
type Node subtype V4L
device node name /dev/video3
pad0: Source
-> "OMAP3 ISP preview":0 []
- entity 9: OMAP3 ISP preview output (1 pad, 1 link)
type Node subtype V4L
device node name /dev/video4
pad0: Sink
<- "OMAP3 ISP preview":1 []
- entity 10: OMAP3 ISP resizer (2 pads, 4 links)
type V4L2 subdev subtype Unknown
device node name /dev/v4l-subdev4
pad0: Sink [YUYV 4095x4095 (4,6)/4086x4082]
<- "OMAP3 ISP CCDC":1 []
<- "OMAP3 ISP preview":1 []
<- "OMAP3 ISP resizer input":0 []
pad1: Source [YUYV 4096x4095]
-> "OMAP3 ISP resizer output":0 []
- entity 11: OMAP3 ISP resizer input (1 pad, 1 link)
type Node subtype V4L
device node name /dev/video5
pad0: Source
-> "OMAP3 ISP resizer":0 []
- entity 12: OMAP3 ISP resizer output (1 pad, 1 link)
type Node subtype V4L
device node name /dev/video6
pad0: Sink
<- "OMAP3 ISP resizer":1 []
- entity 13: OMAP3 ISP AEWB (1 pad, 1 link)
type V4L2 subdev subtype Unknown
device node name /dev/v4l-subdev5
pad0: Sink
<- "OMAP3 ISP CCDC":2 [ENABLED,IMMUTABLE]
- entity 14: OMAP3 ISP AF (1 pad, 1 link)
type V4L2 subdev subtype Unknown
device node name /dev/v4l-subdev6
pad0: Sink
<- "OMAP3 ISP CCDC":2 [ENABLED,IMMUTABLE]
- entity 15: OMAP3 ISP histogram (1 pad, 1 link)
type V4L2 subdev subtype Unknown
device node name /dev/v4l-subdev7
pad0: Sink
<- "OMAP3 ISP CCDC":2 [ENABLED,IMMUTABLE]
- entity 16: mt9p031 2-0048 (1 pad, 1 link)
type V4L2 subdev subtype Unknown
device node name /dev/v4l-subdev8
pad0: Source [SGRBG8 1600x1600 (508,226)/1600x1600]
-> "OMAP3 ISP CCDC":0 [ENABLED]