<div dir="ltr"><div dir="ltr">On Thu, Feb 21, 2019 at 5:07 PM Alyssa Rosenzweig <<a href="mailto:alyssa@rosenzweig.io" target="_blank">alyssa@rosenzweig.io</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> Yes, there is a buffer for holding the results of the tiler. The way it<br>
> works is that the userspace driver allocates a very large buffer with a<br>
> "grow on page fault" bit, so the kernel will allocate more memory as the<br>
> tiler asks for it.<br>
<br>
To be clear, right now I have this magic misc_0 buffer setup that way,<br>
too (allocating something enormous and setting GROW_ON_GPF). Although,<br>
it's not clear to me that that is the _correct_ thing to do; IIRC, the<br>
blob allocates "just enough", no GROW_ON_GPF needed, but I should<br>
probably check that.<br></blockquote><div><br></div><div>I don't know about Midgard, but on Bifrost it definitely uses GROW_ON_GPF, telling the kernel to preallocate some small-ish initial set, presumably as an optimization. I don't think you can accurately predict how much memory you're going to need ahead of time, since it depends on how the triangles are distributed along the screen.<br></div></div></div>