diff options
author | Keith Packard <keithp@mandolin.keithp.com> | 2007-01-06 18:19:34 -0800 |
---|---|---|
committer | Keith Packard <keithp@mandolin.keithp.com> | 2007-01-06 18:19:34 -0800 |
commit | 40af0ee6ba4ab7596fbc7fcc3ad04d109746ca6f (patch) | |
tree | c4868908a9db5b514ea1159024f2a38e381c7c5c /src/i965_exa_render.c | |
parent | 736d82a6b43f174cb95b425faacd4b0b889916fa (diff) |
Numerous symbol scope issues.
I830EntityIndex is shared between 810 and newer driver.
Move most EXA rendering state into I830 structure.
Declare shared variables in shared header files rather than .c.
Diffstat (limited to 'src/i965_exa_render.c')
-rw-r--r-- | src/i965_exa_render.c | 152 |
1 files changed, 74 insertions, 78 deletions
diff --git a/src/i965_exa_render.c b/src/i965_exa_render.c index 583bc261..89581e91 100644 --- a/src/i965_exa_render.c +++ b/src/i965_exa_render.c @@ -71,10 +71,6 @@ I965EXAComposite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, static void I965GetBlendCntl(int op, PicturePtr pMask, CARD32 dst_format, CARD32 *sblend, CARD32 *dblend); -extern float scale_units[2][2]; -extern Bool is_transform[2]; -extern PictTransform *transform[2]; - struct blendinfo { Bool dst_alpha; Bool src_alpha; @@ -267,46 +263,46 @@ I965EXACheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, #define MIN(a,b) ((a) < (b) ? (a) : (b)) #define BRW_GRF_BLOCKS(nreg) ((nreg + 15) / 16 - 1) -int urb_vs_start, urb_vs_size; -int urb_gs_start, urb_gs_size; -int urb_clip_start, urb_clip_size; -int urb_sf_start, urb_sf_size; -int urb_cs_start, urb_cs_size; - -struct brw_surface_state *dest_surf_state; -struct brw_surface_state *src_surf_state; -struct brw_surface_state *mask_surf_state; -struct brw_sampler_state *src_sampler_state; -struct brw_sampler_state *mask_sampler_state; -struct brw_sampler_default_color *default_color_state; - -struct brw_vs_unit_state *vs_state; -struct brw_sf_unit_state *sf_state; -struct brw_wm_unit_state *wm_state; -struct brw_cc_unit_state *cc_state; -struct brw_cc_viewport *cc_viewport; - -struct brw_instruction *sf_kernel; -struct brw_instruction *ps_kernel; -struct brw_instruction *sip_kernel; - -CARD32 *binding_table; -int binding_table_entries; - -int dest_surf_offset, src_surf_offset, mask_surf_offset; -int src_sampler_offset, mask_sampler_offset,vs_offset; -int sf_offset, wm_offset, cc_offset, vb_offset, cc_viewport_offset; -int sf_kernel_offset, ps_kernel_offset, sip_kernel_offset; -int wm_scratch_offset; -int binding_table_offset; -int default_color_offset; -int next_offset, total_state_size; -char *state_base; -int state_base_offset; -float *vb; -int vb_size = (4 * 4) * 4 ; /* 4 DWORDS per vertex*/ - -CARD32 src_blend, dst_blend; +static int urb_vs_start, urb_vs_size; +static int urb_gs_start, urb_gs_size; +static int urb_clip_start, urb_clip_size; +static int urb_sf_start, urb_sf_size; +static int urb_cs_start, urb_cs_size; + +static struct brw_surface_state *dest_surf_state; +static struct brw_surface_state *src_surf_state; +static struct brw_surface_state *mask_surf_state; +static struct brw_sampler_state *src_sampler_state; +static struct brw_sampler_state *mask_sampler_state; +static struct brw_sampler_default_color *default_color_state; + +static struct brw_vs_unit_state *vs_state; +static struct brw_sf_unit_state *sf_state; +static struct brw_wm_unit_state *wm_state; +static struct brw_cc_unit_state *cc_state; +static struct brw_cc_viewport *cc_viewport; + +static struct brw_instruction *sf_kernel; +static struct brw_instruction *ps_kernel; +static struct brw_instruction *sip_kernel; + +static CARD32 *binding_table; +static int binding_table_entries; + +static int dest_surf_offset, src_surf_offset, mask_surf_offset; +static int src_sampler_offset, mask_sampler_offset,vs_offset; +static int sf_offset, wm_offset, cc_offset, vb_offset, cc_viewport_offset; +static int sf_kernel_offset, ps_kernel_offset, sip_kernel_offset; +static int wm_scratch_offset; +static int binding_table_offset; +static int default_color_offset; +static int next_offset, total_state_size; +static char *state_base; +static int state_base_offset; +static float *vb; +static int vb_size = (4 * 4) * 4 ; /* 4 DWORDS per vertex*/ + +static CARD32 src_blend, dst_blend; static const CARD32 sip_kernel_static[][4] = { /* wait (1) a0<1>UW a145<0,1,0>UW { align1 + } */ @@ -394,27 +390,27 @@ I965EXAPrepareComposite(int op, PicturePtr pSrcPicture, mask_offset = exaGetPixmapOffset(pMask); mask_pitch = exaGetPixmapPitch(pMask); } - scale_units[0][0] = pSrc->drawable.width; - scale_units[0][1] = pSrc->drawable.height; + pI830->scale_units[0][0] = pSrc->drawable.width; + pI830->scale_units[0][1] = pSrc->drawable.height; if (pSrcPicture->transform) { - is_transform[0] = TRUE; - transform[0] = pSrcPicture->transform; + pI830->is_transform[0] = TRUE; + pI830->transform[0] = pSrcPicture->transform; } else - is_transform[0] = FALSE; + pI830->is_transform[0] = FALSE; if (!pMask) { - is_transform[1] = FALSE; - scale_units[1][0] = -1; - scale_units[1][1] = -1; + pI830->is_transform[1] = FALSE; + pI830->scale_units[1][0] = -1; + pI830->scale_units[1][1] = -1; } else { if (pMaskPicture->transform) { - is_transform[1] = TRUE; - transform[1] = pMaskPicture->transform; + pI830->is_transform[1] = TRUE; + pI830->transform[1] = pMaskPicture->transform; } else - is_transform[1] = FALSE; - scale_units[1][0] = pMask->drawable.width; - scale_units[1][1] = pMask->drawable.height; + pI830->is_transform[1] = FALSE; + pI830->scale_units[1][0] = pMask->drawable.width; + pI830->scale_units[1][1] = pMask->drawable.height; } /* setup 3d pipeline state */ @@ -996,10 +992,10 @@ I965EXAComposite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, "src_scale_x %f, src_scale_y %f, " "mask_scale_x %f, mask_scale_y %f\n", srcX, srcY, maskX, maskY, dstX, dstY, w, h, - scale_units[0][0], scale_units[0][1], - scale_units[1][0], scale_units[1][1]); + pI830->scale_units[0][0], pI830->scale_units[0][1], + pI830->scale_units[1][0], pI830->scale_units[1][1]); - if (scale_units[1][0] == -1 || scale_units[1][1] == -1) { + if (pI830->scale_units[1][0] == -1 || pI830->scale_units[1][1] == -1) { pMask = 0; } @@ -1007,31 +1003,31 @@ I965EXAComposite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, srcYend = srcY + h; maskXend = maskX + w; maskYend = maskY + h; - if (is_transform[0]) { + if (pI830->is_transform[0]) { v.vector[0] = IntToxFixed(srcX); v.vector[1] = IntToxFixed(srcY); v.vector[2] = xFixed1; - PictureTransformPoint(transform[0], &v); + PictureTransformPoint(pI830->transform[0], &v); srcX = xFixedToInt(v.vector[0]); srcY = xFixedToInt(v.vector[1]); v.vector[0] = IntToxFixed(srcXend); v.vector[1] = IntToxFixed(srcYend); v.vector[2] = xFixed1; - PictureTransformPoint(transform[0], &v); + PictureTransformPoint(pI830->transform[0], &v); srcXend = xFixedToInt(v.vector[0]); srcYend = xFixedToInt(v.vector[1]); } - if (is_transform[1]) { + if (pI830->is_transform[1]) { v.vector[0] = IntToxFixed(maskX); v.vector[1] = IntToxFixed(maskY); v.vector[2] = xFixed1; - PictureTransformPoint(transform[1], &v); + PictureTransformPoint(pI830->transform[1], &v); maskX = xFixedToInt(v.vector[0]); maskY = xFixedToInt(v.vector[1]); v.vector[0] = IntToxFixed(maskXend); v.vector[1] = IntToxFixed(maskYend); v.vector[2] = xFixed1; - PictureTransformPoint(transform[1], &v); + PictureTransformPoint(pI830->transform[1], &v); maskXend = xFixedToInt(v.vector[0]); maskYend = xFixedToInt(v.vector[1]); } @@ -1043,31 +1039,31 @@ I965EXAComposite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, i = 0; /* rect (x2,y2) */ - vb[i++] = (float)(srcXend) / scale_units[0][0]; - vb[i++] = (float)(srcYend) / scale_units[0][1]; + vb[i++] = (float)(srcXend) / pI830->scale_units[0][0]; + vb[i++] = (float)(srcYend) / pI830->scale_units[0][1]; if (pMask) { - vb[i++] = (float)maskXend / scale_units[1][0]; - vb[i++] = (float)maskYend / scale_units[1][1]; + vb[i++] = (float)maskXend / pI830->scale_units[1][0]; + vb[i++] = (float)maskYend / pI830->scale_units[1][1]; } vb[i++] = (float)(dstX + w); vb[i++] = (float)(dstY + h); /* rect (x1,y2) */ - vb[i++] = (float)(srcX)/ scale_units[0][0]; - vb[i++] = (float)(srcYend)/ scale_units[0][1]; + vb[i++] = (float)(srcX)/ pI830->scale_units[0][0]; + vb[i++] = (float)(srcYend)/ pI830->scale_units[0][1]; if (pMask) { - vb[i++] = (float)maskX / scale_units[1][0]; - vb[i++] = (float)maskYend / scale_units[1][1]; + vb[i++] = (float)maskX / pI830->scale_units[1][0]; + vb[i++] = (float)maskYend / pI830->scale_units[1][1]; } vb[i++] = (float)dstX; vb[i++] = (float)(dstY + h); /* rect (x1,y1) */ - vb[i++] = (float)(srcX) / scale_units[0][0]; - vb[i++] = (float)(srcY) / scale_units[0][1]; + vb[i++] = (float)(srcX) / pI830->scale_units[0][0]; + vb[i++] = (float)(srcY) / pI830->scale_units[0][1]; if (pMask) { - vb[i++] = (float)maskX / scale_units[1][0]; - vb[i++] = (float)maskY / scale_units[1][1]; + vb[i++] = (float)maskX / pI830->scale_units[1][0]; + vb[i++] = (float)maskY / pI830->scale_units[1][1]; } vb[i++] = (float)dstX; vb[i++] = (float)dstY; |