Merge lp:~jsjgruber/ubuntu/natty/mesa/mesa.fix681915 into lp:ubuntu/natty/mesa

Proposed by John S. Gruber
Status: Merged
Merge reported by: Bryce Harrington
Merged at revision: not available
Proposed branch: lp:~jsjgruber/ubuntu/natty/mesa/mesa.fix681915
Merge into: lp:ubuntu/natty/mesa
Diff against target: 188 lines (+168/-0)
3 files modified
debian/changelog (+11/-0)
debian/patches/108-r300g-fixup-rs690-tiling-stride-align.patch (+156/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~jsjgruber/ubuntu/natty/mesa/mesa.fix681915
Reviewer Review Type Date Requested Status
Bryce Harrington Approve
Ubuntu branches Pending
Review via email: mp+46318@code.launchpad.net

Description of the change

Cherry pick 32218e4to fix LP: #681915

To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) wrote :

Looks fine; we'll be getting this change anyway with the mesa 7.10 merge planned for next week, but there's little reason not to go ahead and upload it now.

Thanks for packaging and testing it.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-12-02 17:15:02 +0000
3+++ debian/changelog 2011-01-14 19:36:59 +0000
4@@ -1,3 +1,14 @@
5+mesa (7.9+repack-1ubuntu4~ppajsg2) natty; urgency=low
6+
7+ * debian/patches/108-r300g-fixup-rs690-tiling-stride-align.patch
8+ - Cherry pick 32218e4cc88f7dedebadffe4a80247decf4498f1 from upstream
9+ r300g: fixup rs690 tiling stride alignment calculations
10+ itself cherrypicked from d19b5cbd317620f3977e68fffb7a74793436b7e2
11+ addressing unity (and other) text and icon rendering problems.
12+ (LP: #681915)
13+
14+ -- John S Gruber <JohnSGruber@gmail.com> Sun, 09 Jan 2011 14:25:53 -0500
15+
16 mesa (7.9+repack-1ubuntu3) natty; urgency=low
17
18 * debian/patches/106_fix_renderbuffer_segfault.patch:
19
20=== added file 'debian/patches/108-r300g-fixup-rs690-tiling-stride-align.patch'
21--- debian/patches/108-r300g-fixup-rs690-tiling-stride-align.patch 1970-01-01 00:00:00 +0000
22+++ debian/patches/108-r300g-fixup-rs690-tiling-stride-align.patch 2011-01-14 19:36:59 +0000
23@@ -0,0 +1,156 @@
24+From 32218e4cc88f7dedebadffe4a80247decf4498f1 Mon Sep 17 00:00:00 2001
25+From: Dave Airlie <airlied@redhat.com>
26+Date: Fri, 10 Dec 2010 15:40:48 +1000
27+Subject: [PATCH] r300g: fixup rs690 tiling stride alignment calculations.
28+
29+The RS690 memory controller prefers things to be on a different
30+boundary than the discrete GPUs, we had an attempt to fix this,
31+but it still failed, this consolidates the stride calculation
32+into one place and removes the really special case check.
33+
34+This fixes gnome-shell and 16 piglit tests on my rs690 system.
35+
36+NOTE: This is a candidate for both the 7.9 and 7.10 branches.
37+
38+Signed-off-by: Dave Airlie <airlied@redhat.com>
39+(cherry picked from commit d19b5cbd317620f3977e68fffb7a74793436b7e2)
40+---
41+ src/gallium/drivers/r300/r300_texture.c | 2 +-
42+ src/gallium/drivers/r300/r300_texture_desc.c | 46 +++++++++----------------
43+ src/gallium/drivers/r300/r300_texture_desc.h | 2 +-
44+ 3 files changed, 19 insertions(+), 31 deletions(-)
45+
46+diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
47+index 70fc5d9..6d86bc2 100644
48+--- a/src/gallium/drivers/r300/r300_texture.c
49++++ b/src/gallium/drivers/r300/r300_texture.c
50+@@ -899,7 +899,7 @@ struct pipe_surface* r300_create_surface(struct pipe_context * ctx,
51+ tex->desc.b.b.nr_samples,
52+ tex->desc.microtile,
53+ tex->desc.macrotile[level],
54+- DIM_HEIGHT);
55++ DIM_HEIGHT, 0);
56+
57+ surface->cbzb_height = align((surface->base.height + 1) / 2,
58+ tile_height);
59+diff --git a/src/gallium/drivers/r300/r300_texture_desc.c b/src/gallium/drivers/r300/r300_texture_desc.c
60+index aa82c47..7b17391 100644
61+--- a/src/gallium/drivers/r300/r300_texture_desc.c
62++++ b/src/gallium/drivers/r300/r300_texture_desc.c
63+@@ -34,7 +34,7 @@ unsigned r300_get_pixel_alignment(enum pipe_format format,
64+ unsigned num_samples,
65+ enum r300_buffer_tiling microtile,
66+ enum r300_buffer_tiling macrotile,
67+- enum r300_dim dim)
68++ enum r300_dim dim, boolean is_rs690)
69+ {
70+ static const unsigned table[2][5][3][2] =
71+ {
72+@@ -57,6 +57,7 @@ unsigned r300_get_pixel_alignment(enum pipe_format format,
73+ {{ 16, 8}, { 0, 0}, { 0, 0}} /* 128 bits per pixel */
74+ }
75+ };
76++
77+ static const unsigned aa_block[2] = {4, 8};
78+ unsigned tile = 0;
79+ unsigned pixsize = util_format_get_blocksize(format);
80+@@ -74,6 +75,14 @@ unsigned r300_get_pixel_alignment(enum pipe_format format,
81+ } else {
82+ /* Standard alignment. */
83+ tile = table[macrotile][util_logbase2(pixsize)][microtile][dim];
84++ if (macrotile == 0 && is_rs690 && dim == DIM_WIDTH) {
85++ int align;
86++ int h_tile;
87++ h_tile = table[macrotile][util_logbase2(pixsize)][microtile][DIM_HEIGHT];
88++ align = 64 / (pixsize * h_tile);
89++ if (tile < align)
90++ tile = align;
91++ }
92+ }
93+
94+ assert(tile);
95+@@ -89,7 +98,7 @@ static boolean r300_texture_macro_switch(struct r300_texture_desc *desc,
96+ unsigned tile, texdim;
97+
98+ tile = r300_get_pixel_alignment(desc->b.b.format, desc->b.b.nr_samples,
99+- desc->microtile, R300_BUFFER_TILED, dim);
100++ desc->microtile, R300_BUFFER_TILED, dim, 0);
101+ if (dim == DIM_WIDTH) {
102+ texdim = u_minify(desc->width0, level);
103+ } else {
104+@@ -113,6 +122,9 @@ static unsigned r300_texture_get_stride(struct r300_screen *screen,
105+ unsigned level)
106+ {
107+ unsigned tile_width, width, stride;
108++ boolean is_rs690 = (screen->caps.family == CHIP_FAMILY_RS600 ||
109++ screen->caps.family == CHIP_FAMILY_RS690 ||
110++ screen->caps.family == CHIP_FAMILY_RS740);
111+
112+ if (desc->stride_in_bytes_override)
113+ return desc->stride_in_bytes_override;
114+@@ -131,38 +143,14 @@ static unsigned r300_texture_get_stride(struct r300_screen *screen,
115+ desc->b.b.nr_samples,
116+ desc->microtile,
117+ desc->macrotile[level],
118+- DIM_WIDTH);
119++ DIM_WIDTH, is_rs690);
120+ width = align(width, tile_width);
121+
122+ stride = util_format_get_stride(desc->b.b.format, width);
123+-
124+- /* Some IGPs need a minimum stride of 64 bytes, hmm... */
125+- if (!desc->macrotile[level] &&
126+- (screen->caps.family == CHIP_FAMILY_RS600 ||
127+- screen->caps.family == CHIP_FAMILY_RS690 ||
128+- screen->caps.family == CHIP_FAMILY_RS740)) {
129+- unsigned min_stride;
130+-
131+- if (desc->microtile) {
132+- unsigned tile_height =
133+- r300_get_pixel_alignment(desc->b.b.format,
134+- desc->b.b.nr_samples,
135+- desc->microtile,
136+- desc->macrotile[level],
137+- DIM_HEIGHT);
138+-
139+- min_stride = 64 / tile_height;
140+- } else {
141+- min_stride = 64;
142+- }
143+-
144+- return stride < min_stride ? min_stride : stride;
145+- }
146+-
147+ /* The alignment to 32 bytes is sort of implied by the layout... */
148+ return stride;
149+ } else {
150+- return align(util_format_get_stride(desc->b.b.format, width), 32);
151++ return align(util_format_get_stride(desc->b.b.format, width), is_rs690 ? 64 : 32);
152+ }
153+ }
154+
155+@@ -179,7 +167,7 @@ static unsigned r300_texture_get_nblocksy(struct r300_texture_desc *desc,
156+ desc->b.b.nr_samples,
157+ desc->microtile,
158+ desc->macrotile[level],
159+- DIM_HEIGHT);
160++ DIM_HEIGHT, 0);
161+ height = align(height, tile_height);
162+
163+ /* This is needed for the kernel checker, unfortunately. */
164+diff --git a/src/gallium/drivers/r300/r300_texture_desc.h b/src/gallium/drivers/r300/r300_texture_desc.h
165+index 44d8879..121d215 100644
166+--- a/src/gallium/drivers/r300/r300_texture_desc.h
167++++ b/src/gallium/drivers/r300/r300_texture_desc.h
168+@@ -41,7 +41,7 @@ unsigned r300_get_pixel_alignment(enum pipe_format format,
169+ unsigned num_samples,
170+ enum r300_buffer_tiling microtile,
171+ enum r300_buffer_tiling macrotile,
172+- enum r300_dim dim);
173++ enum r300_dim dim, boolean is_rs690);
174+
175+ boolean r300_texture_desc_init(struct r300_screen *rscreen,
176+ struct r300_texture_desc *desc,
177+--
178+1.7.2.3
179+
180
181=== modified file 'debian/patches/series'
182--- debian/patches/series 2010-12-02 17:15:02 +0000
183+++ debian/patches/series 2011-01-14 19:36:59 +0000
184@@ -9,3 +9,4 @@
185 104_i915_fragment_shader_disable.patch
186 105_use_shared_libdricore.patch
187 106_fix_renderbuffer_segfault.patch
188+108-r300g-fixup-rs690-tiling-stride-align.patch

Subscribers

People subscribed via source and target branches