QuadMax DPU and NV12 G2D destination on the i.MX8 QuadMax

Showing results for 
Search instead for 
Did you mean: 

QuadMax DPU and NV12 G2D destination on the i.MX8 QuadMax

Contributor II

In a past Yocto Release (thud I think), there was a v4l2videoconvert GStreamer element. The DPU was accessible through that element. And I clearly remember that BGRx -> NV12 video format conversions were possible with this.

In Yocto Dunfell, v4l2videoconvert is no longer available. However, the G2D API is emulated on top of the DPU on QuadMax machines (through the imx-dpu-g2d package). The code in the G2D library in imx-gst1.0-plugin indicates that the emulated G2D can handle UYVY, YUYV (=YUY2), and NV12 as the destination format. When I try to use G2D for BGRx -> UYVY conversion, it works. Conversion to YUYV, also works. But NV12 fails with this error:

"g2d_opencl_conversion opencl conversion does not support input format 4"

Is this a known bug? If so, any suggestions on how to get NV12 destination support working when using G2D? The Amphion Windsor encoder on the QuadMax needs NV12 data, which is why this conversion is essential. And, on the QuadMax, I don't see any other hardware unit that could do conversions to NV12.

From what I gather, the conversion to NV12 is done through OpenCL. My question though is whether this NV12 output is limited to conversion from tiled Amphion frames to NV12, and converting any other format to NV12 is unsupported.


EDIT: It turns I was incorrect. v4l2videoconvert is still available, but the associated driver not enabled in that Yocto release. Also, it uses the ISI (Image Sensing Interface), not the DPU.

0 Kudos
2 Replies

NXP TechSupport
NXP TechSupport

Hello crg,

if you read the imx graphics user guide for g2d, for g2d_surface it states,

"RGB and YUV formats can be set in source surface, but only RGB format can be set in destination surface."

For imx8qm, we used gpu-dpu to do color space conversion, there are more formats to be supported by opencl, your code goes to opencl color space conversion.

but still if dest surface format is NV12, for linear tiling surface, only YUYV is supported for source surface,

RGBx to NV12 is not supported.

I think you caught this line of code:

else if (srcEx->tiling == G2D_LINEAR && dstEx->tiling == G2D_LINEAR) { if (src->format != G2D_YUYV) { g2d_printf ("%s opencl conversion does not support input format %d \n", __FUNCTION__, src->format); return G2D_STATUS_FAIL; }


Is this issue you are experiencing is regression?  which means it was supported before, but not in recent bsp?


0 Kudos

Contributor II

I can't reconstruct the older case where apparently RGB->NV12 worked with the DPU. It is also unclear by now if this really was the DPU, or rather the ISI, and this was all confused here.

Still, I strongly recommend adding RGB -> NV12 to imx-g2d-dpu. The Amphion Windsor encoder _only_ supports NV12 input. Excluding that very important format makes little sense.

0 Kudos