[PATCH] dri2: Remove unused depth_pixmap variable.

Michel Dänzer michel at daenzer.net
Tue Aug 17 03:24:32 PDT 2010


On Die, 2010-08-17 at 13:03 +1000, Christopher James Halse Rogers
wrote: 
> This code was in the initial dri2 code commit and seems
> to never have actually done anything.
> 
> Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com>

NAK, see below.


> ---
>  src/radeon_dri2.c |   19 ++-----------------
>  1 files changed, 2 insertions(+), 17 deletions(-)
> 
> diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
> index 4cafbc6..b8ef8ac 100644
> --- a/src/radeon_dri2.c
> +++ b/src/radeon_dri2.c
> @@ -69,7 +69,7 @@ radeon_dri2_create_buffers(DrawablePtr drawable,
>      RADEONInfoPtr info = RADEONPTR(pScrn);
>      BufferPtr buffers;
>      struct dri2_buffer_priv *privates;
> -    PixmapPtr pixmap, depth_pixmap;
> +    PixmapPtr pixmap;
>      struct radeon_exa_pixmap_priv *driver_priv;
>      int i, r;
>      int flags = 0;
> @@ -84,7 +84,6 @@ radeon_dri2_create_buffers(DrawablePtr drawable,
>          return NULL;
>      }
>  
> -    depth_pixmap = NULL;
>      for (i = 0; i < count; i++) {
>          if (attachments[i] == DRI2BufferFrontLeft) {
>              if (drawable->type == DRAWABLE_PIXMAP) {
> @@ -93,9 +92,6 @@ radeon_dri2_create_buffers(DrawablePtr drawable,
>                  pixmap = (*pScreen->GetWindowPixmap)((WindowPtr)drawable);
>              }
>              pixmap->refcnt++;
> -        } else if (attachments[i] == DRI2BufferStencil && depth_pixmap) {
> -            pixmap = depth_pixmap;
> -            pixmap->refcnt++;
>          } else {
>  	    /* tile the back buffer */
>  	    switch(attachments[i]) {
> @@ -131,9 +127,6 @@ radeon_dri2_create_buffers(DrawablePtr drawable,
>                                                flags);
>          }
>  
> -        if (attachments[i] == DRI2BufferDepth) {
> -            depth_pixmap = pixmap;
> -        }
>  	info->exa_force_create = TRUE;
>  	exaMoveInPixmap(pixmap);
>  	info->exa_force_create = FALSE;

The code you're removing here should work just fine for sharing the same
depth/stencil buffer for individual depth or stencil attachments.


> @@ -163,7 +156,7 @@ radeon_dri2_create_buffer(DrawablePtr drawable,
>      RADEONInfoPtr info = RADEONPTR(pScrn);
>      BufferPtr buffers;
>      struct dri2_buffer_priv *privates;
> -    PixmapPtr pixmap, depth_pixmap;
> +    PixmapPtr pixmap;
>      struct radeon_exa_pixmap_priv *driver_priv;
>      int r;
>      int flags;
> @@ -178,8 +171,6 @@ radeon_dri2_create_buffer(DrawablePtr drawable,
>          return NULL;
>      }
>  
> -    depth_pixmap = NULL;
> -
>      if (attachment == DRI2BufferFrontLeft) {
>          if (drawable->type == DRAWABLE_PIXMAP) {
>              pixmap = (PixmapPtr)drawable;
> @@ -187,9 +178,6 @@ radeon_dri2_create_buffer(DrawablePtr drawable,
>              pixmap = (*pScreen->GetWindowPixmap)((WindowPtr)drawable);
>          }
>          pixmap->refcnt++;
> -    } else if (attachment == DRI2BufferStencil && depth_pixmap) {
> -        pixmap = depth_pixmap;
> -        pixmap->refcnt++;
>      } else {
>  	/* tile the back buffer */
>  	switch(attachment) {
> @@ -225,9 +213,6 @@ radeon_dri2_create_buffer(DrawablePtr drawable,
>                  flags);
>      }
>  
> -    if (attachment == DRI2BufferDepth) {
> -        depth_pixmap = pixmap;
> -    }
>      info->exa_force_create = TRUE;
>      exaMoveInPixmap(pixmap);
>      info->exa_force_create = FALSE;

The code you're removing here indeed can't seem to work as intended
though as depth_pixmap is re-initialized for each attachment. If
possible it would be better to fix it than to just remove it though.


-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the xorg-driver-ati mailing list