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/DRA724: Use drmModeSetPlane to display with full fps get tearing on GLSDK7.04

Part Number: DRA725

Tool/software: Linux v3.14

Hello experts,

    When I use drmModeSetPlane to display and the video in for display is 25fps, it will get tearing with lcd refresh is 30fps, but i set the lcd refresh to 60fps , it will fine to display . My project is use GLSDK 7.04.

    I find below info on this forum.

http://e2e.ti.com/support/arm/sitara_arm/f/791/p/482571/1744735

"It's true that in v3.14 kernel you could call drmModeSetPlane() and sometimes achieve full fps, but it was mostly working by luck. Often using drmModeSetPlane() with other modesetting would result in halved fps, or tearing as the app can't know when drmModeSetPlane() is finished.

"

    Does this mean i can't use drmModeSetPlane anymore on glsdk?  

    From my understand, the drmModePageFlip() just work with the gfx(plane) and crtc, not suit for the video planes and muti-planes.

    If i want use muti-planes to display on glsdk, is there anyway to achieve this?

    Any guidance would be appreciated.
    Best regards
    Sid
  • Hi Sid,

    I have forwarded your question to graphics experts.

    Regards,
    Yordan
  • Hi Sid,

    As discussed in the following thread, you should use drmModePageFlip to flip the buffer to display and wait for vsync:
    e2e.ti.com/.../611021

    To update multiple planes, atomic mode setting should be used. This is supported as part of Processor SDK Linux automotive v3.x on K4.4. You can move to the latest release v3.02 to utilize atomic mode setting:
    processors.wiki.ti.com/.../Category:Processor_SDK_Linux_Automotive

    Regards,
    Anand
  • Hi Anand,
    Thanks for your reply angin.
    This was another project use GLSDK7.04,it will SOP in this mouth, dont have much time move to PSDK 3.02.
    But we use the drmModeSetPlane ,and get tearing when the lcd refresh is 30fps, and the video in for display is 25fps .
    I see some example in dual-camera-demo for glsdk , it use drmModeSetPlane like following code:
    "
    /* Delay queuing the buffer back to capture driver for two display buffer timing */
    /* This is because drmSetModePlane() API is async and doesn't acknowldege when */
    /* the buffer is done displaying. Assuming that two capture frame delays should */
    /* be sufficient to ensure consumption of buffer by display and safe to be queued*/
    /* to capture driver pool */
    if(v4l2_device->b[0] != NULL){
    v4l2_queue_buffer(v4l2_device, v4l2_device->b[0]);
    }

    /* Request a capture buffer from the driver that can be copied to framebuffer */
    buf = v4l2_dequeue_buffer(v4l2_device);

    v4l2_device->b[NBUF-1] = buf;
    i = 0;
    do{
    v4l2_device->b[i] = v4l2_device->b[i+1];
    i++;
    }while(i != (NBUF-1));


    if(pip) {
    ret = drmModeSetPlane(drm_device->fd, drm_device->plane_id[pip],
    drm_device->crtc_id, buf->fb_id, 0,
    /* dst_x, dst_y, dst_w, dst_h */
    25, 25, drm_device->width/3, drm_device->height/3,
    /* src_x, src_y, src_w, src_h*/
    0, 0, v4l2_device->width << 16, v4l2_device->height << 16);
    } else {
    ret = drmModeSetPlane(drm_device->fd, drm_device->plane_id[pip],
    drm_device->crtc_id, buf->fb_id, 0,
    /* make video fullscreen: */
    /* dst_x, dst_y, dst_w, dst_h */
    0, 0, drm_device->width, drm_device->height,
    /* src_x, src_y, src_w, src_h*/
    0, 0 , v4l2_device->width << 16, v4l2_device->height << 16);
    }

    if (ret) {
    ERROR("failed to enable plane %d: %s",
    drm_device->plane_id[pip], strerror(errno));
    }
    "

    I want also use three bufferes to do ping-pong circle in kmscube, but cause i am a newbee to gpu program, i dont know how to modify the code, in kmscube code on glsdk , there only use two bufferes do ping-pong circle, just like my project was done. I think add more buffer to play circle will reduce the tearing effect .
    Do you know how to use three bufferes to do ping-pong circle in kmscube(GLSDK)?

    Best regards
    Sid
  • Hi Sid,

    We are continuing discussion on other forum. Hence, we would like to mark this thread closed.

    Regards,
    Anand