Mesa (7.11): intel: Simplify stencil detiling arithmetic

Ian Romanick idr at kemper.freedesktop.org
Sun Nov 27 22:13:44 UTC 2011


Module: Mesa
Branch: 7.11
Commit: fd35fab340ef8a3c166a6352067728e95d351483
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fd35fab340ef8a3c166a6352067728e95d351483

Author: Chad Versace <chad.versace at linux.intel.com>
Date:   Tue Nov 15 07:10:18 2011 -0800

intel: Simplify stencil detiling arithmetic

When calculating the y offset needed for detiling window system stencil
buffers, replace the term
   region->height * 2 + region->height % 2 - 1
with
   rb->Height - 1 .

The two terms are incidentally equivalent due to some out-of-date,
incorrect code in the Intel DRI2 glue for DDX. (See
intel_process_dri2_buffer_with_separate_stencil(), line ``buffer_height /=
2;``).

Note: This is a candidate for the 7.11 branch (only the intel_span.c hunk).
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
(cherry picked from commit dc4c3a31c64aae2c3d76ccbd5bf54d04a1d5d041)

Conflicts:

	src/mesa/drivers/dri/intel/intel_fbo.c
	src/mesa/drivers/dri/intel/intel_span.c

---

 src/mesa/drivers/dri/intel/intel_span.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c
index 2e1c80c..b1b8d3d 100644
--- a/src/mesa/drivers/dri/intel/intel_span.c
+++ b/src/mesa/drivers/dri/intel/intel_span.c
@@ -141,10 +141,9 @@ intel_set_span_functions(struct intel_context *intel,
    struct intel_renderbuffer *irb = intel_renderbuffer(rb);		\
    uint8_t *buf = irb->region->buffer->virtual;				\
    unsigned stride = irb->region->pitch;				\
-   unsigned height = 2 * irb->region->height;				\
    bool flip = rb->Name == 0;						\
    int y_scale = flip ? -1 : 1;						\
-   int y_bias = flip ? (height - 1) : 0;				\
+   int y_bias = flip ? (rb->Height - 1) : 0;				\
 
 #undef Y_FLIP
 #define Y_FLIP(y) (y_scale * (y) + y_bias)




More information about the mesa-commit mailing list