[Mesa-dev] [PATCHES] surfaceless EGL: new DRI extension

nobled nobled at dreamwidth.org
Sun Aug 29 10:54:47 PDT 2010


The current egl_dri2 code for enabling the EGL_KHR_surfaceless_*
extensions is a bit broken right now. First, the code in dri_util.c
and drisw_util.c doesn't check if it gets passed a NULL __DRIconfig*,
leading to segfaults when egl_dri2 does exactly that when creating a
surfaceless context.

Second, egl_dri2's logic for deciding if it *can* create a surfaceless
context doesn't really do that:

   if (dri2_dpy->dri2->base.version >= 2) {
      disp->Extensions.KHR_surfaceless_gles1 = EGL_TRUE;
      disp->Extensions.KHR_surfaceless_gles2 = EGL_TRUE;
      disp->Extensions.KHR_surfaceless_opengl = EGL_TRUE;
   }

But the dri2 extension's version 2 doesn't actually mean "this driver
can create and bind contexts without drawables"--and right now only
the intel drivers can. There should be a new extension to advertise
that capability, like the __DRI_READ_DRAWABLE extension.*

This patch series a) adds an extension for just that:
__DRI_NO_DRAWABLE, b) advertises it in the intel driver, and c)
implements it in swrast and all gallium drivers through st/dri.

http://github.com/nobled/mesa/commits/surfaceless
1. dri_interface.h: Add __DRI_NO_DRAWABLE extension
2. egl_dri2: Require __DRI_NO_DRAWABLE extension for surfaceless EGL
3. dri: Really enable EGL_KHR_surfaceless_* extensions in dri2 (fixes
the segfaults)
4. dri: Enable surfaceless extensions on DRI legacy
5. dri: Provide __DRI_NO_DRAWABLE extension in dri_util
6. intel: Advertise __DRI_NO_DRAWABLE extension
7. dri: Allow EGL_KHR_surfaceless_* in software drivers
8. dri: Provide __DRI_NO_DRAWABLE extension in drisw_util
9. swrast: Implement __DRI_NO_DRAWABLE extension (this patch I'm least
sure of; review?)
10. st/dri: Implement __DRI_NO_DRAWABLE extension (builds on Chia-I
Wu's 41c095bf31cedf4f463e315e8dbad8a007985464 patch)

*BTW, what exactly does __DRI_READ_DRAWABLE require/do? Only GLX's
dri1 code checks it, to enable "GLX_SGI_make_current_read" (which
dri2_glx enables unconditionally), and it's in all the hardware
drivers but not in the swrast driver for some reason.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-dri_interface.h-Add-__DRI_NO_DRAWABLE-extension.patch
Type: text/x-patch
Size: 1396 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100829/a345858c/attachment-0009.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-egl_dri2-Require-__DRI_NO_DRAWABLE-extension-for-su.patch
Type: text/x-patch
Size: 2898 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100829/a345858c/attachment-0010.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-dri-Really-enable-EGL_KHR_surfaceless_-extensions.patch
Type: text/x-patch
Size: 2449 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100829/a345858c/attachment-0011.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-dri-Enable-surfaceless-extensions-on-DRI-legacy.patch
Type: text/x-patch
Size: 1386 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100829/a345858c/attachment-0012.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-dri-Provide-__DRI_NO_DRAWABLE-extension-in-dri_util.patch
Type: text/x-patch
Size: 1624 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100829/a345858c/attachment-0013.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-intel-Advertise-__DRI_NO_DRAWABLE-extension.patch
Type: text/x-patch
Size: 970 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100829/a345858c/attachment-0014.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-dri-Allow-EGL_KHR_surfaceless_-in-software-drivers.patch
Type: text/x-patch
Size: 1927 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100829/a345858c/attachment-0015.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-dri-Provide-__DRI_NO_DRAWABLE-extension-in-drisw_ut.patch
Type: text/x-patch
Size: 1318 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100829/a345858c/attachment-0016.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0010-st-dri-Implement-__DRI_NO_DRAWABLE-extension.patch
Type: text/x-patch
Size: 4418 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100829/a345858c/attachment-0017.bin>


More information about the mesa-dev mailing list