[Spice-devel] [PATCH x11spice 1/2] Provide compatibility for Glamor in Xorg 1.17.

Frediano Ziglio fziglio at redhat.com
Wed Jul 31 16:15:34 UTC 2019


> 
> Signed-off-by: Jeremy White <jwhite at codeweavers.com>
> ---
>  spice-video-dummy/src/dummy.h             |  4 ++--
>  spice-video-dummy/src/spicedummy_driver.c | 11 ++++++++++-
>  2 files changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/spice-video-dummy/src/dummy.h b/spice-video-dummy/src/dummy.h
> index a2502902..af77c177 100644
> --- a/spice-video-dummy/src/dummy.h
> +++ b/spice-video-dummy/src/dummy.h
> @@ -11,11 +11,11 @@
>  #endif
>  #include <string.h>
>  
> -#include "compat-api.h"
> -
>  #define GLAMOR_FOR_XORG 1
>  #include "glamor.h"
>  
> +#include "compat-api.h"
> +
>  /* Supported chipsets */
>  typedef enum {
>      DUMMY_CHIP

I don't understand this hunk and the relationship with the
subjects.

> diff --git a/spice-video-dummy/src/spicedummy_driver.c
> b/spice-video-dummy/src/spicedummy_driver.c
> index fc355f85..415f07dc 100644
> --- a/spice-video-dummy/src/spicedummy_driver.c
> +++ b/spice-video-dummy/src/spicedummy_driver.c
> @@ -558,6 +558,15 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)
>      int ret;
>      VisualPtr visual;
>      void *pixels;
> +    int glamor_flags = GLAMOR_USE_EGL_SCREEN;
> +
> +    /* With Xorg prior to 1.18, we want more more flags in glamor_init */
> +#if defined(GLAMOR_USE_SCREEN)
> +    glamor_flags |= GLAMOR_USE_SCREEN;
> +#endif
> +#if defined(GLAMOR_USE_PICTURE_SCREEN)
> +    glamor_flags |= GLAMOR_USE_PICTURE_SCREEN;
> +#endif
>  
>      /*
>       * we need to get the ScrnInfoRec for this screen, so let's allocate
> @@ -618,7 +627,7 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)
>      /* must be after RGB ordering fixed */
>      fbPictureInit(pScreen, 0, 0);
>  
> -    if (dPtr->glamor && !glamor_init(pScreen, GLAMOR_USE_EGL_SCREEN)) {
> +    if (dPtr->glamor && !glamor_init(pScreen, glamor_flags)) {
>          xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
>                     "Failed to initialise glamor at ScreenInit() time.\n");
>          return FALSE;

That part is clear. But I would add also why you want these additional
flags. Note that due to ABI changes could be that you will use new Glamor
with old flags. So I suppose that the additional flags turns on some
feature not required. It's weird that the comment is stating that these
flags are for earlier version, like they removed from Glamor.
So that means that they (Xorg) removed API compatibility removing these
macros?
Were these flags enabling some old screen rendering now all replaced
by EGL ?

Frediano


More information about the Spice-devel mailing list