thanks, tegra_channel_get_format returns 0 only! &
__tegra_channel_try_format is not called when implement v4l2-compliance -d /dev/video0
static int
__tegra_channel_try_format(struct tegra_channel *chan,
struct v4l2_pix_format *pix)
{
const struct tegra_video_format *vfmt;
struct v4l2_subdev_format fmt;
struct v4l2_subdev *sd = chan->subdev_on_csi;
int ret = 0;
/* Use the channel format if pixformat is not supported */
vfmt = tegra_core_get_format_by_fourcc(chan, pix->pixelformat);
if (!vfmt) {
pix->pixelformat = chan->format.pixelformat;
vfmt = tegra_core_get_format_by_fourcc(chan, pix->pixelformat);
}
fmt.which = V4L2_SUBDEV_FORMAT_TRY;
fmt.pad = 0;
v4l2_fill_mbus_format(&fmt.format, pix, vfmt->code);
ret = v4l2_subdev_call(sd, pad, set_fmt, NULL, &fmt);
if (ret == -ENOIOCTLCMD)
return -ENOTTY;
v4l2_fill_pix_format(pix, &fmt.format);
tegra_channel_set_bytesperline(chan, vfmt, pix);
tegra_channel_fmt_align(chan, vfmt,
&pix->width, &pix->height, &pix->bytesperline);
pix->sizeimage = get_aligned_buffer_size(chan,
pix->bytesperline, pix->height);
if (chan->fmtinfo->fourcc == V4L2_PIX_FMT_NV16)
pix->sizeimage *= 2;
<b>printk("__tegra_channel_try_format ret %d\n", ret);</b>
return ret;
}