[Mesa-dev] [PATCH v3] egl/dri2: implement platform_surfaceless (v3)

Emil Velikov emil.l.velikov at gmail.com
Thu Jun 11 03:06:15 PDT 2015


On 11 June 2015 at 10:02, Marek Olšák <maraeo at gmail.com> wrote:
> On Thu, Jun 11, 2015 at 1:59 AM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>> Hi gents,
>>
>> On 10 June 2015 at 23:20, Zach Reizner <zachr at google.com> wrote:
>>> From: Haixia Shi <hshi at chromium.org>
>>>
>>> The surfaceless platform is for off-screen rendering only. Render node support
>>> is required.
>>>
>>> Only consider the render nodes. Do not use normal nodes as they require
>>> auth hooks.
>>>
>>> v3: egl/dri2: change platform_null to platform_surfaceless
>>>
>> Normal approach in mesa is to list the changes in each version either
>> in the commit message or after the --- line. Resending revised patch
>> while keeping the same version tag is confusing/misleading.
>>
>>> Signed-off-by: Haixia Shi <hshi at chromium.org>
>>> Signed-off-by: Zach Reizner <zachr at google.com>
>>> ---
>>>  configure.ac                                |   3 +-
>>>  src/egl/drivers/dri2/Makefile.am            |   5 +
>>>  src/egl/drivers/dri2/egl_dri2.c             |  13 ++-
>>>  src/egl/drivers/dri2/egl_dri2.h             |   3 +
>>>  src/egl/drivers/dri2/platform_surfaceless.c | 167 ++++++++++++++++++++++++++++
>>>  src/egl/main/Makefile.am                    |   4 +
>>>  src/egl/main/egldisplay.c                   |   3 +-
>>>  src/egl/main/egldisplay.h                   |   1 +
>>>  8 files changed, 194 insertions(+), 5 deletions(-)
>>>  create mode 100644 src/egl/drivers/dri2/platform_surfaceless.c
>>>
>>> diff --git a/configure.ac b/configure.ac
>>> index 4ed4b74..c91c616 100644
>>> --- a/configure.ac
>>> +++ b/configure.ac
>>> @@ -1789,7 +1789,7 @@ for plat in $egl_platforms; do
>>>                         AC_MSG_ERROR([EGL platform drm requires libdrm >= $LIBDRM_REQUIRED])
>>>                 ;;
>>>
>>> -       android|gdi|null)
>>> +       android|gdi|surfaceless|null)
>> Afaict surfaceless does require libdrm. Would be nice to check if the
>> LIBDRM_REQUIRED provides all the requirements, and bump it otherwise.
>>
>>> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
>>> index a428f28..b7ec811 100644
>>> --- a/src/egl/drivers/dri2/egl_dri2.c
>>> +++ b/src/egl/drivers/dri2/egl_dri2.c
>>> @@ -541,7 +541,7 @@ dri2_setup_screen(_EGLDisplay *disp)
>>>           disp->Extensions.KHR_gl_texture_2D_image = EGL_TRUE;
>>>           disp->Extensions.KHR_gl_texture_cubemap_image = EGL_TRUE;
>>>        }
>>> -#ifdef HAVE_LIBDRM
>>> +#if defined(HAVE_DRM_PLATFORM) || defined(HAVE_SURFACELESS_PLATFORM)
>> Why change HAVE_LIBDRM to HAVE_DRM_PLATFORM - rebase slip ? If so we
>> can drop these changes altogether.
>>
>>
>>> --- /dev/null
>>> +++ b/src/egl/drivers/dri2/platform_surfaceless.c
>>
>>> +EGLBoolean
>>> +dri2_initialize_surfaceless(_EGLDriver *drv, _EGLDisplay *disp)
>>> +{
>>
>>> +   for (i = 0; dri2_dpy->driver_configs[i]; i++) {
>>> +      EGLint attr_list[1];
>>> +      attr_list[0] = EGL_NONE;
>> Bikeshed:
>> Please add an empty line between variable declaration and code +
>> initialise the variable on declaration. Just like you've already done
>> in other parts of the patch.
>>
>>> +      dri2_add_config(disp, dri2_dpy->driver_configs[i],
>>> +                      i + 1, EGL_WINDOW_BIT, attr_list, NULL);
>>> +   }
>>> +
>>> +   disp->Extensions.KHR_image_base = EGL_TRUE;
>>> +
>>> +   /* we're supporting EGL 1.4 */
>>> +   disp->VersionMajor = 1;
>>> +   disp->VersionMinor = 4;
>>> +
>> Marek had a patch that drops these from the platform backends yet it
>> seems like it never landed :'-(
>
> It did land:
> http://cgit.freedesktop.org/mesa/mesa/commit/?id=efda9c56491f5cb90e77f5fe7979477fc9b2b529
>
Ouch I had 10.6 checked out. Thanks ! Looks like we're missed Haiku
with the follow up change (egl: combine VersionMajor and VersionMinor
into one variable) - will send a patch in a second.

Cheers
Emil


More information about the mesa-dev mailing list