Mesa (master): i915g: don't recalculate fb dimension
Daniel Vetter
danvet at kemper.freedesktop.org
Sat Mar 12 19:44:43 UTC 2011
Module: Mesa
Branch: master
Commit: f6087955888ee089f986c19b576ef574c9e7bd06
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f6087955888ee089f986c19b576ef574c9e7bd06
Author: Daniel Vetter <daniel.vetter at ffwll.ch>
Date: Sat Mar 12 00:16:35 2011 +0100
i915g: don't recalculate fb dimension
The statetracker should do this for us correctly.
Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
src/gallium/drivers/i915/i915_clear.c | 2 +-
src/gallium/drivers/i915/i915_context.h | 2 -
src/gallium/drivers/i915/i915_state_static.c | 31 ++-----------------------
3 files changed, 4 insertions(+), 31 deletions(-)
diff --git a/src/gallium/drivers/i915/i915_clear.c b/src/gallium/drivers/i915/i915_clear.c
index d11361b..4a97746 100644
--- a/src/gallium/drivers/i915/i915_clear.c
+++ b/src/gallium/drivers/i915/i915_clear.c
@@ -144,5 +144,5 @@ i915_clear_render(struct pipe_context *pipe, unsigned buffers, const float *rgba
i915_update_derived(i915);
i915_clear_emit(pipe, buffers, rgba, depth, stencil,
- 0, 0, i915->current.fb_width, i915->current.fb_height);
+ 0, 0, i915->framebuffer.width, i915->framebuffer.height);
}
diff --git a/src/gallium/drivers/i915/i915_context.h b/src/gallium/drivers/i915/i915_context.h
index 51a364b..e42c9dc 100644
--- a/src/gallium/drivers/i915/i915_context.h
+++ b/src/gallium/drivers/i915/i915_context.h
@@ -159,8 +159,6 @@ struct i915_state
unsigned dst_buf_vars;
uint32_t draw_offset;
uint32_t draw_size;
- /* for clears */
- uint16_t fb_height, fb_width;
unsigned id; /* track lost context events */
};
diff --git a/src/gallium/drivers/i915/i915_state_static.c b/src/gallium/drivers/i915/i915_state_static.c
index fbbcf94..70b3dff 100644
--- a/src/gallium/drivers/i915/i915_state_static.c
+++ b/src/gallium/drivers/i915/i915_state_static.c
@@ -78,29 +78,6 @@ buf_3d_tiling_bits(enum i915_winsys_buffer_tile tiling)
return tiling_bits;
}
-/**
- * Examine framebuffer state to determine width, height.
- */
-static boolean
-framebuffer_size(const struct pipe_framebuffer_state *fb,
- uint *width, uint *height)
-{
- if (fb->cbufs[0]) {
- *width = fb->cbufs[0]->width;
- *height = fb->cbufs[0]->height;
- return TRUE;
- }
- else if (fb->zsbuf) {
- *width = fb->zsbuf->width;
- *height = fb->zsbuf->height;
- return TRUE;
- }
- else {
- *width = *height = 0;
- return FALSE;
- }
-}
-
static void update_framebuffer(struct i915_context *i915)
{
struct pipe_surface *cbuf_surface = i915->framebuffer.cbufs[0];
@@ -109,7 +86,6 @@ static void update_framebuffer(struct i915_context *i915)
unsigned x, y, w, h;
int layer;
uint32_t draw_offset;
- boolean ret;
if (cbuf_surface) {
struct i915_texture *tex = i915_texture(cbuf_surface->texture);
@@ -160,15 +136,14 @@ static void update_framebuffer(struct i915_context *i915)
/* drawing rect calculations */
draw_offset = x | (y << 16);
- ret = framebuffer_size(&i915->framebuffer, &w, &h);
- assert(ret);
if (i915->current.draw_offset != draw_offset) {
i915->current.draw_offset = draw_offset;
i915_set_flush_dirty(i915, I915_PIPELINE_FLUSH);
}
+
+ w = i915->framebuffer.width;
+ h = i915->framebuffer.height;
i915->current.draw_size = (w - 1 + x) | ((h - 1 + y) << 16);
- i915->current.fb_height = h;
- i915->current.fb_width = w;
i915->hardware_dirty |= I915_HW_STATIC;
More information about the mesa-commit
mailing list