summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nouveau/nouveau_screen.h
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2014-10-17 14:58:11 +0900
committerIlia Mirkin <imirkin@alum.mit.edu>2015-06-22 01:00:02 -0400
commitf22406837ff5dc881d8496d05ab001204b14eaf5 (patch)
tree580b09b93a4b22eb765264a99b035811e2acf2a8 /src/gallium/drivers/nouveau/nouveau_screen.h
parent57bdcae9e0fbf639014cd375543a8dd356406ac0 (diff)
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>
Diffstat (limited to 'src/gallium/drivers/nouveau/nouveau_screen.h')
-rw-r--r--src/gallium/drivers/nouveau/nouveau_screen.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.h b/src/gallium/drivers/nouveau/nouveau_screen.h
index cf06f7e88aa..30041b271c9 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.h
+++ b/src/gallium/drivers/nouveau/nouveau_screen.h
@@ -51,6 +51,8 @@ struct nouveau_screen {
boolean hint_buf_keep_sysmem_copy;
+ unsigned vram_domain;
+
struct {
unsigned profiles_checked;
unsigned profiles_present;
@@ -94,6 +96,8 @@ struct nouveau_screen {
#endif
};
+#define NV_VRAM_DOMAIN(screen) ((screen)->vram_domain)
+
#ifdef NOUVEAU_ENABLE_DRIVER_STATISTICS
# define NOUVEAU_DRV_STAT(s, n, v) do { \
(s)->stats.named.n += (v); \