<div class="gmail_quote">On Mon, Aug 16, 2010 at 2:37 AM, nobled <span dir="ltr">&lt;<a href="mailto:nobled@dreamwidth.org">nobled@dreamwidth.org</a>&gt;</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;">

Except for the first patch, this is mostly adding a bunch of different<br>
null checks:<br>
<br>
1. r300g: Fix macro<br>
This fixes a potential bug if (has_hyperz) is false (it would act as<br>
if has_hyperz is true).<br>
2. r300g: Fix leaks in failed context creation<br>
This patch is the biggest one: It refactors the create/destroy context<br>
functions; before, if r300_create_context failed to allocate something<br>
essential it was either ignored or it only partly cleaned up after<br>
itself (ex: leaking all the allocations in r300_init_atoms(),<br>
forgetting to decrement the number of existing contexts, leaking the<br>
mutexes initialized by r300_hyperz_init_mm, etc), and there&#39;s a *lot*<br>
to stuff to clean up, so this just re-uses the logic in<br>
r300_destroy_context to avoid code duplication.<br>
3. r300g: Let hyperz init fail<br>
Adds a boolean return value to check if the calls to u_mmInit failed<br>
(they can potentially return null)<br></blockquote><div><br>Pushed, thanks!<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
4. gallium: Check if draw_create returns null<br>
This changes all the drivers that depend on the draw module to abort<br>
if draw_create returned null (which it might if using LLVM and on a<br>
CPU without SSE2, or if it just couldn&#39;t allocate memory)<br></blockquote><div><br>The r300g part is ok. Concerning the rest, I&#39;d like to get a consent from the other driver maintainers.<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


5. draw: Check if llvm returns null<br>
Always check for null and don&#39;t rely on assert(), since that won&#39;t<br>
help on non-debug builds. Might also help with<br>
<a href="http://bugs.freedesktop.org/29578" target="_blank">http://bugs.freedesktop.org/29578</a> .<br></blockquote><div><br>I think we should fall back to the non-LLVM path i.e. the slow, interpreted one. Luca has also sent an alternate fix:<br>

<br><a href="http://lists.freedesktop.org/archives/mesa-dev/2010-August/002124.html">http://lists.freedesktop.org/archives/mesa-dev/2010-August/002124.html</a><br></div></div><br>-Marek<br>