[PATCH xserver 1/5] xwayland: Allow "-eglstream" option

Emil Velikov emil.l.velikov at gmail.com
Tue Jun 5 10:41:20 UTC 2018


On 4 June 2018 at 15:37, Olivier Fourdan <fourdan at gmail.com> wrote:
> Hi
>
> On 4 June 2018 at 16:24, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>>
>> On 24 May 2018 at 15:10, Olivier Fourdan <ofourdan at redhat.com> wrote:
>> > The command line option "-eglstream" used to enable EGLi stream support
>> > for NVidia GPU was made available only when Xwayland was built with EGL
>> > stream support enabled.
>> >
>> > Wayland compositors who spawn Xwayland have no easy way to tell whether
>> > or not Xwayland was built with EGL stream support enabled, and adding
>> > "-eglstream" command line option to Xwayland when it wasn't built with
>> > EGL support would prevent Xwayland from starting (“Unrecognized option”
>> > error).
>> >
>> > Make sure we support the command line option "-eglstream" regardless of
>> > EGL stream support in Xwayland, obviously without EGL stream support
>> > this has no effect.
>> >
>> > Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
>> > ---
>> >  hw/xwayland/xwayland.c | 10 ++++------
>> >  1 file changed, 4 insertions(+), 6 deletions(-)
>> >
>> > diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
>> > index 1d6b49979..b4049d2cc 100644
>> > --- a/hw/xwayland/xwayland.c
>> > +++ b/hw/xwayland/xwayland.c
>> > @@ -96,9 +96,7 @@ ddxUseMsg(void)
>> >      ErrorF("-rootless              run rootless, requires wm
>> > support\n");
>> >      ErrorF("-wm fd                 create X client for wm on given
>> > fd\n");
>> >      ErrorF("-listen fd             add give fd as a listen socket\n");
>> > -#ifdef XWL_HAS_EGLSTREAM
>> >      ErrorF("-eglstream             use eglstream backend for nvidia
>> > GPUs\n");
>> > -#endif
>> >  }
>> >
>> >  int
>> > @@ -117,11 +115,9 @@ ddxProcessArgument(int argc, char *argv[], int i)
>> >      else if (strcmp(argv[i], "-shm") == 0) {
>> >          return 1;
>> >      }
>> > -#ifdef XWL_HAS_EGLSTREAM
>> >      else if (strcmp(argv[i], "-eglstream") == 0) {
>> >          return 1;
>> >      }
>> > -#endif
>> >
>> >      return 0;
>> >  }
>> > @@ -988,11 +984,13 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char
>> > **argv)
>> >          else if (strcmp(argv[i], "-shm") == 0) {
>> >              xwl_screen->glamor = 0;
>> >          }
>> > -#ifdef XWL_HAS_EGLSTREAM
>> >          else if (strcmp(argv[i], "-eglstream") == 0) {
>> > +#ifdef XWL_HAS_EGLSTREAM
>> >              use_eglstreams = TRUE;
>> > -        }
>> > +#else
>> > +            ErrorF("xwayland glamor: eglstream backend support not
>> > enabled\n");
>> Something is really weird here:
>>
>> On one hand '-eglstream' is recognised and used (by potential user) on
>> the other "... support is not _enabled_" is printed.
>> Surely you meant "not built", right? After all explicitly passing the
>> enable (runtime) flag should be enough to enable it ;-)
>
>
> Yes, I literally mean "enabled at build time".
>
This wording is even better.

Thanks
Emil


More information about the xorg-devel mailing list