<div dir="ltr">Ping...<div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 21, 2017 at 4:40 PM, Gurchetan Singh <span dir="ltr"><<a href="mailto:gurchetansingh@chromium.org" target="_blank">gurchetansingh@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Emil,</div><div><br></div><div>If I understand you correctly, you're proposing to add the ability to use the kms_swrast driver in platform_x11.c (the host is a standard Ubuntu box for the emulator use case, not CrOS) alongside swrast.</div><div><br></div><div>In that case, we would need to:</div><div><br></div><div>1) Have a dri2_initialize_x11_kms_swrast function that's called when some environment variable is set instead of dri2_initialize_x11_swrast.</div><div>2) dri2_initialize_x11_kms_swrast would need access to the host card fd (dri_kms_init_screen requires this) and call dri2_load_driver instead of dri2_load_driver_swrast .</div><div>3) Use dri2_loader_extensions instead of swrast_loader_extensions, dri2_x11_display_vtbl instead dri2_x11_swrast_display_vtbl etc.</div><div><br></div><div>I'm having trouble getting this to work, and I was wondering if what I'm trying to do is what you want.  Attached is the patch I'm trying (it compiles, but will crash your display).</div><div><br></div><div>Regarding the issues with the emulator, I filed a bug based your comments and the emulator team has started looking at it (see <a href="https://android-review.googlesource.com/#/c/418541/" target="_blank">https://android-review.<wbr>googlesource.com/#/c/418541/</a>).</div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 20, 2017 at 1:19 AM, Emil Velikov <span dir="ltr"><<a href="mailto:emil.l.velikov@gmail.com" target="_blank">emil.l.velikov@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="m_-5275387226474685671HOEnZb"><div class="m_-5275387226474685671h5">On 19 June 2017 at 20:46, Chad Versace <<a href="mailto:chadversary@chromium.org" target="_blank">chadversary@chromium.org</a>> wrote:<br>
> On Thu 15 Jun 2017, Gurchetan Singh wrote:<br>
>> Emil, would you be fine with leaving the image extension in dri2.c but still<br>
>> adding it as a drisw extension?  That solution would look like:<br>
>><br>
>> [1]<a href="https://patchwork.freedesktop.org/patch/154807/" rel="noreferrer" target="_blank">https://patchwork.freedeskt<wbr>op.org/patch/154807/</a><br>
><br>
> Observations:<br>
>     - src/gallium/state_trackers/dri<wbr>/dri2.c:dri2ImageExtension advertises v15 of __DRI_IMAGE.<br>
>     - egl_dri2.c requires only v1 of __DRI_IMAGE. Maybe a higher version<br>
>       is required in practive, but the egl_dri2.c code checks only for v1.<br>
><br>
> Questions:<br>
>     1. All functions implemented in dri2.c:dri2ImageExtensions, do they<br>
>        under swrast? Honest question, because I'm no expert on<br>
>        gallium.<br>
><br>
> If question #1 is true, then I see no problem with your latest plan. But<br>
> maybe Emil does.<br>
><br>
> If question #1 is false, it should be straightforward to implement in<br>
> drisw.c the small subset of __DRI_IMAGE functions required for v1.<br>
<br>
</div></div>While I haven't checked how much [or well] DRI_IMAGE works with<br>
swrast, there's no need to actually add it there.<br>
An alternative is to add kms_swrast support for EGL like we already do<br>
for GBM, as mentioned earlier [1].<br>
<br>
Gents, keep in mind that:<br>
 - one cannot pull DRM specifics (dri2.c) code within drisw.c, and<br>
 - DRI_IMAGE pulls DRM specifics, hence adding it into drisw.c is<br>
again a no-go :-\<br>
<br>
FWIW the above architectural split applies for classic drivers as<br>
well. swrast_dri.so simply cannot depend on anything DRM related.<br>
<br>
-Emil<br>
<br>
[1] <a href="https://lists.freedesktop.org/archives/mesa-dev/2017-June/159519.html" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>archives/mesa-dev/2017-June/15<wbr>9519.html</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>