<div dir="ltr">Would kms_swrast + vgem for surfaceless also work for the use case raised in the bug, or is that a no-go because it assumes the presence of a driver? I've been testing it[1], it works pretty well, except for one issue during ChromeOS startup.<div class="gmail_extra"><br></div><div class="gmail_extra">[1] <a href="https://chromium-review.googlesource.com/c/558218">https://chromium-review.googlesource.com/c/558218</a></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 2, 2017 at 4:05 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">[+Chad]<br>
<br>
Hi Akihiko Odaki,<br>
<br>
Thank you for the patch and welcome to Mesa!<br>
<br>
How you tested this patch? Did you run a test suite like piglit, dEQP, etc?<br>
Can you give it a spin with either one of these, comparing HW vs<br>
swrast surfacess and share the results.<br>
<span><br>
On 1 August 2017 at 06:49, Akihiko Odaki <<a href="mailto:nekomanma@pixiv.co.jp" target="_blank">nekomanma@pixiv.co.jp</a>> wrote:<br>
> Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=101397" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/s<wbr>how_bug.cgi?id=101397</a><br>
> ---<br>
> src/egl/drivers/dri2/platform_<wbr>surfaceless.c | 114 ++++++++++++++++++++++++++--<br>
> src/gallium/state_trackers/dri<wbr>/drisw.c | 45 ++++++++++-<br>
</span>A general rule of thumb - the difference in paths indicate these two<br>
are distinct components.<br>
As such they ought to be separate patches.<br>
<br>
But before that, please look at my other comment below.<br>
<div><div class="gmail-m_-184050830769618726h5"><br>
> 2 files changed, 148 insertions(+), 11 deletions(-)<br>
><br>
> diff --git a/src/egl/drivers/dri2/platfor<wbr>m_surfaceless.c b/src/egl/drivers/dri2/platfor<wbr>m_surfaceless.c<br>
> index 1091b4febd..5487c89816 100644<br>
> --- a/src/egl/drivers/dri2/platfor<wbr>m_surfaceless.c<br>
> +++ b/src/egl/drivers/dri2/platfor<wbr>m_surfaceless.c<br>
> @@ -133,9 +133,16 @@ dri2_surfaceless_create_surfac<wbr>e(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,<br>
> if (!config)<br>
> goto cleanup_surface;<br>
><br>
> - dri2_surf->dri_drawable =<br>
> - dri2_dpy->image_driver->create<wbr>NewDrawable(dri2_dpy->dri_<wbr>screen, config,<br>
> - dri2_surf);<br>
> + if (dri2_dpy->image_driver) {<br>
> + dri2_surf->dri_drawable =<br>
> + dri2_dpy->image_driver->creat<wbr>eNewDrawable(dri2_dpy->dri_<wbr>screen, config,<br>
> + dri2_surf);<br>
> + } else {<br>
> + assert(dri2_dpy->swrast);<br>
> + dri2_surf->dri_drawable =<br>
> + dri2_dpy->swrast->createNewDr<wbr>awable(dri2_dpy->dri_screen, config,<br>
> + dri2_surf);<br>
> + }<br>
> if (dri2_surf->dri_drawable == NULL) {<br>
> _eglError(EGL_BAD_ALLOC, "image->createNewDrawable");<br>
> goto cleanup_surface;<br>
> @@ -229,7 +236,24 @@ surfaceless_add_configs_for_vi<wbr>suals(_EGLDriver *drv, _EGLDisplay *dpy)<br>
> return (config_count != 0);<br>
> }<br>
><br>
> -static const struct dri2_egl_display_vtbl dri2_surfaceless_display_vtbl = {<br>
> +static const struct dri2_egl_display_vtbl dri2_surfaceless_swrast_displa<wbr>y_vtbl = {<br>
> + .create_pixmap_surface = dri2_fallback_create_pixmap_su<wbr>rface,<br>
> + .create_pbuffer_surface = dri2_surfaceless_create_pbuffe<wbr>r_surface,<br>
> + .destroy_surface = surfaceless_destroy_surface,<br>
> + .create_image = dri2_create_image_khr,<br>
> + .swap_interval = dri2_fallback_swap_interval,<br>
> + .swap_buffers = surfaceless_swap_buffers,<br>
> + .swap_buffers_region = dri2_fallback_swap_buffers_reg<wbr>ion,<br>
> + .set_damage_region = dri2_fallback_set_damage_regio<wbr>n,<br>
> + .post_sub_buffer = dri2_fallback_post_sub_buffer,<br>
> + .copy_buffers = dri2_fallback_copy_buffers,<br>
> + .query_buffer_age = dri2_fallback_query_buffer_age<wbr>,<br>
> + .create_wayland_buffer_from_i<wbr>mage = dri2_fallback_create_wayland_b<wbr>uffer_from_image,<br>
> + .get_sync_values = dri2_fallback_get_sync_values,<br>
> + .get_dri_drawable = dri2_surface_get_dri_drawable,<br>
> +};<br>
> +<br>
> +static const struct dri2_egl_display_vtbl dri2_surfaceless_dri3_display_<wbr>vtbl = {<br>
> .create_pixmap_surface = dri2_fallback_create_pixmap_su<wbr>rface,<br>
> .create_pbuffer_surface = dri2_surfaceless_create_pbuffe<wbr>r_surface,<br>
> .destroy_surface = surfaceless_destroy_surface,<br>
> @@ -252,6 +276,66 @@ surfaceless_flush_front_buffer<wbr>(__DRIdrawable *driDrawable, void *loaderPrivate)<br>
> {<br>
> }<br>
><br>
> +static const __DRIextension *swrast_loader_extensions[] = {<br>
> + NULL,<br>
</div></div>I'm not 100% sure if it makes sense, for swrast at least, to have no<br>
loader extensions.<br>
<br>
Need to think about this a bit more. Although a related series comes<br>
to mind [1].<br>
It adds partial DRI_IMAGE support to state_trackers/dri/drisw.<br>
<br>
I'm wondering if we cannot reuse/share some goals across the board.<br>
<br>
Thanks<br>
Emil<br>
<br>
[1] <a href="https://patchwork.freedesktop.org/project/mesa/patches/?submitter=16100&state=&q=&archive=&delegate=" rel="noreferrer" target="_blank">https://patchwork.freedesktop.<wbr>org/project/mesa/patches/?subm<wbr>itter=16100&state=&q=&archive=<wbr>&delegate=</a><br>
<div class="gmail-m_-184050830769618726HOEnZb"><div class="gmail-m_-184050830769618726h5">______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div></div>