<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">El 03/08/18 a las 09:35, Pekka Paalanen
      escribió:<br>
    </div>
    <blockquote type="cite" cite="mid:20180803103546.5ab49f54@eldfell">
      <pre wrap="">On Thu, 12 Jul 2018 13:49:06 +0200
Santiago Otero <a class="moz-txt-link-rfc2396E" href="mailto:sotero@gsertel.com"><sotero@gsertel.com></a> wrote:

</pre>
      <blockquote type="cite">
        <pre wrap="">Hi all,

I have a display device that supports up to three different display 
buffers: one graphic layer and two video layers. The graphic layer is at 
the top (zpos=2).

I'm using Weston (DRM backend) with a Qt5 application at full screen 
(graphic layer). Weston is using pixel format XR24 even if Qt5 is using 
AR24.
</pre>
      </blockquote>
      <pre wrap="">
Hi,

that is intentional, yes. Weston's renderers have been designed to
produce opaque framebuffers, because it assumes the primary plane is
the bottom-most for now.

Weston so far does not support underlays and it might be a lot of work
to support them, but I also think it would be nice to have if it can be
done with "generic userspace" i.e. not having any driver specific
knowledge coded in Weston or weston.ini.</pre>
    </blockquote>
    Hi,<br>
    I was able to make it work with two changes:<br>
    1-Force Weston to use a ARGB format with option
    "gbm-format=argb8888"<br>
    2-Patch gl-renderer.c to render with alpha: glBlendFunc(GL_ONE,
    GL_ZERO) => glBlendFunc(GL_SRC_ALPHA, GL_SRC_ALPHA);<br>
    <blockquote type="cite" cite="mid:20180803103546.5ab49f54@eldfell">
      <pre wrap="">

</pre>
      <blockquote type="cite">
        <pre wrap="">In another application I have a video player application that renders by 
DRM into a video layer (zpos=1). The problem is that the HW alpha 
composition is not working due to Weston pixel format and because of 
that I'm unable to see the video layer.
</pre>
      </blockquote>
      <pre wrap="">
No, you cannot use another KMS application at the same time as Weston
is active. The kernel DRM core will forbid access (denies DRM Master
status) if there is already something using KMS, so at any time you can
only run either Weston or some other DRM KMS app.

The fact that you think it is possible suggests that you are using a
deliberately broken downstream kernel. A normal upstream kernel would
deny this.
</pre>
    </blockquote>
    I think there's no need to get DRM Master if you only want to use
    another different  plane for drawing (/dev/dri/controlD64). I've got
    it working this way. <br>
    <br>
    <blockquote type="cite" cite="mid:20180803103546.5ab49f54@eldfell">
      <pre wrap="">
</pre>
      <blockquote type="cite">
        <pre wrap="">Is there any configuration option to force Weston to use AR24?
</pre>
      </blockquote>
      <pre wrap="">
Sorry, no, we will not take changes into Weston upstream that depend on
features that the kernel upstream specifically rejects (multiple DRM
masters or the equivalent on the same DRM device).

You could get around the single DRM master limitation by using DRM
leases, but AFAIK, you cannot lease just some planes of a CRTC, you
have to lease the CRTC as a whole, which means you still cannot have
one process driving one plane and another process driving another plane
on the same CRTC (output). Yet.

If it becomes bossible via DRM leases in upstream kernel, then we can
discuss this again. However, bare in mind, that the design is that
Weston will be in full control of all outputs it touches, which means
that leasing out a plane instead of a whole CRTC will need a glitch-free
synchronization protocol between Weston and the app.

My recommendation instead is to rearchitect your software stack so that
Weston will be the only KMS app in the system, and video players push
their content via Wayland through Weston, using e.g. the Wayland dmabuf
extension and Weston's support for overlays (and underlays, if someone
implements them).

</pre>
    </blockquote>
    I've tried to make it work with Wayland dmabuf with little success.
    The performance was bad, there was tearing and it didn't work for
    HDR video due to some KMS/DRM properties that I need to set. Using
    patched Weston and my player with KMS, now it's working right.<br>
    <br>
    <blockquote type="cite" cite="mid:20180803103546.5ab49f54@eldfell">
      <pre wrap="">
Thanks,
pq
</pre>
      <br>
    </blockquote>
    Thank you very much.<br>
    <blockquote type="cite" cite="mid:20180803103546.5ab49f54@eldfell">
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
wayland-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/wayland-devel">https://lists.freedesktop.org/mailman/listinfo/wayland-devel</a>
</pre>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>