<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 10.09.2020 16:32, Maciej Pijanowski
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:90de6506-9e7f-3994-253a-2fa72c564699@3mdeb.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <p>Hello,<br>
        <br>
        I'm having exactly the same issue as described in the [1].<br>
        I have a custom Yocto build running on the embedded board<br>
        with Mali GPU. Mali GPU was also used in the mentioned thread.<br>
        So maybe there is something in common.<br>
        <br>
        When RDP backend is used as a main backend<br>
        (in the core section) I can see the screen content in the RDP
        client.<br>
        When the core backend is DRM and the RDP is started via the
        screen-share<br>
        plugin, I can only see the black screen in the RDP client
        (although the input works<br>
        correctly).<br>
        <br>
        I tried running the same combination on Fedora VM or on the RPi4<br>
        and in those cases the screen-share works correctly with RDP.<br>
        <br>
        I've been looking for some differences in the logs between those
        setups.<br>
        I have noticed the EGL config in case of Mali to be different
        than in case<br>
        of the other ones.<br>
        <br>
        Mali:<br>
        <br>
      </p>
      <pre class="code highlight" lang="markdown"><span id="LC302" class="line" lang="markdown"><span class="sb">    [07:24:23.919] Bad/unknown DRM format code 0x00000000.</span></span>
<span id="LC303" class="line" lang="markdown"><span class="sb">    [07:24:23.919] Unable to use first choice EGL config with XRGB8888, succeeded with alternate ARGB8888.</span></span>
<span id="LC304" class="line" lang="markdown"><span class="sb">    ...</span></span>
<span id="LC305" class="line" lang="markdown"><span class="sb">    [07:24:23.923] GL version: OpenGL ES 2.0 "fa33ed7"</span></span>
<span id="LC306" class="line" lang="markdown"><span class="sb">    [07:24:23.923] GLSL version: OpenGL ES GLSL ES 1.00</span></span>
<span id="LC307" class="line" lang="markdown"><span class="sb">    [07:24:23.923] GL vendor: ARM</span></span>
<span id="LC308" class="line" lang="markdown"><span class="sb">    [07:24:23.923] GL renderer: Mali-400 MP</span></span>
<span id="LC309" class="line" lang="markdown"><span class="sb">    ...</span></span>
<span id="LC310" class="line" lang="markdown"><span class="sb">    [07:24:24.006] Chosen EGL config details: id:   9 rgba: 8 8 8 8 buf: 32</span></span>
<span id="LC311" class="line" lang="markdown"><span class="sb">    dep: 24 stcl: 8 int: 0-10 type: win|pix|pbf|swap_preserved vis_id: ARGB8888</span></span>
<span id="LC312" class="line" lang="markdown"><span class="sb">    (0x34325241)</span></span>

</pre>
      <p>RPi:<br>
      </p>
      <pre class="code highlight" lang="markdown"><span id="LC330" class="line" lang="markdown"><span class="sb">    [07:04:41.917] GL version: OpenGL ES 3.1 Mesa 20.0.2</span></span>
<span id="LC331" class="line" lang="markdown"><span class="sb">    [07:04:41.917] GLSL version: OpenGL ES GLSL ES 3.10</span></span>
<span id="LC332" class="line" lang="markdown"><span class="sb">    [07:04:41.917] GL vendor: Broadcom</span></span>
<span id="LC333" class="line" lang="markdown"><span class="sb">    [07:04:41.917] GL renderer: V3D 4.2</span></span>
<span id="LC334" class="line" lang="markdown"><span class="sb">    ...</span></span>
<span id="LC335" class="line" lang="markdown"><span class="sb">    [07:04:42.032] Chosen EGL config details: id:  17 rgba: 8 8 8 0 buf: 24 dep:  0 stcl: 0 int: 1-1 type: win vis_id: XRGB8888 (0x34325258)</span></span>


</pre>
      <p>I've changed the format on the RPi ARGB8888 and it still works
        fine.<br>
      </p>
    </blockquote>
    <p>So I've been investigating this issue further. I've checked for
      the pixeldata<br>
      here [2] <br>
      and in the cases with the black screen there was nothing dumped.<br>
      <br>
      I have traced it further back to the glReadPixels call [3]. Once I
      switched<br>
      the pixel format to the PIXMAN_a8b8g8r8 (gl_format to GL_RGBA) it
      started<br>
      to work correctly. Both VNC [4] and RDP backends now work fine
      with the<br>
      screen-share on platform with Mali GPU and libMali blob.<br>
      <br>
      As I got this working, I could just patch the code to use the
      given pixel format.<br>
      But I would prefer to fix things upstream. Any hints on what would
      be "the proper"<br>
      way of fixing this issue are welcome.<br>
      <br>
      I also added Stefan Agner to CC as he was changing this part of
      the code<br>
      lately in screen-share and we were discussing this matter in [5].
      I hope<br>
      this is fine.<br>
      <br>
      Thanks,<br>
      <br>
      [2]
<a class="moz-txt-link-freetext" href="https://gitlab.freedesktop.org/wayland/weston/-/blob/master/compositor/screen-share.c#L888">https://gitlab.freedesktop.org/wayland/weston/-/blob/master/compositor/screen-share.c#L888</a><br>
      [3]
<a class="moz-txt-link-freetext" href="https://github.com/3mdeb/weston/blob/use_GL_RGBA/libweston/renderer-gl/gl-renderer.c#L1551">https://github.com/3mdeb/weston/blob/use_GL_RGBA/libweston/renderer-gl/gl-renderer.c#L1551</a><br>
      [4]
      <a class="moz-txt-link-freetext" href="https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/36">https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/36</a><br>
      [5]
<a class="moz-txt-link-freetext" href="https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/362#note_623870">https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/362#note_623870</a><br>
    </p>
    <blockquote type="cite"
      cite="mid:90de6506-9e7f-3994-253a-2fa72c564699@3mdeb.com">
      <p> <br>
        One more observation - if I forced the DRM backend to use the
        pixman renderer<br>
        (by adding the use-pixman=true in the weston.ini), the cloned
        content appeared<br>
        correctly in the RDP client. Of course the performance and
        usability dropped,<br>
        as the GPU was no longer used for rendering.<br>
        It clearly suggests that the problem is somewhere around the
        Mali library.<br>
        <br>
        Any suggestions how to approach further debugging of these kind
        of issues<br>
        are highly appreciated.<br>
        <br>
        Thank you<br>
        <br>
        [1]
        <a class="moz-txt-link-freetext"
href="https://lists.freedesktop.org/archives/wayland-devel/2019-April/040382.html"
          moz-do-not-send="true">https://lists.freedesktop.org/archives/wayland-devel/2019-April/040382.html</a><br>
      </p>
      <pre class="moz-signature" cols="72">-- 
Maciej Pijanowski
Embedded Systems Engineer
GPG: 9963C36AAC3B2B46
<a class="moz-txt-link-freetext" href="https://3mdeb.com" moz-do-not-send="true">https://3mdeb.com</a> | @3mdeb_com</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-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>
    <pre class="moz-signature" cols="72">-- 
Maciej Pijanowski
Embedded Systems Engineer
GPG: 9963C36AAC3B2B46
<a class="moz-txt-link-freetext" href="https://3mdeb.com">https://3mdeb.com</a> | @3mdeb_com</pre>
  </body>
</html>