[PATCH 05/27] glamor: Do glyph private init at screeninit time, and other stuff at CSR.

Markus Wick markus at selfnet.de
Wed Mar 12 11:40:18 PDT 2014


Am 2014-03-11 22:30, schrieb Eric Anholt:
> diff --git a/glamor/glamor.h b/glamor/glamor.h
> index e25dc73..9cda46d 100644
> --- a/glamor/glamor.h
> +++ b/glamor/glamor.h
> @@ -131,14 +131,6 @@ extern _X_EXPORT void
> glamor_set_screen_pixmap(PixmapPtr screen_pixmap,
> 
>  extern _X_EXPORT uint32_t glamor_get_pixmap_texture(PixmapPtr pixmap);
> 
> -/* @glamor_glyphs_init: Initialize glyphs internal data structures.
> - *
> - * @pScreen: Current screen pointer.
> - *
> - * This function must be called after the glamor_init and the texture
> - * can be allocated. An example is to call it when create the screen
> - * resources at DDX layer.
> - */
>  extern _X_EXPORT Bool glamor_glyphs_init(ScreenPtr pScreen);

This function isn't (and shouldn't be?) used outside of glamor, so this 
should be moved to glamor_priv.h.

> 
>  extern _X_EXPORT void glamor_set_pixmap_texture(PixmapPtr pixmap,
> diff --git a/glamor/glamor_glyphs.c b/glamor/glamor_glyphs.c
> index caafa43..2b2c735 100644
> --- a/glamor/glamor_glyphs.c
> +++ b/glamor/glamor_glyphs.c
> @@ -370,16 +366,27 @@ glamor_realize_glyph_caches(ScreenPtr pScreen)
>      return FALSE;
>  }
> 
> +/**
> + * Called by glamor_create_screen_resources() to set up the glyph 
> cache.
> + *
> + * This was previously required to be called by the drivers, but not
> + * as of the xserver 1.16 ABI.
> + */
>  Bool
>  glamor_glyphs_init(ScreenPtr pScreen)
>  {
> +    glamor_screen_private *glamor = 
> glamor_get_screen_private(pScreen);
> +
> +    if (glamor->glyph_cache_initialized)
> +        return TRUE;

Is it still possible that this function is called twice? I don't think 
so, so glyph_cache_initialized isn't needed any more.

> +
>      if (!dixRegisterPrivateKey(&glamor_glyph_key,
>                                 PRIVATE_GLYPH, sizeof(struct 
> glamor_glyph)))
>          return FALSE;
> 
> -    /* Skip pixmap creation if we don't intend to use it. */
> +    glamor->glyph_cache_initialized = TRUE;
> 
> -    return glamor_realize_glyph_caches(pScreen);
> +    return TRUE;
>  }
> 
>  /* The most efficient thing to way to upload the glyph to the screen


More information about the xorg-devel mailing list