summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Jones <jajones@nvidia.com>2019-09-13 14:08:27 -0700
committerThierry Reding <treding@nvidia.com>2019-12-04 12:00:11 +0100
commit0f782934ad9f1e327b17d0ee944d1e9160980dc7 (patch)
treec6ec6e0ea5fe681198d09a200176e5a816e81db8
parent3f6f204f7fe756de1510e06f25635481a3ea4f03 (diff)
nouveau: Stash supported sector layout in screen
Older Tegra GPUs use a different sector bit swizzling layout than desktop and Xavier GPUs. Hence their format modifiers must be differentiated from those of other GPUs. As a precursor to supporting more expressive block linear format modifiers, deduce the sector layout used for a given GPU from its chipset and stash the layout in the nouveau screen structure. XXX Test on at least one Tegra sector layout chip. Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--src/gallium/drivers/nouveau/nouveau_screen.c12
-rw-r--r--src/gallium/drivers/nouveau/nouveau_screen.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c
index 7432f14d91f..82f4b0be52a 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.c
+++ b/src/gallium/drivers/nouveau/nouveau_screen.c
@@ -223,6 +223,18 @@ nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev)
size = sizeof(nvc0_data);
}
+ switch (dev->chipset) {
+ case 0x0ea: /* TK1, GK20A */
+ case 0x12b: /* TX1, GM20B */
+ case 0x13b: /* TX2, GP10B */
+ screen->tegra_sector_layout = true;
+ break;
+ default:
+ /* Xavier's GPU and everything else */
+ screen->tegra_sector_layout = false;
+ break;
+ }
+
/*
* Set default VRAM domain if not overridden
*/
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.h b/src/gallium/drivers/nouveau/nouveau_screen.h
index 40464225c75..0abaf4db0f5 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.h
+++ b/src/gallium/drivers/nouveau/nouveau_screen.h
@@ -58,6 +58,7 @@ struct nouveau_screen {
int64_t cpu_gpu_time_delta;
bool hint_buf_keep_sysmem_copy;
+ bool tegra_sector_layout;
unsigned vram_domain;