Tested-by: Sven Arvidsson <<a href="mailto:sa@whiz.se">sa@whiz.se</a>><br><br>Posted here:<br><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30036#c6">https://bugs.freedesktop.org/show_bug.cgi?id=30036#c6</a><br>
<br><div class="gmail_quote">On Sun, Sep 12, 2010 at 5:09 AM, Marek Olšák <span dir="ltr"><<a href="mailto:maraeo@gmail.com">maraeo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
This commit fixes bogus CS rejection if it contains a sequence<br>
of the following operations:<br>
<br>
- Set the color buffer 0. track->cb[i].robj becomes non-NULL.<br>
- Render.<br>
- Set a larger zbuffer than the previously-set color buffer.<br>
- Set a larger scissor area as well.<br>
- Set the color channel mask to 0 to do depth-only rendering.<br>
- Render. --> rejected, because track->cb[i].robj remained non-NULL,<br>
therefore the conditional checking for the color channel mask and<br>
friends is not performed, and the larger scissor area causes<br>
the rejection.<br>
<br>
This fixes bugs:<br>
- <a href="https://bugs.freedesktop.org/show_bug.cgi?id=29762" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=29762</a><br>
- <a href="https://bugs.freedesktop.org/show_bug.cgi?id=28869" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=28869</a><br>
And maybe some others which seem to look the same.<br>
<br>
If possible, this commit should go to stable as well.<br>
<br>
Signed-off-by: Marek Olšák <<a href="mailto:maraeo@gmail.com">maraeo@gmail.com</a>><br>
---<br>
drivers/gpu/drm/radeon/r100.c | 11 ++++++-----<br>
1 files changed, 6 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c<br>
index ec64b36..e151f16 100644<br>
--- a/drivers/gpu/drm/radeon/r100.c<br>
+++ b/drivers/gpu/drm/radeon/r100.c<br>
@@ -3297,13 +3297,14 @@ int r100_cs_track_check(struct radeon_device *rdev, struct r100_cs_track *track)<br>
unsigned long size;<br>
unsigned prim_walk;<br>
unsigned nverts;<br>
+ unsigned num_cb = track->num_cb;<br>
<br>
- for (i = 0; i < track->num_cb; i++) {<br>
+ if (!track->zb_cb_clear && !track->color_channel_mask &&<br>
+ !track->blend_read_enable)<br>
+ num_cb = 0;<br>
+<br>
+ for (i = 0; i < num_cb; i++) {<br>
if (track->cb[i].robj == NULL) {<br>
- if (!(track->zb_cb_clear || track->color_channel_mask ||<br>
- track->blend_read_enable)) {<br>
- continue;<br>
- }<br>
DRM_ERROR("[drm] No buffer for color buffer %d !\n", i);<br>
return -EINVAL;<br>
}<br>
<font color="#888888">--<br>
1.7.0.4<br>
<br>
</font></blockquote></div><br>