[PATCH 2/4] Remove the cacheing of the last scratch PixmapRec

Aaron Plattner aplattner at nvidia.com
Wed Jun 8 13:59:28 PDT 2011


On Sun, Jun 05, 2011 at 10:36:07PM -0700, Chris Wilson wrote:
> In order for the driver to be notified of when the resource backing the
> scratch pixmap becomes no longer accessible, it needs to be called on
> every FreeScratchPixmapHeader(). As we instead maybe cached the
> PixmapRec (to avoid the free and malloc overhead), this notification
> went astray, and the driver would fail to insert the correct barriers on
> the backing resource. That resource would then be reused by the Xserver,
> leading to rampant memory corruption as the GPU flushed it write caches
> at some point in the future and overwriting random structures.
> 
> In addition we introduce a new hint, CREATE_PIXMAP_USAGE_SCRATCH_HEADER,
> so that the driver can be warned during pixmap creation (and lifetime)
> if the pixmap points to other data.
> 
> A side-effect of removing the cache is that several members of the
> ScreenInfo structure and associated routines become redundant and
> deleted as well. So we bump the ABI version as well.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>  dix/dispatch.c                 |    1 -
>  dix/main.c                     |    4 +--
>  dix/pixmap.c                   |   58 ++++++++++++++++------------------------
>  fb/fbpixmap.c                  |    2 +-
>  hw/xfree86/common/xf86Module.h |    2 +-
>  include/pixmap.h               |    7 +---
>  include/scrnintstr.h           |    8 +++---
>  7 files changed, 32 insertions(+), 50 deletions(-)
[...]
> diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
> index 2a5c805..cf7557e 100644
> --- a/hw/xfree86/common/xf86Module.h
> +++ b/hw/xfree86/common/xf86Module.h
> @@ -82,7 +82,7 @@ typedef enum {
>   * mask is 0xFFFF0000.
>   */
>  #define ABI_ANSIC_VERSION	SET_ABI_VERSION(0, 4)
> -#define ABI_VIDEODRV_VERSION	SET_ABI_VERSION(11, 0)
> +#define ABI_VIDEODRV_VERSION	SET_ABI_VERSION(12, 0)
>  #define ABI_XINPUT_VERSION	SET_ABI_VERSION(13, 0)
>  #define ABI_EXTENSION_VERSION	SET_ABI_VERSION(5, 0)
>  #define ABI_FONT_VERSION	SET_ABI_VERSION(0, 6)

As a reminder, you'll need to wait until server-1.11-branch is created
because the ABI was (supposedly) frozen at xorg-server-1.10.99.901.

-- Aaron


More information about the xorg-devel mailing list