OSDN Git Service

nouveau: support for custom VRAM domains
authorAlexandre Courbot <acourbot@nvidia.com>
Fri, 17 Oct 2014 05:58:11 +0000 (14:58 +0900)
committerIlia Mirkin <imirkin@alum.mit.edu>
Mon, 22 Jun 2015 05:00:02 +0000 (01:00 -0400)
commitf22406837ff5dc881d8496d05ab001204b14eaf5
tree580b09b93a4b22eb765264a99b035811e2acf2a8
parent57bdcae9e0fbf639014cd375543a8dd356406ac0
nouveau: support for custom VRAM domains

Some GPUs (e.g. GK20A, GM20B) do not embed VRAM of their own and use
the system memory as a backend instead. For such systems, allocating
objects in VRAM results in errors since the kernel will not allow
VRAM objects allocations.

This patch adds a vram_domain member to struct nouveau_screen that can
optionally be initialized to an alternative domain to use for VRAM
allocations. If left untouched, NOUVEAU_BO_VRAM will be used for
systems that embed VRAM, and NOUVEAU_BO_GART will be used for VRAM-less
systems.

Code that uses GPU objects is then expected to use the NV_VRAM_DOMAIN()
macro in place of NOUVEAU_BO_VRAM to ensure correct behavior on
VRAM-less chips.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Martin Peres <martin.peres@free.fr>
src/gallium/drivers/nouveau/nouveau_screen.c
src/gallium/drivers/nouveau/nouveau_screen.h