- if (ycbcr.chroma_step == 2) {
- /* Semi-planar Y + CbCr or Y + CrCb format. */
- const EGLint attr_list_2plane[] = {
- EGL_WIDTH, buf->width,
- EGL_HEIGHT, buf->height,
- EGL_LINUX_DRM_FOURCC_EXT, fourcc,
- EGL_DMA_BUF_PLANE0_FD_EXT, fds[0],
- EGL_DMA_BUF_PLANE0_PITCH_EXT, pitches[0],
- EGL_DMA_BUF_PLANE0_OFFSET_EXT, offsets[0],
- EGL_DMA_BUF_PLANE1_FD_EXT, fds[1],
- EGL_DMA_BUF_PLANE1_PITCH_EXT, pitches[1],
- EGL_DMA_BUF_PLANE1_OFFSET_EXT, offsets[1],
- EGL_NONE, 0
- };
-
- return dri2_create_image_dma_buf(disp, ctx, NULL, attr_list_2plane);
- } else {
- /* Fully planar Y + Cb + Cr or Y + Cr + Cb format. */
- const EGLint attr_list_3plane[] = {
- EGL_WIDTH, buf->width,
- EGL_HEIGHT, buf->height,
- EGL_LINUX_DRM_FOURCC_EXT, fourcc,
- EGL_DMA_BUF_PLANE0_FD_EXT, fds[0],
- EGL_DMA_BUF_PLANE0_PITCH_EXT, pitches[0],
- EGL_DMA_BUF_PLANE0_OFFSET_EXT, offsets[0],
- EGL_DMA_BUF_PLANE1_FD_EXT, fds[1],
- EGL_DMA_BUF_PLANE1_PITCH_EXT, pitches[1],
- EGL_DMA_BUF_PLANE1_OFFSET_EXT, offsets[1],
- EGL_DMA_BUF_PLANE2_FD_EXT, fds[2],
- EGL_DMA_BUF_PLANE2_PITCH_EXT, pitches[2],
- EGL_DMA_BUF_PLANE2_OFFSET_EXT, offsets[2],
- EGL_NONE, 0
- };
-
- return dri2_create_image_dma_buf(disp, ctx, NULL, attr_list_3plane);
- }
+ return dri2_dpy->image->createImageFromDmaBufs(dri2_dpy->dri_screen,
+ buf->width, buf->height, fourcc,
+ fds, num_fds, pitches, offsets,
+ EGL_ITU_REC601_EXT,
+ EGL_YUV_NARROW_RANGE_EXT,
+ EGL_YUV_CHROMA_SITING_0_EXT,
+ EGL_YUV_CHROMA_SITING_0_EXT,
+ &error,
+ NULL);