summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost/pan_screen.c
diff options
context:
space:
mode:
authorTomeu Vizoso <[email protected]>2019-07-11 08:06:41 +0200
committerAlyssa Rosenzweig <[email protected]>2019-07-16 08:40:59 -0700
commit5a7688fdecd76c7d9cd87f6f6c93eb32870a2146 (patch)
tree0567857cb4528ecfdc70c0a1099672c6f2fb9fd0 /src/gallium/drivers/panfrost/pan_screen.c
parent6a441151c245d7b59b84502257a0ff1a300b8633 (diff)
panfrost: Use 64-bit descriptors globally
Midgard supports two modes of operation, 32-bit mode and 64-bit mode. The GPU is natively 64-bit, but job descriptors can be submitted in 32-bit mode. Among other changes, 32-bit mode shortens pointer sizes to use 32-bit pointers rather than the full 64-bit range. The blob decides which mode to use based on the CPU bitness, so an armhf system uses 32-bit descriptors and an aarch64 system uses 64-bit descriptors. For a while, we mimicked this, bu inevitably this caused the 32-bit support to lag behind as our reference platform is 64-bit. To combat the code staleness, we traced an older GPU paired with a 64-bit CPU (the Midgard T720 on-board the sunxi H64). From there, we could tell which fields were really about hardware and which fields were simply reflections of the descriptor bitness. From there, we decided to remove support for 32-bit descriptors entirely, using 64-bit descriptors unconditionally. There is minimal performance penalty for this in practice, and it allows us to unify these disparate code paths. This fixes: - T860 + armhf - T820 + armhf - T760 + aarch64 And will help bringup of 1st/2nd generation Midgard regardless of CPU. [Work done by Tomeu. Commit message written by Alyssa.] v2: Add comments preserving information about the old behaviour for future reference. Fix a compiler warning. (Alyssa) Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_screen.c')
-rw-r--r--src/gallium/drivers/panfrost/pan_screen.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index ffd2de4734e..6fe9e60f69a 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -511,22 +511,13 @@ panfrost_create_screen(int fd, struct renderonly *ro)
screen->gpu_id = panfrost_drm_query_gpu_version(screen);
- /* Check if we're loading against a supported GPU model
- * paired with a supported CPU (differences from
- * armhf/aarch64 break models on incompatible CPUs at the
- * moment -- this is a TODO). In other words, we whitelist
- * RK3288, RK3399, and S912, which are verified to work. */
+ /* Check if we're loading against a supported GPU model. */
switch (screen->gpu_id) {
-#ifdef __LP64__
+ case 0x750: /* T760 */
case 0x820: /* T820 */
case 0x860: /* T860 */
break;
-#else
- case 0x750: /* T760 */
- break;
-#endif
-
default:
/* Fail to load against untested models */
debug_printf("panfrost: Unsupported model %X",