[RFC] Poor man's acceleration of solid pictures for R3xx-R7xx

Michel Dänzer michel at daenzer.net
Sat Apr 14 05:44:02 PDT 2012


On Fre, 2012-04-13 at 13:30 -0400, Alex Deucher wrote: 
> 2012/4/13 Michel Dänzer <michel at daenzer.net>:
> >
> > The patch below implements basic acceleration of solid pictures via
> > scratch 1x1 pixmaps. It seems to at least alleviate some of the
> > corruption and performance issues exposed by Cairo 1.12, and should also
> > improve performance for other toolkits/apps using solid pictures.
> >
> > If there are no objections to this approach, maybe someone else can beat
> > me to extending this for Evergreen+ and R1/2xx.
> 
> Attached.

Thanks Alex!


> @@ -809,24 +798,24 @@ static void EVERGREENXFormSetup(PicturePtr
> pPict, PixmapPtr pPix,
>         vs_alu_consts[0 + const_offset] =
> xFixedToFloat(pPict->transform->matrix[0][0]);
>         vs_alu_consts[1 + const_offset] =
> xFixedToFloat(pPict->transform->matrix[0][1]);
>         vs_alu_consts[2 + const_offset] =
> xFixedToFloat(pPict->transform->matrix[0][2]);
> -       vs_alu_consts[3 + const_offset] = 1.0 / w;
> +       vs_alu_consts[3 + const_offset] = 1.0 /
> pPict->pDrawable->width;
>  
>         vs_alu_consts[4 + const_offset] =
> xFixedToFloat(pPict->transform->matrix[1][0]);
>         vs_alu_consts[5 + const_offset] =
> xFixedToFloat(pPict->transform->matrix[1][1]);
>         vs_alu_consts[6 + const_offset] =
> xFixedToFloat(pPict->transform->matrix[1][2]);
> -       vs_alu_consts[7 + const_offset] = 1.0 / h;
> +       vs_alu_consts[7 + const_offset] = 1.0 /
> pPict->pDrawable->height;
>      } else {
>         accel_state->is_transform[unit] = FALSE;
>  
>         vs_alu_consts[0 + const_offset] = 1.0;
>         vs_alu_consts[1 + const_offset] = 0.0;
>         vs_alu_consts[2 + const_offset] = 0.0;
> -       vs_alu_consts[3 + const_offset] = 1.0 / w;
> +       vs_alu_consts[3 + const_offset] = 1.0 /
> pPict->pDrawable->width;
>  
>         vs_alu_consts[4 + const_offset] = 0.0;
>         vs_alu_consts[5 + const_offset] = 1.0;
>         vs_alu_consts[6 + const_offset] = 0.0;
> -       vs_alu_consts[7 + const_offset] = 1.0 / h;
> +       vs_alu_consts[7 + const_offset] = 1.0 /
> pPict->pDrawable->height;
>      }
>  
>  }

This will still crash with solid pictures. Probably easiest to keep the
w/h locals and assign 1 to them if pPict->pDrawable == NULL.


> -    max_tex_w = 8192;
> -    max_tex_h = 8192;
> -    max_dst_w = 8192;
> -    max_dst_h = 8192;
> +       if (pSrcPixmap->drawable.width >= 16384 ||
> +           pSrcPixmap->drawable.height >= 16384) {

Looks like there's a bug fix hidden here. :)


The rest looks good to me.


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


More information about the xorg-driver-ati mailing list