summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965
diff options
context:
space:
mode:
authorNian Wu <nian.wu@intel.com>2006-12-13 13:49:00 -0800
committerZou Nan hai <nanhai.zou@intel.com>2006-12-13 13:49:00 -0800
commit77b862a84910713760665ca5af5e27fba48466dc (patch)
tree4bbccbf08f451ebfaab5eecbf97bd587927e0887 /src/mesa/drivers/dri/i965
parented7fbad2066f846bf9466b13b184a50d6f87f972 (diff)
parent2956a0c8a8395e4d9ae00888aeb88ea5c38b89ad (diff)
Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h1
-rw-r--r--src/mesa/drivers/dri/i965/brw_misc_state.c8
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.c49
-rw-r--r--src/mesa/drivers/dri/i965/intel_ioctl.c5
4 files changed, 38 insertions, 25 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index a57c794834..cac4d86d3a 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -599,6 +599,7 @@ struct brw_context
struct {
struct brw_wm_prog_data *prog_data;
+ struct brw_wm_compile *compile_data;
/* Input sizes, calculated from active vertex program:
*/
diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c
index 6a6c4503c7..d5779680ff 100644
--- a/src/mesa/drivers/dri/i965/brw_misc_state.c
+++ b/src/mesa/drivers/dri/i965/brw_misc_state.c
@@ -88,10 +88,10 @@ static void upload_drawing_rect(struct brw_context *brw)
if (brw->intel.numClipRects > 1)
return;
- x1 = dPriv->x;
- y1 = dPriv->y;
- x2 = dPriv->x + dPriv->w;
- y2 = dPriv->y + dPriv->h;
+ x1 = brw->intel.pClipRects[0].x1;
+ y1 = brw->intel.pClipRects[0].y1;
+ x2 = brw->intel.pClipRects[0].x2;
+ y2 = brw->intel.pClipRects[0].y2;
if (x1 < 0) x1 = 0;
if (y1 < 0) y1 = 0;
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index 3e2f2d06b8..0f842d289d 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -138,64 +138,75 @@ static void do_wm_prog( struct brw_context *brw,
struct brw_fragment_program *fp,
struct brw_wm_prog_key *key)
{
- struct brw_wm_compile c;
+ struct brw_wm_compile *c;
const GLuint *program;
GLuint program_size;
- memset(&c, 0, sizeof(c));
- memcpy(&c.key, key, sizeof(*key));
+ c = brw->wm.compile_data;
+ if (c == NULL) {
+ brw->wm.compile_data = calloc(1, sizeof(*brw->wm.compile_data));
+ c = brw->wm.compile_data;
+ } else {
+ memset(c, 0, sizeof(*brw->wm.compile_data));
+ }
+ memcpy(&c->key, key, sizeof(*key));
- c.fp = fp;
- c.env_param = brw->intel.ctx.FragmentProgram.Parameters;
+ c->fp = fp;
+ c->env_param = brw->intel.ctx.FragmentProgram.Parameters;
/* Augment fragment program. Add instructions for pre- and
* post-fragment-program tasks such as interpolation and fogging.
*/
- brw_wm_pass_fp(&c);
+ brw_wm_pass_fp(c);
/* Translate to intermediate representation. Build register usage
* chains.
*/
- brw_wm_pass0(&c);
+ brw_wm_pass0(c);
/* Dead code removal.
*/
- brw_wm_pass1(&c);
+ brw_wm_pass1(c);
/* Hal optimization
*/
- brw_wm_pass_hal (&c);
+ brw_wm_pass_hal (c);
/* Register allocation.
*/
- c.grf_limit = BRW_WM_MAX_GRF/2;
+ c->grf_limit = BRW_WM_MAX_GRF/2;
/* This is where we start emitting gen4 code:
*/
- brw_init_compile(&c.func);
+ brw_init_compile(&c->func);
- brw_wm_pass2(&c);
+ brw_wm_pass2(c);
- c.prog_data.total_grf = c.max_wm_grf;
- c.prog_data.total_scratch = c.last_scratch ? c.last_scratch + 0x40 : 0;
+ c->prog_data.total_grf = c->max_wm_grf;
+ if (c->last_scratch) {
+ c->prog_data.total_scratch =
+ c->last_scratch + 0x40;
+ } else {
+ c->prog_data.total_scratch = 0;
+ }
/* Emit GEN4 code.
*/
- brw_wm_emit(&c);
+ brw_wm_emit(c);
/* get the program
*/
- program = brw_get_program(&c.func, &program_size);
+ program = brw_get_program(&c->func, &program_size);
/*
*/
brw->wm.prog_gs_offset = brw_upload_cache( &brw->cache[BRW_WM_PROG],
- &c.key,
- sizeof(c.key),
+ &c->key,
+ sizeof(c->key),
program,
program_size,
- &c.prog_data,
+ &c->prog_data,
&brw->wm.prog_data );
}
diff --git a/src/mesa/drivers/dri/i965/intel_ioctl.c b/src/mesa/drivers/dri/i965/intel_ioctl.c
index d8176c559e..4da31277ea 100644
--- a/src/mesa/drivers/dri/i965/intel_ioctl.c
+++ b/src/mesa/drivers/dri/i965/intel_ioctl.c
@@ -95,7 +95,7 @@ void intelWaitIrq( struct intel_context *intel, int seq )
{
if (!intel->no_hw) {
drmI830IrqWait iw;
- int ret;
+ int ret, lastdispatch;
if (0)
fprintf(stderr, "%s %d\n", __FUNCTION__, seq );
@@ -103,11 +103,12 @@ void intelWaitIrq( struct intel_context *intel, int seq )
iw.irq_seq = seq;
do {
+ lastdispatch = intel->sarea->last_dispatch;
ret = drmCommandWrite( intel->driFd, DRM_I830_IRQ_WAIT, &iw, sizeof(iw) );
/* This seems quite often to return before it should!?!
*/
- } while (ret == -EAGAIN || ret == -EINTR || (ret == 0 && seq > intel->sarea->last_dispatch));
+ } while (ret == -EAGAIN || ret == -EINTR || (ret == -EBUSY && lastdispatch != intel->sarea->last_dispatch) || (ret == 0 && seq > intel->sarea->last_dispatch));
if ( ret ) {