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/DRA746: questions on libdce/ompdrmtest buffer management for video decoder output

Part Number: DRA746

Tool/software: Linux

there are libdce test for Linux/DRM at git.ti.com/.../

after went through the code, i had some questions:
1. app (basing on libdce) must open drm device, and gst-plugins-ducati does it in the similar way, right?
I mean to "global_fd = drmOpen("omapdrm", NULL);"
is there any potential security issue?
how about does it in dce_init() instead?

2. there is no DRI2Authenticate() in display-wayland.c, why?

3. I want to give a quick try by skipping video rendering on a Wayland platform, then I can ignore all wayland operation in display-wayland.c
is it doable?

by the way, it seems there is a mistake in display-wayland.c line 086--093
I think the alignment should be done during omap_bo_new(), not after that, something like:
*pitch = ALIGN2(width*bpp/8, PAGE_SHIFT),
bo = omap_bo_new(disp->dev, pitch*height, bo_flags)
....
otherwise, when video width is much smaller comparing to pitch. bo_data_size/pitch will less than original height. for example:( assume bpp=8), 176x144 video resolution may create bo with size of 176x144x4; if pitch is 176x8, then we got final height of 144/2)

after another thought, use bpp to calculate pitch also doesn't sound good enough.

  • Hi Halley,

    I have forwarded your question to an expert to comment.

    Regards,
    Yordan
  • Hi Halley,
    1) omap_drm driver has a refCount management, it takes care of number of drmOpens.
    2) It is required in X11 case but not required for wayland I guess.
    3) You can try kms or kmscube . Is it what looking ?
    4) Adjusting the pitch is required if the buffrers are in TILER2D.
  • thanks.

    as to 2. from my understanding, DRI2Authenticate related to dri/drm. it is independent from x11 or wayland.

    as to 4. take special case, let video resolution be 2*4096; then the final bo size may be 4*4096, with pitch as 4096.
    then, you will treat the video height as 4*4096/4096 = 4. it is incorrect.
    so you'd calculate picth before omap_bo_new().
  • Hi Halley,
    *pitch = width * bpp / 8;--------> This will be actual pitch which is dependent on width and color-format.
    if (bo_flags & OMAP_BO_TILED)
    *pitch = ALIGN2(*pitch, PAGE_SHIFT);-------> In this case pitch will be either 4096 or 8192 .

    In util/display-x11.c, DRI2Authenticate() is being called and for wayland, util/wayland-drm-client-protocol.h defines authenticate function but not used. I will check this and let you know.

    Ramprasad
  • sorry, we haven't reach the same page for pitch yet.
    (let's ignore bpp, or sait it is 8)
    omap_bo_new() allocate mem, it respects width*height. result in bo_size, which is not less than width*height.
    video dsp will use this bo at any pitch greater than width; plus hw align requirement. it has nothing to do with height.
    then picth *heigh may great than bo_size. it will lead to failure.