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/DRA725: Support NV21 format input in DSS

Part Number: DRA725

Tool/software: Linux

Hi Expert,

    DRA7xx TRM say it supports NV21 format input, so far the Linux DRM/DSS driver can not input the format as NV21. Would you please suggest how to change the driver code to support that? If need reprogram the VIDx_FIR_COEF_H_i /DISPC_VIDx_FIR_COEF_HV_i, DISPC_VIDx_CONV_COEFx, any suggested value?

Best Regards.

   Marvin

  • Marvin,

    If you want to only support NV21 buffers and not support NV12 buffers for a specific platform, then this is fairly straightforward.

    You can modify the function dispc_setup_color_conv_coef in drivers/gpu/drm/omapdrm/dss/dispc.c and swap the values of rcr and rcb (same with gcr, bcr and gcb, bcb).

    Then all FBs created with drmModeAddFB2(..., DRM_FORMAT_NV12, ) will automatically be treated as NV21 buffers.

    However, if you want to add support for NV21 (as well as retain support for NV12), then you need to modify dispc_setup_color_conv_coef() to accept the CSC coefficients and call it from dispc_ovl_setup_common().

    Regards,

    Subhajit

  • Subhajit,
    We tried below:
    dispc_write_reg(DISPC_OVL_CONV_COEF(plane, 0), CVAL(ct->rcb, ct->ry));
    dispc_write_reg(DISPC_OVL_CONV_COEF(plane, 1), CVAL(ct->gy, ct-> rcr));
    dispc_write_reg(DISPC_OVL_CONV_COEF(plane, 2), CVAL(ct->gcr, ct-> gcb));
    dispc_write_reg(DISPC_OVL_CONV_COEF(plane, 3), CVAL(ct->bcb, ct->by));
    dispc_write_reg(DISPC_OVL_CONV_COEF(plane, 4), CVAL(0, ct->bcr));

    And confirmed the register already updated.

    Value(Before patched) Value(after patched)
    DISPC_VIDX_CONV_CONEF1 0X199012A 0X12A
    DISPC_VIDX_CONV_CONEF2 0X12A0000 0X12A0199
    DISPC_VIDX_CONV_CONEF3 0X79C0730 0X730079C
    DISPC_VIDX_CONV_CONEF4 0X12A 0X205012A
    DISPC_VIDX_CONV_CONEF5 0X205 0X0

    the NV21 image is not correctly displayed with above change. Would you suggest more?

    Best Regards.
    Marvin
  • Hi Marvin,

    I believe this question has been addressed now. Can you please confirm?

    Regards,
    Anand
  • Anand,
    Right, I have changed it to resolved.
    Regards,
    Marvin