Module: Mesa
Branch: master
Commit: ff534e1b5066f1c8e7969f99f40ec080eee1b907
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ff534e1b5066f1c8e7969f99f40ec080eee1b907

Author: James Jones <[email protected]>
Date:   Fri Sep 13 14:08:27 2019 -0700

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.

Signed-off-by: James Jones <[email protected]>
Tested-by: Karol Herbst <[email protected]>
Tested-by: Simon Ser <[email protected]>
Reviewed-by: Karol Herbst <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3724>

---

 src/gallium/drivers/nouveau/nouveau_screen.c | 12 ++++++++++++
 src/gallium/drivers/nouveau/nouveau_screen.h |  1 +
 2 files changed, 13 insertions(+)

diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c 
b/src/gallium/drivers/nouveau/nouveau_screen.c
index 04d8e6f30d2..80ef7a12c44 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.c
+++ b/src/gallium/drivers/nouveau/nouveau_screen.c
@@ -275,6 +275,18 @@ nouveau_screen_init(struct nouveau_screen *screen, struct 
nouveau_device *dev)
       } while ((start + screen->svm_cutout_size) < BITFIELD64_MASK(limit_bit));
    }
 
+   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 2eb6320b2ec..1176c54db3d 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;
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to