xf86-video-intel: 7 commits - src/i965_render.c
Carl Worth
cworth at kemper.freedesktop.org
Tue Jun 26 15:50:47 PDT 2007
src/i965_render.c | 70 ++++++++++++++++++++++++++++++++++--------------------
1 files changed, 45 insertions(+), 25 deletions(-)
New commits:
diff-tree fff4a3b58fa18ee2ad91f998d190e90b77c051ab (from 0a8a4afd3c59011d6b1f5b39aedfb9bce0e55c48)
Author: Carl Worth <cworth at cworth.org>
Date: Mon Jun 25 23:15:58 2007 -0700
Use local structures for vs_state, sf_state, and wm_state
diff --git a/src/i965_render.c b/src/i965_render.c
index d79edd1..2ab1a6b 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -268,9 +268,9 @@ static struct brw_sampler_state *src_sam
static struct brw_sampler_state *mask_sampler_state, mask_sampler_state_local;
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_vs_unit_state *vs_state, vs_state_local;
+static struct brw_sf_unit_state *sf_state, sf_state_local;
+static struct brw_wm_unit_state *wm_state, wm_state_local;
static struct brw_cc_unit_state *cc_state, cc_state_local;
static struct brw_cc_viewport *cc_viewport;
@@ -530,9 +530,6 @@ i965_prepare_composite(int op, PicturePt
state_base_offset = ALIGN(state_base_offset, 64);
state_base = (char *)(pI830->FbBase + state_base_offset);
- vs_state = (void *)(state_base + vs_offset);
- sf_state = (void *)(state_base + sf_offset);
- wm_state = (void *)(state_base + wm_offset);
sf_kernel = (void *)(state_base + sf_kernel_offset);
ps_kernel = (void *)(state_base + ps_kernel_offset);
sip_kernel = (void *)(state_base + sip_kernel_offset);
@@ -786,12 +783,16 @@ i965_prepare_composite(int op, PicturePt
}
/* Set up the vertex shader to be disabled (passthrough) */
+ vs_state = &vs_state_local;
memset(vs_state, 0, sizeof(*vs_state));
vs_state->thread4.nr_urb_entries = URB_VS_ENTRIES;
vs_state->thread4.urb_entry_allocation_size = URB_VS_ENTRY_SIZE - 1;
vs_state->vs6.vs_enable = 0;
vs_state->vs6.vert_cache_disable = 1;
+ vs_state = (void *)(state_base + vs_offset);
+ memcpy (vs_state, &vs_state_local, sizeof (vs_state_local));
+
/* Set up the SF kernel to do coord interp: for each attribute,
* calculate dA/dx and dA/dy. Hand these interpolation coefficients
* back to SF which then hands pixels off to WM.
@@ -804,6 +805,7 @@ i965_prepare_composite(int op, PicturePt
else
memcpy(sf_kernel, sf_kernel_static, sizeof (sf_kernel_static));
+ sf_state = &sf_state_local;
memset(sf_state, 0, sizeof(*sf_state));
sf_state->thread0.kernel_start_pointer =
(state_base_offset + sf_kernel_offset) >> 6;
@@ -835,6 +837,9 @@ i965_prepare_composite(int op, PicturePt
sf_state->sf6.dest_org_vbias = 0x8;
sf_state->sf6.dest_org_hbias = 0x8;
+ sf_state = (void *)(state_base + sf_offset);
+ memcpy (sf_state, &sf_state_local, sizeof (sf_state_local));
+
/* Set up the PS kernel (dispatched by WM) */
if (pMask) {
if (pMaskPicture->componentAlpha &&
@@ -856,6 +861,7 @@ i965_prepare_composite(int op, PicturePt
sizeof (ps_kernel_static_nomask));
}
+ wm_state = &wm_state_local;
memset(wm_state, 0, sizeof (*wm_state));
wm_state->thread0.kernel_start_pointer =
(state_base_offset + ps_kernel_offset) >> 6;
@@ -893,6 +899,9 @@ i965_prepare_composite(int op, PicturePt
wm_state->wm5.enable_8_pix = 0;
wm_state->wm5.early_depth_test = 1;
+ wm_state = (void *)(state_base + wm_offset);
+ memcpy (wm_state, &wm_state_local, sizeof (wm_state_local));
+
/* Begin the long sequence of commands needed to set up the 3D
* rendering pipe
*/
diff-tree 0a8a4afd3c59011d6b1f5b39aedfb9bce0e55c48 (from 499166a60fcbf16021bd9ec233790ba55803aa44)
Author: Carl Worth <cworth at cworth.org>
Date: Mon Jun 25 23:12:23 2007 -0700
Use local structure for src_sampler_state and mask_sampler_state
diff --git a/src/i965_render.c b/src/i965_render.c
index 0882271..d79edd1 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -264,8 +264,8 @@ static int urb_cs_start, urb_cs_size;
static struct brw_surface_state *dest_surf_state, dest_surf_state_local;
static struct brw_surface_state *src_surf_state, src_surf_state_local;
static struct brw_surface_state *mask_surf_state, mask_surf_state_local;
-static struct brw_sampler_state *src_sampler_state;
-static struct brw_sampler_state *mask_sampler_state;
+static struct brw_sampler_state *src_sampler_state, src_sampler_state_local;
+static struct brw_sampler_state *mask_sampler_state, mask_sampler_state_local;
static struct brw_sampler_default_color *default_color_state;
static struct brw_vs_unit_state *vs_state;
@@ -539,10 +539,6 @@ i965_prepare_composite(int op, PicturePt
cc_viewport = (void *)(state_base + cc_viewport_offset);
- src_sampler_state = (void *)(state_base + src_sampler_offset);
- if (pMask)
- mask_sampler_state = (void *)(state_base + mask_sampler_offset);
-
binding_table = (void *)(state_base + binding_table_offset);
vb = (void *)(state_base + vb_offset);
@@ -712,6 +708,7 @@ i965_prepare_composite(int op, PicturePt
binding_table[2] = state_base_offset + mask_surf_offset;
/* PS kernel use this sampler */
+ src_sampler_state = &src_sampler_state_local;
memset(src_sampler_state, 0, sizeof(*src_sampler_state));
src_sampler_state->ss0.lod_preclamp = 1; /* GL mode */
switch(pSrcPicture->filter) {
@@ -748,7 +745,11 @@ i965_prepare_composite(int op, PicturePt
}
src_sampler_state->ss3.chroma_key_enable = 0; /* disable chromakey */
+ src_sampler_state = (void *)(state_base + src_sampler_offset);
+ memcpy (src_sampler_state, &src_sampler_state_local, sizeof (src_sampler_state_local));
+
if (pMask) {
+ mask_sampler_state = &mask_sampler_state_local;
memset(mask_sampler_state, 0, sizeof(*mask_sampler_state));
mask_sampler_state->ss0.lod_preclamp = 1; /* GL mode */
switch(pMaskPicture->filter) {
@@ -779,6 +780,9 @@ i965_prepare_composite(int op, PicturePt
mask_sampler_state->ss1.t_wrap_mode = BRW_TEXCOORDMODE_WRAP;
}
mask_sampler_state->ss3.chroma_key_enable = 0; /* disable chromakey */
+
+ mask_sampler_state = (void *)(state_base + mask_sampler_offset);
+ memcpy (mask_sampler_state, &mask_sampler_state_local, sizeof (mask_sampler_state_local));
}
/* Set up the vertex shader to be disabled (passthrough) */
diff-tree 499166a60fcbf16021bd9ec233790ba55803aa44 (from a418ef7316808b239884a90c3fe890220bcc0242)
Author: Carl Worth <cworth at cworth.org>
Date: Mon Jun 25 23:09:17 2007 -0700
Use local structure for mask_surf_state
diff --git a/src/i965_render.c b/src/i965_render.c
index eb74cd5..0882271 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -263,7 +263,7 @@ static int urb_cs_start, urb_cs_size;
static struct brw_surface_state *dest_surf_state, dest_surf_state_local;
static struct brw_surface_state *src_surf_state, src_surf_state_local;
-static struct brw_surface_state *mask_surf_state;
+static struct brw_surface_state *mask_surf_state, mask_surf_state_local;
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;
@@ -539,9 +539,6 @@ i965_prepare_composite(int op, PicturePt
cc_viewport = (void *)(state_base + cc_viewport_offset);
- if (pMask)
- mask_surf_state = (void *)(state_base + mask_surf_offset);
-
src_sampler_state = (void *)(state_base + src_sampler_offset);
if (pMask)
mask_sampler_state = (void *)(state_base + mask_sampler_offset);
@@ -681,6 +678,7 @@ i965_prepare_composite(int op, PicturePt
/* setup mask surface */
if (pMask) {
+ mask_surf_state = &mask_surf_state_local;
memset(mask_surf_state, 0, sizeof(*mask_surf_state));
mask_surf_state->ss0.surface_type = BRW_SURFACE_2D;
mask_surf_state->ss0.surface_format =
@@ -702,6 +700,9 @@ i965_prepare_composite(int op, PicturePt
mask_surf_state->ss2.mip_count = 0;
mask_surf_state->ss2.render_target_rotation = 0;
mask_surf_state->ss3.pitch = mask_pitch - 1;
+
+ mask_surf_state = (void *)(state_base + mask_surf_offset);
+ memcpy (mask_surf_state, &mask_surf_state_local, sizeof (mask_surf_state_local));
}
/* Set up a binding table for our surfaces. Only the PS will use it */
diff-tree a418ef7316808b239884a90c3fe890220bcc0242 (from 0e3c0b17826b7b5a21ee2c1d789b084fc167f1ed)
Author: Carl Worth <cworth at cworth.org>
Date: Mon Jun 25 23:07:19 2007 -0700
Use local structure for src_surf_state
diff --git a/src/i965_render.c b/src/i965_render.c
index 09a4362..eb74cd5 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -262,7 +262,7 @@ static int urb_sf_start, urb_sf_size;
static int urb_cs_start, urb_cs_size;
static struct brw_surface_state *dest_surf_state, dest_surf_state_local;
-static struct brw_surface_state *src_surf_state;
+static struct brw_surface_state *src_surf_state, src_surf_state_local;
static struct brw_surface_state *mask_surf_state;
static struct brw_sampler_state *src_sampler_state;
static struct brw_sampler_state *mask_sampler_state;
@@ -539,7 +539,6 @@ i965_prepare_composite(int op, PicturePt
cc_viewport = (void *)(state_base + cc_viewport_offset);
- src_surf_state = (void *)(state_base + src_surf_offset);
if (pMask)
mask_surf_state = (void *)(state_base + mask_surf_offset);
@@ -655,6 +654,7 @@ i965_prepare_composite(int op, PicturePt
memcpy (dest_surf_state, &dest_surf_state_local, sizeof (dest_surf_state_local));
/* Set up the source surface state buffer */
+ src_surf_state = &src_surf_state_local;
memset(src_surf_state, 0, sizeof(*src_surf_state));
src_surf_state->ss0.surface_type = BRW_SURFACE_2D;
src_surf_state->ss0.surface_format = i965_get_card_format(pSrcPicture);
@@ -676,6 +676,9 @@ i965_prepare_composite(int op, PicturePt
src_surf_state->ss2.render_target_rotation = 0;
src_surf_state->ss3.pitch = src_pitch - 1;
+ src_surf_state = (void *)(state_base + src_surf_offset);
+ memcpy (src_surf_state, &src_surf_state_local, sizeof (src_surf_state_local));
+
/* setup mask surface */
if (pMask) {
memset(mask_surf_state, 0, sizeof(*mask_surf_state));
diff-tree 0e3c0b17826b7b5a21ee2c1d789b084fc167f1ed (from 41a2c0f15446d59678461648f476fa71d40d44e0)
Author: Carl Worth <cworth at cworth.org>
Date: Mon Jun 25 23:05:50 2007 -0700
Use local structure for dest_surf_state
diff --git a/src/i965_render.c b/src/i965_render.c
index 71953e7..09a4362 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -261,7 +261,7 @@ 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 *dest_surf_state, dest_surf_state_local;
static struct brw_surface_state *src_surf_state;
static struct brw_surface_state *mask_surf_state;
static struct brw_sampler_state *src_sampler_state;
@@ -539,7 +539,6 @@ i965_prepare_composite(int op, PicturePt
cc_viewport = (void *)(state_base + cc_viewport_offset);
- dest_surf_state = (void *)(state_base + dest_surf_offset);
src_surf_state = (void *)(state_base + src_surf_offset);
if (pMask)
mask_surf_state = (void *)(state_base + mask_surf_offset);
@@ -628,6 +627,7 @@ i965_prepare_composite(int op, PicturePt
memcpy (sip_kernel, sip_kernel_static, sizeof (sip_kernel_static));
/* Set up the state buffer for the destination surface */
+ dest_surf_state = &dest_surf_state_local;
memset(dest_surf_state, 0, sizeof(*dest_surf_state));
dest_surf_state->ss0.surface_type = BRW_SURFACE_2D;
dest_surf_state->ss0.data_return_format = BRW_SURFACERETURNFORMAT_FLOAT32;
@@ -651,6 +651,9 @@ i965_prepare_composite(int op, PicturePt
dest_surf_state->ss2.render_target_rotation = 0;
dest_surf_state->ss3.pitch = dst_pitch - 1;
+ dest_surf_state = (void *)(state_base + dest_surf_offset);
+ memcpy (dest_surf_state, &dest_surf_state_local, sizeof (dest_surf_state_local));
+
/* Set up the source surface state buffer */
memset(src_surf_state, 0, sizeof(*src_surf_state));
src_surf_state->ss0.surface_type = BRW_SURFACE_2D;
diff-tree 41a2c0f15446d59678461648f476fa71d40d44e0 (from 59f2150caca7eb374a2db43a472ba85f50d23274)
Author: Carl Worth <cworth at cworth.org>
Date: Mon Jun 25 23:03:47 2007 -0700
Use local structure for cc_state
diff --git a/src/i965_render.c b/src/i965_render.c
index 347bca0..71953e7 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -271,7 +271,7 @@ static struct brw_sampler_default_color
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_unit_state *cc_state, cc_state_local;
static struct brw_cc_viewport *cc_viewport;
static struct brw_instruction *sf_kernel;
@@ -533,7 +533,6 @@ i965_prepare_composite(int op, PicturePt
vs_state = (void *)(state_base + vs_offset);
sf_state = (void *)(state_base + sf_offset);
wm_state = (void *)(state_base + wm_offset);
- cc_state = (void *)(state_base + cc_offset);
sf_kernel = (void *)(state_base + sf_kernel_offset);
ps_kernel = (void *)(state_base + ps_kernel_offset);
sip_kernel = (void *)(state_base + sip_kernel_offset);
@@ -594,6 +593,7 @@ i965_prepare_composite(int op, PicturePt
cc_viewport->max_depth = 1.e35;
/* Color calculator state */
+ cc_state = &cc_state_local;
memset(cc_state, 0, sizeof(*cc_state));
cc_state->cc0.stencil_enable = 0; /* disable stencil */
cc_state->cc2.depth_test = 0; /* disable depth test */
@@ -621,6 +621,9 @@ i965_prepare_composite(int op, PicturePt
cc_state->cc6.clamp_pre_alpha_blend = 1;
cc_state->cc6.clamp_range = 0; /* clamp range [0,1] */
+ cc_state = (void *)(state_base + cc_offset);
+ memcpy (cc_state, &cc_state_local, sizeof (cc_state_local));
+
/* Upload system kernel */
memcpy (sip_kernel, sip_kernel_static, sizeof (sip_kernel_static));
diff-tree 59f2150caca7eb374a2db43a472ba85f50d23274 (from 66aa0e61e1e8d2216a9c0555be5be004ed0a3192)
Author: Carl Worth <cworth at cworth.org>
Date: Mon Jun 25 11:28:57 2007 -0700
Remove redundant i830WaitSync from i965_prepare_composite
There were two calls to i830WaitSync, and between them no state was
being changed---just offsets were being computed.
diff --git a/src/i965_render.c b/src/i965_render.c
index e69a939..347bca0 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -437,9 +437,6 @@ i965_prepare_composite(int op, PicturePt
binding_table_entries = 2; /* default no mask */
- /* Wait for sync before we start setting up our new state */
- i830WaitSync(pScrn);
-
/* Set up our layout of state in framebuffer. First the general state: */
next_offset = 0;
vs_offset = ALIGN(next_offset, 64);
More information about the xorg-commit
mailing list