From: Ilia Mirkin Subject: [PATCH 12/19] nv50: allocate an extra code bo to avoid dmesg spam Date: Mon, 13 Jan 2014 14:19:28 -0500 Message-ID: <1389640775-25046-13-git-send-email-imirkin@alum.mit.edu> References: <1389640775-25046-1-git-send-email-imirkin@alum.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1389640775-25046-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: nouveau-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Errors-To: nouveau-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org To: mesa-dev-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org List-Id: nouveau.vger.kernel.org Each code BO is a heap that allocates at the end first, and so GPs are allocated at the very end of the allocated space. When executing, we see PAGE_NOT_PRESENT errors for the next page. Just over-allocate to make sure that there's something there. Signed-off-by: Ilia Mirkin --- src/gallium/drivers/nouveau/nv50/nv50_screen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c index 43e0f50..82b0207 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c @@ -739,8 +739,12 @@ nv50_screen_create(struct nouveau_device *dev) goto fail; } + /* This over-allocates by a whole code BO. The GP, which would execute at + * the end of the last page, would trigger faults. The going theory is that + * it prefetches up to a certain amount. This avoids dmesg spam. + */ ret = nouveau_bo_new(dev, NOUVEAU_BO_VRAM, 1 << 16, - 3 << NV50_CODE_BO_SIZE_LOG2, NULL, &screen->code); + 4 << NV50_CODE_BO_SIZE_LOG2, NULL, &screen->code); if (ret) { NOUVEAU_ERR("Failed to allocate code bo: %d\n", ret); goto fail; -- 1.8.3.2