<div dir="ltr">Hi,<div class="gmail_extra"><br><div class="gmail_quote">On 28 November 2014 at 09:17, Thierry Reding <span dir="ltr"><<a href="mailto:thierry.reding@gmail.com" target="_blank">thierry.reding@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Fri, Nov 28, 2014 at 12:32:43AM -0500, Ilia Mirkin wrote:<span style="color:rgb(34,34,34)">> Also, can you explain why it's advantageous for the setup to appear as</span><br></div></div><span class="">
> though it is a single device? i.e. what's wrong with just using<br>
> nouveau as a render node or whatever? [The answer may be simple, but<br>
> I'm very unfamiliar with a lot of that stuff, and perhaps others are<br>
> in a similar predicament.]<br>
<br>
</span>There are two reasons. For one, pretty much every software out there<br>
that runs on the "bare metal" (i.e. GBM) uses the same initialization<br>
sequence and it doesn't involve opening two DRM devices. So in order to<br>
support Tegra and other SoCs with a similar architecture, each of these<br>
applications would need to be patched. Now typically a lot of the<br>
applications would run under X or Wayland, so the number of applications<br>
that need patching is somewhat reduced. However, it would still mean<br>
that every Wayland compositor would need to be patched in order to<br>
support this, and each of them would use a mostly identical copy of that<br>
code.<br></blockquote><div><br></div><div>More specifically, the gbm/EGL API works thusly:</div><div>  drm_fd = drmOpen("display_controller");</div><div>  gbm_dev = gbm_create_device(drm_fd);</div><div>  egl_dpy = eglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_EXT, gbm_dev, NULL);</div><div><br></div><div>So in the last stage, you have to magically infer a relationship between your display controller's device and your GPU's. On most mobile devices you can just work this out (there's only one GPU), but it also breaks in the multi-GPU case.</div><div><br></div><div>The best idea I've come up with to fix this in the long term, is to use EGL_EXT_device_base to enumerate the GPUs and then feed the device ID you get from that as a new attrib to eglGetPlatformDisplayEXT. It's either that, or a new gbm_device_create_multi(display_controller_fd, gpu_fd) entrypoint.</div><div><br></div><div>Of course, the first complication in all of this is that Weston doesn't support platform_base at all anyway ...</div><div><br></div><div>Cheers,</div><div>Daniel</div></div></div></div>