This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: VIP input data

Part Number: AM5728

Tool/software: Linux

Hello,

we connected an adv7842 to the vip on the evm5728. Full HD Picture is received and can be displayed with dmabuftest tool, but colors look strange. Adv7842 outputs data in 16-Bit ITU-656 SDR mode. Device tree has bus-width=<16> configuration. Colorspace output on adv7842 is YPbPr.

Questions:

1. Is connection via 16 bit bus to vip ok for MEDIA_BUS_FMT_UYVY8_2X8? Or does this format require 8bit bus with two bytes sampled sequential?

2. Does vip only sample on one clock edge or does it support ddr mode too?

3. What could be the problem with the wrong colors?

Thanks in advance

  • Hi,

    I've notified the video experts. Feedback will be posted here.

    Best Regards,
    Yordan
  • Hello,
    the problem with colors is fixed. Cr/Cb data was swapped and also pins for Y and CR/Cb were swapped. But there is a black area to the left and above the image. We just connected the data enable signal, but this didn't change anything. Do we have to enable the data enable signal in linux?? Or is there another way to get rid of the black areas?


    Device tree:

    &i2c5 {
    status = "okay";
    clock-frequency = <400000>;

    mt9t11x@3C {
    compatible = "aptina,mt9t111";
    reg = <0x3C>;

    reset-gpios = <&gpio4 17 GPIO_ACTIVE_LOW>;
    oscen-gpios = <&gpio5 10 GPIO_ACTIVE_HIGH>;
    powerdown-gpios = <&gpio5 11 GPIO_ACTIVE_LOW>;
    bufen-gpios = <&gpio5 12 GPIO_ACTIVE_LOW>;
    camen-gpios = <&gpio6 11 GPIO_ACTIVE_LOW>;

    port {
    cam: endpoint {
    remote-endpoint = <&vin3a>;
    hsync-active = <1>;
    vsync-active = <1>;
    pclk-sample = <0>;
    bus-width = <16>;
    };
    };
    };
    };


    Dummy subdevice driver just reports a fixed format. Device starts streaming immediately after startup.


    static void mt9t11x_get_default_format(struct mt9t11x_priv *priv,
    struct v4l2_mbus_framefmt *mf)
    {
    struct v4l2_rect rect = {
    .width = 1920,
    .height = 1080,
    .left = (MAX_WIDTH - 1920) / 2,
    .top = (MAX_HEIGHT - 1080) / 2,
    };

    priv->frame = rect;

    /* Need fixing */
    mf->width = rect.width;
    mf->height = rect.height;
    mf->colorspace = V4L2_COLORSPACE_BT2020;
    mf->code = MEDIA_BUS_FMT_UYVY8_2X8;

    mf->field = V4L2_FIELD_NONE;
    mf->ycbcr_enc = V4L2_YCBCR_ENC_BT2020;
    }


    static int mt9t11x_get_fmt(struct v4l2_subdev *sd,
    struct v4l2_subdev_pad_config *cfg,
    struct v4l2_subdev_format *fmt)
    {
    struct mt9t11x_priv *priv = sd_to_mt9t11x(sd);
    struct v4l2_mbus_framefmt *mf = &fmt->format;

    mt9t11x_get_default_format(priv, mf);

    return 0;
    }



    static int mt9t11x_set_fmt(struct v4l2_subdev *sd,
    struct v4l2_subdev_pad_config *cfg,
    struct v4l2_subdev_format *fmt)
    {
    struct mt9t11x_priv *priv = sd_to_mt9t11x(sd);
    unsigned int index = priv->num_formats;
    struct v4l2_mbus_framefmt *mf = &fmt->format;
    int ret = 0;
    struct v4l2_rect rect;

    mt9t11x_get_default_format(priv, mf);

    return 0;
    }



    static int mt9t11x_enum_mbus_code(struct v4l2_subdev *sd,
    struct v4l2_subdev_pad_config *cfg,
    struct v4l2_subdev_mbus_code_enum *code)
    {
    struct mt9t11x_priv *priv = sd_to_mt9t11x(sd);

    if (code->index >= 1)
    return -EINVAL;

    code->code = MEDIA_BUS_FMT_UYVY8_2X8;

    return 0;
    }




    static int mt9t11x_enum_frame_sizes(struct v4l2_subdev *sd,
    struct v4l2_subdev_pad_config *cfg,
    struct v4l2_subdev_frame_size_enum *fse)
    {
    struct mt9t11x_priv *priv = sd_to_mt9t11x(sd);
    int i = priv->num_formats;

    if (fse->index >= 1)
    return -EINVAL;

    fse->code = MEDIA_BUS_FMT_UYVY8_2X8;

    fse->min_width = 1920;
    fse->max_width = fse->min_width;
    fse->max_height = 1080;
    fse->min_height = fse->max_height;

    return 0;

    }



    static int mt9t11x_s_stream(struct v4l2_subdev *sd, int enable)
    {

    return 0;
    }