17ec681f3Smrg/* 27ec681f3Smrg * Copyright © 2020 Google LLC 37ec681f3Smrg * 47ec681f3Smrg * Permission is hereby granted, free of charge, to any person obtaining a 57ec681f3Smrg * copy of this software and associated documentation files (the "Software"), 67ec681f3Smrg * to deal in the Software without restriction, including without limitation 77ec681f3Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 87ec681f3Smrg * and/or sell copies of the Software, and to permit persons to whom the 97ec681f3Smrg * Software is furnished to do so, subject to the following conditions: 107ec681f3Smrg * 117ec681f3Smrg * The above copyright notice and this permission notice (including the next 127ec681f3Smrg * paragraph) shall be included in all copies or substantial portions of the 137ec681f3Smrg * Software. 147ec681f3Smrg * 157ec681f3Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 167ec681f3Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 177ec681f3Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 187ec681f3Smrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 197ec681f3Smrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 207ec681f3Smrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 217ec681f3Smrg * IN THE SOFTWARE. 227ec681f3Smrg */ 237ec681f3Smrg 247ec681f3Smrg#include "freedreno_layout.h" 257ec681f3Smrg#include "fd_layout_test.h" 267ec681f3Smrg#include "adreno_common.xml.h" 277ec681f3Smrg#include "adreno_pm4.xml.h" 287ec681f3Smrg#include "a6xx.xml.h" 297ec681f3Smrg 307ec681f3Smrg#include <stdio.h> 317ec681f3Smrg 327ec681f3Smrgstatic const struct testcase 337ec681f3Smrg testcases[] = 347ec681f3Smrg { 357ec681f3Smrg /* A straightforward first testcase, linear, with an obvious format. */ 367ec681f3Smrg { 377ec681f3Smrg .format = PIPE_FORMAT_R8G8B8A8_UNORM, 387ec681f3Smrg .layout = 397ec681f3Smrg { 407ec681f3Smrg .width0 = 32, 417ec681f3Smrg .height0 = 32, 427ec681f3Smrg .slices = 437ec681f3Smrg { 447ec681f3Smrg {.offset = 0, .pitch = 256}, 457ec681f3Smrg {.offset = 8192, .pitch = 256}, 467ec681f3Smrg {.offset = 12288, .pitch = 256}, 477ec681f3Smrg {.offset = 14336, .pitch = 256}, 487ec681f3Smrg {.offset = 15360, .pitch = 256}, 497ec681f3Smrg {.offset = 15872, .pitch = 256}, 507ec681f3Smrg }, 517ec681f3Smrg }, 527ec681f3Smrg }, 537ec681f3Smrg 547ec681f3Smrg /* A tiled/ubwc layout from the blob driver, at a size where the a630 557ec681f3Smrg * blob driver does something interesting for linear. 567ec681f3Smrg */ 577ec681f3Smrg { 587ec681f3Smrg .format = PIPE_FORMAT_R8G8B8A8_UNORM, 597ec681f3Smrg .layout = 607ec681f3Smrg { 617ec681f3Smrg .tile_mode = TILE6_3, 627ec681f3Smrg .ubwc = true, 637ec681f3Smrg .width0 = 1024, 647ec681f3Smrg .height0 = 1, 657ec681f3Smrg .slices = 667ec681f3Smrg { 677ec681f3Smrg {.offset = 0, .pitch = 4096}, 687ec681f3Smrg {.offset = 65536, .pitch = 2048}, 697ec681f3Smrg {.offset = 98304, .pitch = 1024}, 707ec681f3Smrg {.offset = 114688, .pitch = 512}, 717ec681f3Smrg {.offset = 122880, .pitch = 256}, 727ec681f3Smrg {.offset = 126976, .pitch = 256}, 737ec681f3Smrg {.offset = 131072, .pitch = 256}, 747ec681f3Smrg {.offset = 135168, .pitch = 256}, 757ec681f3Smrg {.offset = 139264, .pitch = 256}, 767ec681f3Smrg {.offset = 143360, .pitch = 256}, 777ec681f3Smrg {.offset = 147456, .pitch = 256}, 787ec681f3Smrg }, 797ec681f3Smrg .ubwc_slices = 807ec681f3Smrg { 817ec681f3Smrg {.offset = 0, .pitch = 64}, 827ec681f3Smrg {.offset = 4096, .pitch = 64}, 837ec681f3Smrg {.offset = 8192, .pitch = 64}, 847ec681f3Smrg {.offset = 12288, .pitch = 64}, 857ec681f3Smrg {.offset = 16384, .pitch = 64}, 867ec681f3Smrg {.offset = 20480, .pitch = 64}, 877ec681f3Smrg {.offset = 24576, .pitch = 64}, 887ec681f3Smrg {.offset = 28672, .pitch = 64}, 897ec681f3Smrg {.offset = 32768, .pitch = 64}, 907ec681f3Smrg {.offset = 36864, .pitch = 64}, 917ec681f3Smrg {.offset = 40960, .pitch = 64}, 927ec681f3Smrg }, 937ec681f3Smrg }, 947ec681f3Smrg }, 957ec681f3Smrg 967ec681f3Smrg/* An interesting layout from the blob driver on a630, showing that 977ec681f3Smrg * per-level pitch must be derived from level 0's pitch, not width0. We 987ec681f3Smrg * don't do this level 0 pitch disalignment (we pick 4096), so disabled 997ec681f3Smrg * this test for now. 1007ec681f3Smrg */ 1017ec681f3Smrg#if 0 1027ec681f3Smrg { 1037ec681f3Smrg .format = PIPE_FORMAT_R8G8B8A8_UNORM, 1047ec681f3Smrg .layout = { 1057ec681f3Smrg .width0 = 1024, .height0 = 1, 1067ec681f3Smrg .slices = { 1077ec681f3Smrg { .offset = 0, .pitch = 5120 }, 1087ec681f3Smrg { .offset = 5120, .pitch = 2560 }, 1097ec681f3Smrg { .offset = 7680, .pitch = 1280 }, 1107ec681f3Smrg { .offset = 8960, .pitch = 768 }, 1117ec681f3Smrg { .offset = 9728, .pitch = 512 }, 1127ec681f3Smrg { .offset = 10240, .pitch = 256 }, 1137ec681f3Smrg { .offset = 10496, .pitch = 256 }, 1147ec681f3Smrg { .offset = 10752, .pitch = 256 }, 1157ec681f3Smrg { .offset = 11008, .pitch = 256 }, 1167ec681f3Smrg { .offset = 11264, .pitch = 256 }, 1177ec681f3Smrg { .offset = 11520, .pitch = 256 }, 1187ec681f3Smrg }, 1197ec681f3Smrg }, 1207ec681f3Smrg }, 1217ec681f3Smrg#endif 1227ec681f3Smrg 1237ec681f3Smrg /* A layout that we failed on (129 wide has a surprise level 1 pitch 1247ec681f3Smrg * increase), and the sizes bracketing it. 1257ec681f3Smrg */ 1267ec681f3Smrg { 1277ec681f3Smrg .format = PIPE_FORMAT_R8G8B8A8_UNORM, 1287ec681f3Smrg .layout = 1297ec681f3Smrg { 1307ec681f3Smrg .width0 = 128, 1317ec681f3Smrg .height0 = 1, 1327ec681f3Smrg .slices = 1337ec681f3Smrg { 1347ec681f3Smrg {.offset = 0, .pitch = 512}, 1357ec681f3Smrg {.offset = 512, .pitch = 256}, 1367ec681f3Smrg {.offset = 768, .pitch = 256}, 1377ec681f3Smrg {.offset = 1024, .pitch = 256}, 1387ec681f3Smrg {.offset = 1280, .pitch = 256}, 1397ec681f3Smrg {.offset = 1536, .pitch = 256}, 1407ec681f3Smrg {.offset = 1792, .pitch = 256}, 1417ec681f3Smrg {.offset = 2048, .pitch = 256}, 1427ec681f3Smrg }, 1437ec681f3Smrg }, 1447ec681f3Smrg }, 1457ec681f3Smrg { 1467ec681f3Smrg .format = PIPE_FORMAT_R8G8B8A8_UNORM, 1477ec681f3Smrg .layout = 1487ec681f3Smrg { 1497ec681f3Smrg .width0 = 129, 1507ec681f3Smrg .height0 = 1, 1517ec681f3Smrg .slices = 1527ec681f3Smrg { 1537ec681f3Smrg {.offset = 0, .pitch = 768}, 1547ec681f3Smrg {.offset = 768, .pitch = 512}, 1557ec681f3Smrg {.offset = 1280, .pitch = 256}, 1567ec681f3Smrg {.offset = 1536, .pitch = 256}, 1577ec681f3Smrg {.offset = 1792, .pitch = 256}, 1587ec681f3Smrg {.offset = 2048, .pitch = 256}, 1597ec681f3Smrg {.offset = 2304, .pitch = 256}, 1607ec681f3Smrg {.offset = 2560, .pitch = 256}, 1617ec681f3Smrg }, 1627ec681f3Smrg }, 1637ec681f3Smrg }, 1647ec681f3Smrg { 1657ec681f3Smrg .format = PIPE_FORMAT_R8G8B8A8_UNORM, 1667ec681f3Smrg .layout = 1677ec681f3Smrg { 1687ec681f3Smrg .width0 = 130, 1697ec681f3Smrg .height0 = 1, 1707ec681f3Smrg .slices = 1717ec681f3Smrg { 1727ec681f3Smrg {.offset = 0, .pitch = 768}, 1737ec681f3Smrg {.offset = 768, .pitch = 512}, 1747ec681f3Smrg {.offset = 1280, .pitch = 256}, 1757ec681f3Smrg {.offset = 1536, .pitch = 256}, 1767ec681f3Smrg {.offset = 1792, .pitch = 256}, 1777ec681f3Smrg {.offset = 2048, .pitch = 256}, 1787ec681f3Smrg {.offset = 2304, .pitch = 256}, 1797ec681f3Smrg {.offset = 2560, .pitch = 256}, 1807ec681f3Smrg }, 1817ec681f3Smrg }, 1827ec681f3Smrg }, 1837ec681f3Smrg 1847ec681f3Smrg /* The 129 failure seems to be across formats, let's test some cpps */ 1857ec681f3Smrg { 1867ec681f3Smrg .format = PIPE_FORMAT_R8_UNORM, 1877ec681f3Smrg .layout = 1887ec681f3Smrg { 1897ec681f3Smrg .width0 = 129, 1907ec681f3Smrg .height0 = 1, 1917ec681f3Smrg .slices = 1927ec681f3Smrg { 1937ec681f3Smrg {.offset = 0, .pitch = 192}, 1947ec681f3Smrg {.offset = 192, .pitch = 128}, 1957ec681f3Smrg {.offset = 320, .pitch = 64}, 1967ec681f3Smrg {.offset = 384, .pitch = 64}, 1977ec681f3Smrg {.offset = 448, .pitch = 64}, 1987ec681f3Smrg {.offset = 512, .pitch = 64}, 1997ec681f3Smrg {.offset = 576, .pitch = 64}, 2007ec681f3Smrg {.offset = 640, .pitch = 64}, 2017ec681f3Smrg }, 2027ec681f3Smrg }, 2037ec681f3Smrg }, 2047ec681f3Smrg { 2057ec681f3Smrg .format = PIPE_FORMAT_R16_UINT, 2067ec681f3Smrg .layout = 2077ec681f3Smrg { 2087ec681f3Smrg .width0 = 129, 2097ec681f3Smrg .height0 = 1, 2107ec681f3Smrg .slices = 2117ec681f3Smrg { 2127ec681f3Smrg {.offset = 0, .pitch = 384}, 2137ec681f3Smrg {.offset = 384, .pitch = 256}, 2147ec681f3Smrg {.offset = 640, .pitch = 128}, 2157ec681f3Smrg {.offset = 768, .pitch = 128}, 2167ec681f3Smrg {.offset = 896, .pitch = 128}, 2177ec681f3Smrg {.offset = 1024, .pitch = 128}, 2187ec681f3Smrg {.offset = 1152, .pitch = 128}, 2197ec681f3Smrg {.offset = 1280, .pitch = 128}, 2207ec681f3Smrg }, 2217ec681f3Smrg }, 2227ec681f3Smrg }, 2237ec681f3Smrg { 2247ec681f3Smrg .format = PIPE_FORMAT_R32G32B32A32_FLOAT, 2257ec681f3Smrg .layout = 2267ec681f3Smrg { 2277ec681f3Smrg .width0 = 129, 2287ec681f3Smrg .height0 = 1, 2297ec681f3Smrg .slices = 2307ec681f3Smrg { 2317ec681f3Smrg {.offset = 0, .pitch = 3072}, 2327ec681f3Smrg {.offset = 3072, .pitch = 2048}, 2337ec681f3Smrg {.offset = 5120, .pitch = 1024}, 2347ec681f3Smrg {.offset = 6144, .pitch = 1024}, 2357ec681f3Smrg {.offset = 7168, .pitch = 1024}, 2367ec681f3Smrg {.offset = 8192, .pitch = 1024}, 2377ec681f3Smrg {.offset = 9216, .pitch = 1024}, 2387ec681f3Smrg {.offset = 10240, .pitch = 1024}, 2397ec681f3Smrg }, 2407ec681f3Smrg }, 2417ec681f3Smrg }, 2427ec681f3Smrg 2437ec681f3Smrg /* The 129 failure replicated at every +256 pixels wide. Pick one of 2447ec681f3Smrg * them, and this time increase the height as a new variable as well. 2457ec681f3Smrg */ 2467ec681f3Smrg { 2477ec681f3Smrg .format = PIPE_FORMAT_R8G8B8A8_UNORM, 2487ec681f3Smrg .layout = 2497ec681f3Smrg { 2507ec681f3Smrg .width0 = 385, 2517ec681f3Smrg .height0 = 128, 2527ec681f3Smrg .slices = 2537ec681f3Smrg { 2547ec681f3Smrg {.offset = 0, .pitch = 1792}, 2557ec681f3Smrg {.offset = 229376, .pitch = 1024}, 2567ec681f3Smrg {.offset = 294912, .pitch = 512}, 2577ec681f3Smrg {.offset = 311296, .pitch = 256}, 2587ec681f3Smrg {.offset = 315392, .pitch = 256}, 2597ec681f3Smrg {.offset = 317440, .pitch = 256}, 2607ec681f3Smrg {.offset = 318464, .pitch = 256}, 2617ec681f3Smrg {.offset = 318976, .pitch = 256}, 2627ec681f3Smrg {.offset = 319232, .pitch = 256}, 2637ec681f3Smrg }, 2647ec681f3Smrg }, 2657ec681f3Smrg }, 2667ec681f3Smrg 2677ec681f3Smrg /* At 257-259 (and replicated every +256 pixels) we had another 2687ec681f3Smrg failure. */ 2697ec681f3Smrg { 2707ec681f3Smrg .format = PIPE_FORMAT_R8G8B8A8_UNORM, 2717ec681f3Smrg .layout = 2727ec681f3Smrg { 2737ec681f3Smrg .width0 = 257, 2747ec681f3Smrg .height0 = 1, 2757ec681f3Smrg .slices = 2767ec681f3Smrg { 2777ec681f3Smrg {.offset = 0, .pitch = 1280}, 2787ec681f3Smrg {.offset = 1280, .pitch = 768}, 2797ec681f3Smrg {.offset = 2048, .pitch = 512}, 2807ec681f3Smrg {.offset = 2560, .pitch = 256}, 2817ec681f3Smrg {.offset = 2816, .pitch = 256}, 2827ec681f3Smrg {.offset = 3072, .pitch = 256}, 2837ec681f3Smrg {.offset = 3328, .pitch = 256}, 2847ec681f3Smrg {.offset = 3584, .pitch = 256}, 2857ec681f3Smrg {.offset = 3840, .pitch = 256}, 2867ec681f3Smrg }, 2877ec681f3Smrg }, 2887ec681f3Smrg }, 2897ec681f3Smrg { 2907ec681f3Smrg .format = PIPE_FORMAT_R8G8B8A8_UNORM, 2917ec681f3Smrg .layout = 2927ec681f3Smrg { 2937ec681f3Smrg .width0 = 258, 2947ec681f3Smrg .height0 = 1, 2957ec681f3Smrg .slices = 2967ec681f3Smrg { 2977ec681f3Smrg {.offset = 0, .pitch = 1280}, 2987ec681f3Smrg {.offset = 1280, .pitch = 768}, 2997ec681f3Smrg {.offset = 2048, .pitch = 512}, 3007ec681f3Smrg {.offset = 2560, .pitch = 256}, 3017ec681f3Smrg {.offset = 2816, .pitch = 256}, 3027ec681f3Smrg {.offset = 3072, .pitch = 256}, 3037ec681f3Smrg {.offset = 3328, .pitch = 256}, 3047ec681f3Smrg {.offset = 3584, .pitch = 256}, 3057ec681f3Smrg {.offset = 3840, .pitch = 256}, 3067ec681f3Smrg }, 3077ec681f3Smrg }, 3087ec681f3Smrg }, 3097ec681f3Smrg { 3107ec681f3Smrg .format = PIPE_FORMAT_R8G8B8A8_UNORM, 3117ec681f3Smrg .layout = 3127ec681f3Smrg { 3137ec681f3Smrg .width0 = 259, 3147ec681f3Smrg .height0 = 1, 3157ec681f3Smrg .slices = 3167ec681f3Smrg { 3177ec681f3Smrg {.offset = 0, .pitch = 1280}, 3187ec681f3Smrg {.offset = 1280, .pitch = 768}, 3197ec681f3Smrg {.offset = 2048, .pitch = 512}, 3207ec681f3Smrg {.offset = 2560, .pitch = 256}, 3217ec681f3Smrg {.offset = 2816, .pitch = 256}, 3227ec681f3Smrg {.offset = 3072, .pitch = 256}, 3237ec681f3Smrg {.offset = 3328, .pitch = 256}, 3247ec681f3Smrg {.offset = 3584, .pitch = 256}, 3257ec681f3Smrg {.offset = 3840, .pitch = 256}, 3267ec681f3Smrg }, 3277ec681f3Smrg }, 3287ec681f3Smrg }, 3297ec681f3Smrg { 3307ec681f3Smrg .format = PIPE_FORMAT_R8G8B8A8_UNORM, 3317ec681f3Smrg .layout = 3327ec681f3Smrg { 3337ec681f3Smrg .width0 = 260, 3347ec681f3Smrg .height0 = 1, 3357ec681f3Smrg .slices = 3367ec681f3Smrg { 3377ec681f3Smrg {.offset = 0, .pitch = 1280}, 3387ec681f3Smrg {.offset = 1280, .pitch = 768}, 3397ec681f3Smrg {.offset = 2048, .pitch = 512}, 3407ec681f3Smrg {.offset = 2560, .pitch = 256}, 3417ec681f3Smrg {.offset = 2816, .pitch = 256}, 3427ec681f3Smrg {.offset = 3072, .pitch = 256}, 3437ec681f3Smrg {.offset = 3328, .pitch = 256}, 3447ec681f3Smrg {.offset = 3584, .pitch = 256}, 3457ec681f3Smrg {.offset = 3840, .pitch = 256}, 3467ec681f3Smrg }, 3477ec681f3Smrg }, 3487ec681f3Smrg }, 3497ec681f3Smrg 3507ec681f3Smrg /* And, again for the 257-9 failure, test a replica with a larger size*/ 3517ec681f3Smrg { 3527ec681f3Smrg .format = PIPE_FORMAT_R8G8B8A8_UNORM, 3537ec681f3Smrg .layout = 3547ec681f3Smrg { 3557ec681f3Smrg .width0 = 513, 3567ec681f3Smrg .height0 = 32, 3577ec681f3Smrg .slices = 3587ec681f3Smrg { 3597ec681f3Smrg {.offset = 0, .pitch = 2304}, 3607ec681f3Smrg {.offset = 73728, .pitch = 1280}, 3617ec681f3Smrg {.offset = 94208, .pitch = 768}, 3627ec681f3Smrg {.offset = 100352, .pitch = 512}, 3637ec681f3Smrg {.offset = 102400, .pitch = 256}, 3647ec681f3Smrg {.offset = 102912, .pitch = 256}, 3657ec681f3Smrg {.offset = 103168, .pitch = 256}, 3667ec681f3Smrg {.offset = 103424, .pitch = 256}, 3677ec681f3Smrg {.offset = 103680, .pitch = 256}, 3687ec681f3Smrg {.offset = 103936, .pitch = 256}, 3697ec681f3Smrg }, 3707ec681f3Smrg }, 3717ec681f3Smrg }, 3727ec681f3Smrg 3737ec681f3Smrg /* Oh, look. The 513-517 failure extends up to 518 at the next texture 3747ec681f3Smrg * level! 3757ec681f3Smrg */ 3767ec681f3Smrg { 3777ec681f3Smrg .format = PIPE_FORMAT_R8G8B8A8_UNORM, 3787ec681f3Smrg .layout = 3797ec681f3Smrg { 3807ec681f3Smrg .width0 = 518, 3817ec681f3Smrg .height0 = 1, 3827ec681f3Smrg .slices = 3837ec681f3Smrg { 3847ec681f3Smrg {.offset = 0, .pitch = 2304}, 3857ec681f3Smrg {.offset = 2304, .pitch = 1280}, 3867ec681f3Smrg {.offset = 3584, .pitch = 768}, 3877ec681f3Smrg {.offset = 4352, .pitch = 512}, 3887ec681f3Smrg {.offset = 4864, .pitch = 256}, 3897ec681f3Smrg {.offset = 5120, .pitch = 256}, 3907ec681f3Smrg {.offset = 5376, .pitch = 256}, 3917ec681f3Smrg {.offset = 5632, .pitch = 256}, 3927ec681f3Smrg {.offset = 5888, .pitch = 256}, 3937ec681f3Smrg {.offset = 6144, .pitch = 256}, 3947ec681f3Smrg }, 3957ec681f3Smrg }, 3967ec681f3Smrg }, 3977ec681f3Smrg 3987ec681f3Smrg /* Tiled mode testing of the unusual 1/2-bytes-per-pixel pitch 3997ec681f3Smrg alignment */ 4007ec681f3Smrg { 4017ec681f3Smrg .format = PIPE_FORMAT_R8_UNORM, 4027ec681f3Smrg .layout = 4037ec681f3Smrg { 4047ec681f3Smrg .tile_mode = TILE6_3, 4057ec681f3Smrg .width0 = 129, 4067ec681f3Smrg .height0 = 1, 4077ec681f3Smrg .slices = 4087ec681f3Smrg { 4097ec681f3Smrg {.offset = 0, .pitch = 256}, 4107ec681f3Smrg {.offset = 8192, .pitch = 128}, 4117ec681f3Smrg {.offset = 12288, .pitch = 128}, 4127ec681f3Smrg {.offset = 16384, .pitch = 128}, 4137ec681f3Smrg {.offset = 20480, .pitch = 128}, 4147ec681f3Smrg {.offset = 20608, .pitch = 128}, 4157ec681f3Smrg {.offset = 20736, .pitch = 128}, 4167ec681f3Smrg {.offset = 20864, .pitch = 128}, 4177ec681f3Smrg }, 4187ec681f3Smrg }, 4197ec681f3Smrg }, 4207ec681f3Smrg 4217ec681f3Smrg /* Single-level RGBA8888 UBWC following UBWC alignment rules laid out 4227ec681f3Smrg * in msm_media_info.h to verify that we don't break buffer sharing. 4237ec681f3Smrg */ 4247ec681f3Smrg { 4257ec681f3Smrg .format = PIPE_FORMAT_R8G8B8A8_UNORM, 4267ec681f3Smrg .layout = 4277ec681f3Smrg { 4287ec681f3Smrg .tile_mode = TILE6_3, 4297ec681f3Smrg .ubwc = true, 4307ec681f3Smrg .width0 = 16384, 4317ec681f3Smrg .height0 = 129, 4327ec681f3Smrg .slices = 4337ec681f3Smrg { 4347ec681f3Smrg {.offset = 1024 * 48, .pitch = 16384 * 4}, 4357ec681f3Smrg }, 4367ec681f3Smrg .ubwc_slices = 4377ec681f3Smrg { 4387ec681f3Smrg {.offset = 0, .pitch = 1024}, 4397ec681f3Smrg }, 4407ec681f3Smrg }, 4417ec681f3Smrg }, 4427ec681f3Smrg 4437ec681f3Smrg /* UBWC: Pitch comes from POT-aligned level 0. */ 4447ec681f3Smrg /* Pitch fixed in this commit, but offsets broken. Will be fixed in 4457ec681f3Smrg * following commits. 4467ec681f3Smrg */ 4477ec681f3Smrg { 4487ec681f3Smrg .format = PIPE_FORMAT_R8G8B8A8_UNORM, 4497ec681f3Smrg .layout = 4507ec681f3Smrg { 4517ec681f3Smrg .tile_mode = TILE6_3, 4527ec681f3Smrg .ubwc = true, 4537ec681f3Smrg .width0 = 2049, 4547ec681f3Smrg .height0 = 128, 4557ec681f3Smrg .slices = 4567ec681f3Smrg { 4577ec681f3Smrg {.offset = 0, .pitch = 8448}, 4587ec681f3Smrg {.offset = 1081344, .pitch = 4352}, 4597ec681f3Smrg {.offset = 1359872, .pitch = 2304}, 4607ec681f3Smrg {.offset = 1433600, .pitch = 1280}, 4617ec681f3Smrg {.offset = 1454080, .pitch = 768}, 4627ec681f3Smrg {.offset = 1466368, .pitch = 512}, 4637ec681f3Smrg {.offset = 1474560, .pitch = 256}, 4647ec681f3Smrg {.offset = 1478656, .pitch = 256}, 4657ec681f3Smrg {.offset = 1482752, .pitch = 256}, 4667ec681f3Smrg {.offset = 1486848, .pitch = 256}, 4677ec681f3Smrg {.offset = 1490944, .pitch = 256}, 4687ec681f3Smrg {.offset = 1495040, .pitch = 256}, 4697ec681f3Smrg }, 4707ec681f3Smrg .ubwc_slices = 4717ec681f3Smrg { 4727ec681f3Smrg {.offset = 0, .pitch = 256}, 4737ec681f3Smrg {.offset = 16384, .pitch = 128}, 4747ec681f3Smrg {.offset = 24576, .pitch = 64}, 4757ec681f3Smrg {.offset = 28672, .pitch = 64}, 4767ec681f3Smrg {.offset = 32768, .pitch = 64}, 4777ec681f3Smrg {.offset = 36864, .pitch = 64}, 4787ec681f3Smrg {.offset = 40960, .pitch = 64}, 4797ec681f3Smrg {.offset = 45056, .pitch = 64}, 4807ec681f3Smrg {.offset = 49152, .pitch = 64}, 4817ec681f3Smrg {.offset = 53248, .pitch = 64}, 4827ec681f3Smrg {.offset = 57344, .pitch = 64}, 4837ec681f3Smrg {.offset = 61440, .pitch = 64}, 4847ec681f3Smrg }, 4857ec681f3Smrg }, 4867ec681f3Smrg }, 4877ec681f3Smrg /* UBWC: Height comes from POT-aligned level 0. */ 4887ec681f3Smrg { 4897ec681f3Smrg .format = PIPE_FORMAT_R8G8B8A8_UNORM, 4907ec681f3Smrg .layout = 4917ec681f3Smrg { 4927ec681f3Smrg .tile_mode = TILE6_3, 4937ec681f3Smrg .ubwc = true, 4947ec681f3Smrg .width0 = 1024, 4957ec681f3Smrg .height0 = 1025, 4967ec681f3Smrg .slices = 4977ec681f3Smrg { 4987ec681f3Smrg {.offset = 0, .pitch = 4096}, 4997ec681f3Smrg {.offset = 4259840, .pitch = 2048}, 5007ec681f3Smrg {.offset = 5308416, .pitch = 1024}, 5017ec681f3Smrg {.offset = 5570560, .pitch = 512}, 5027ec681f3Smrg {.offset = 5636096, .pitch = 256}, 5037ec681f3Smrg {.offset = 5652480, .pitch = 256}, 5047ec681f3Smrg {.offset = 5660672, .pitch = 256}, 5057ec681f3Smrg {.offset = 5664768, .pitch = 256}, 5067ec681f3Smrg {.offset = 5668864, .pitch = 256}, 5077ec681f3Smrg {.offset = 5672960, .pitch = 256}, 5087ec681f3Smrg {.offset = 5677056, .pitch = 256}, 5097ec681f3Smrg }, 5107ec681f3Smrg .ubwc_slices = 5117ec681f3Smrg { 5127ec681f3Smrg {.offset = 0, .pitch = 64}, 5137ec681f3Smrg {.offset = 32768, .pitch = 64}, 5147ec681f3Smrg {.offset = 49152, .pitch = 64}, 5157ec681f3Smrg {.offset = 57344, .pitch = 64}, 5167ec681f3Smrg {.offset = 61440, .pitch = 64}, 5177ec681f3Smrg {.offset = 65536, .pitch = 64}, 5187ec681f3Smrg {.offset = 69632, .pitch = 64}, 5197ec681f3Smrg {.offset = 73728, .pitch = 64}, 5207ec681f3Smrg {.offset = 77824, .pitch = 64}, 5217ec681f3Smrg {.offset = 81920, .pitch = 64}, 5227ec681f3Smrg {.offset = 86016, .pitch = 64}, 5237ec681f3Smrg }, 5247ec681f3Smrg }, 5257ec681f3Smrg }, 5267ec681f3Smrg 5277ec681f3Smrg /* UBWC: Get at minimum height of a level across cpps */ 5287ec681f3Smrg { 5297ec681f3Smrg .format = PIPE_FORMAT_R16_UINT, 5307ec681f3Smrg .layout = 5317ec681f3Smrg { 5327ec681f3Smrg .tile_mode = TILE6_3, 5337ec681f3Smrg .ubwc = true, 5347ec681f3Smrg .width0 = 16384, 5357ec681f3Smrg .height0 = 1, 5367ec681f3Smrg .slices = 5377ec681f3Smrg { 5387ec681f3Smrg {.offset = 0, .pitch = 32768}, 5397ec681f3Smrg {.offset = 524288, .pitch = 16384}, 5407ec681f3Smrg {.offset = 786432, .pitch = 8192}, 5417ec681f3Smrg {.offset = 917504, .pitch = 4096}, 5427ec681f3Smrg {.offset = 983040, .pitch = 2048}, 5437ec681f3Smrg {.offset = 1015808, .pitch = 1024}, 5447ec681f3Smrg {.offset = 1032192, .pitch = 512}, 5457ec681f3Smrg {.offset = 1040384, .pitch = 256}, 5467ec681f3Smrg {.offset = 1044480, .pitch = 256}, 5477ec681f3Smrg {.offset = 1048576, .pitch = 256}, 5487ec681f3Smrg {.offset = 1052672, .pitch = 256}, 5497ec681f3Smrg {.offset = 1056768, .pitch = 256}, 5507ec681f3Smrg {.offset = 1060864, .pitch = 256}, 5517ec681f3Smrg {.offset = 1064960, .pitch = 256}, 5527ec681f3Smrg {.offset = 1069056, .pitch = 256}, 5537ec681f3Smrg }, 5547ec681f3Smrg .ubwc_slices = 5557ec681f3Smrg { 5567ec681f3Smrg {.offset = 0, .pitch = 1024}, 5577ec681f3Smrg {.offset = 65536, .pitch = 512}, 5587ec681f3Smrg {.offset = 98304, .pitch = 256}, 5597ec681f3Smrg {.offset = 114688, .pitch = 128}, 5607ec681f3Smrg {.offset = 122880, .pitch = 64}, 5617ec681f3Smrg {.offset = 126976, .pitch = 64}, 5627ec681f3Smrg {.offset = 131072, .pitch = 64}, 5637ec681f3Smrg {.offset = 135168, .pitch = 64}, 5647ec681f3Smrg {.offset = 139264, .pitch = 64}, 5657ec681f3Smrg {.offset = 143360, .pitch = 64}, 5667ec681f3Smrg {.offset = 147456, .pitch = 64}, 5677ec681f3Smrg {.offset = 151552, .pitch = 64}, 5687ec681f3Smrg {.offset = 155648, .pitch = 64}, 5697ec681f3Smrg {.offset = 159744, .pitch = 64}, 5707ec681f3Smrg {.offset = 163840, .pitch = 64}, 5717ec681f3Smrg }, 5727ec681f3Smrg }, 5737ec681f3Smrg }, 5747ec681f3Smrg { 5757ec681f3Smrg .format = PIPE_FORMAT_R8G8B8A8_UNORM, 5767ec681f3Smrg .layout = 5777ec681f3Smrg { 5787ec681f3Smrg .tile_mode = TILE6_3, 5797ec681f3Smrg .ubwc = true, 5807ec681f3Smrg .width0 = 16384, 5817ec681f3Smrg .height0 = 1, 5827ec681f3Smrg .slices = 5837ec681f3Smrg { 5847ec681f3Smrg {.offset = 0, .pitch = 65536}, 5857ec681f3Smrg {.offset = 1048576, .pitch = 32768}, 5867ec681f3Smrg {.offset = 1572864, .pitch = 16384}, 5877ec681f3Smrg {.offset = 1835008, .pitch = 8192}, 5887ec681f3Smrg {.offset = 1966080, .pitch = 4096}, 5897ec681f3Smrg {.offset = 2031616, .pitch = 2048}, 5907ec681f3Smrg {.offset = 2064384, .pitch = 1024}, 5917ec681f3Smrg {.offset = 2080768, .pitch = 512}, 5927ec681f3Smrg {.offset = 2088960, .pitch = 256}, 5937ec681f3Smrg {.offset = 2093056, .pitch = 256}, 5947ec681f3Smrg {.offset = 2097152, .pitch = 256}, 5957ec681f3Smrg {.offset = 2101248, .pitch = 256}, 5967ec681f3Smrg {.offset = 2105344, .pitch = 256}, 5977ec681f3Smrg {.offset = 2109440, .pitch = 256}, 5987ec681f3Smrg {.offset = 2113536, .pitch = 256}, 5997ec681f3Smrg }, 6007ec681f3Smrg .ubwc_slices = 6017ec681f3Smrg { 6027ec681f3Smrg {.offset = 0, .pitch = 1024}, 6037ec681f3Smrg {.offset = 65536, .pitch = 512}, 6047ec681f3Smrg {.offset = 98304, .pitch = 256}, 6057ec681f3Smrg {.offset = 114688, .pitch = 128}, 6067ec681f3Smrg {.offset = 122880, .pitch = 64}, 6077ec681f3Smrg {.offset = 126976, .pitch = 64}, 6087ec681f3Smrg {.offset = 131072, .pitch = 64}, 6097ec681f3Smrg {.offset = 135168, .pitch = 64}, 6107ec681f3Smrg {.offset = 139264, .pitch = 64}, 6117ec681f3Smrg {.offset = 143360, .pitch = 64}, 6127ec681f3Smrg {.offset = 147456, .pitch = 64}, 6137ec681f3Smrg {.offset = 151552, .pitch = 64}, 6147ec681f3Smrg {.offset = 155648, .pitch = 64}, 6157ec681f3Smrg {.offset = 159744, .pitch = 64}, 6167ec681f3Smrg {.offset = 163840, .pitch = 64}, 6177ec681f3Smrg }, 6187ec681f3Smrg }, 6197ec681f3Smrg }, 6207ec681f3Smrg { 6217ec681f3Smrg .format = PIPE_FORMAT_R32G32B32A32_FLOAT, 6227ec681f3Smrg .layout = 6237ec681f3Smrg { 6247ec681f3Smrg .tile_mode = TILE6_3, 6257ec681f3Smrg .ubwc = true, 6267ec681f3Smrg .width0 = 16384, 6277ec681f3Smrg .height0 = 1, 6287ec681f3Smrg .slices = 6297ec681f3Smrg { 6307ec681f3Smrg {.offset = 0, .pitch = 262144}, 6317ec681f3Smrg {.offset = 4194304, .pitch = 131072}, 6327ec681f3Smrg {.offset = 6291456, .pitch = 65536}, 6337ec681f3Smrg {.offset = 7340032, .pitch = 32768}, 6347ec681f3Smrg {.offset = 7864320, .pitch = 16384}, 6357ec681f3Smrg {.offset = 8126464, .pitch = 8192}, 6367ec681f3Smrg {.offset = 8257536, .pitch = 4096}, 6377ec681f3Smrg {.offset = 8323072, .pitch = 2048}, 6387ec681f3Smrg {.offset = 8355840, .pitch = 1024}, 6397ec681f3Smrg {.offset = 8372224, .pitch = 1024}, 6407ec681f3Smrg {.offset = 8388608, .pitch = 1024}, 6417ec681f3Smrg {.offset = 8404992, .pitch = 1024}, 6427ec681f3Smrg {.offset = 8421376, .pitch = 1024}, 6437ec681f3Smrg {.offset = 8437760, .pitch = 1024}, 6447ec681f3Smrg {.offset = 8454144, .pitch = 1024}, 6457ec681f3Smrg }, 6467ec681f3Smrg .ubwc_slices = 6477ec681f3Smrg { 6487ec681f3Smrg {.offset = 0, .pitch = 4096}, 6497ec681f3Smrg {.offset = 262144, .pitch = 2048}, 6507ec681f3Smrg {.offset = 393216, .pitch = 1024}, 6517ec681f3Smrg {.offset = 458752, .pitch = 512}, 6527ec681f3Smrg {.offset = 491520, .pitch = 256}, 6537ec681f3Smrg {.offset = 507904, .pitch = 128}, 6547ec681f3Smrg {.offset = 516096, .pitch = 64}, 6557ec681f3Smrg {.offset = 520192, .pitch = 64}, 6567ec681f3Smrg {.offset = 524288, .pitch = 64}, 6577ec681f3Smrg {.offset = 528384, .pitch = 64}, 6587ec681f3Smrg {.offset = 532480, .pitch = 64}, 6597ec681f3Smrg {.offset = 536576, .pitch = 64}, 6607ec681f3Smrg {.offset = 540672, .pitch = 64}, 6617ec681f3Smrg {.offset = 544768, .pitch = 64}, 6627ec681f3Smrg {.offset = 548864, .pitch = 64}, 6637ec681f3Smrg }, 6647ec681f3Smrg }, 6657ec681f3Smrg }, 6667ec681f3Smrg 6677ec681f3Smrg { 6687ec681f3Smrg .format = PIPE_FORMAT_R8G8B8A8_UNORM, 6697ec681f3Smrg .layout = 6707ec681f3Smrg { 6717ec681f3Smrg .tile_mode = TILE6_3, 6727ec681f3Smrg .ubwc = true, 6737ec681f3Smrg .nr_samples = 4, 6747ec681f3Smrg .width0 = 412, 6757ec681f3Smrg .height0 = 732, 6767ec681f3Smrg .slices = 6777ec681f3Smrg { 6787ec681f3Smrg {.offset = 0, .pitch = 7168}, 6797ec681f3Smrg }, 6807ec681f3Smrg .ubwc_slices = 6817ec681f3Smrg { 6827ec681f3Smrg {.offset = 0, .pitch = 128}, 6837ec681f3Smrg }, 6847ec681f3Smrg }, 6857ec681f3Smrg }, 6867ec681f3Smrg}; 6877ec681f3Smrg 6887ec681f3Smrgint 6897ec681f3Smrgmain(int argc, char **argv) 6907ec681f3Smrg{ 6917ec681f3Smrg int ret = 0; 6927ec681f3Smrg 6937ec681f3Smrg for (int i = 0; i < ARRAY_SIZE(testcases); i++) { 6947ec681f3Smrg if (!fdl_test_layout(&testcases[i], 630)) 6957ec681f3Smrg ret = 1; 6967ec681f3Smrg } 6977ec681f3Smrg 6987ec681f3Smrg return ret; 6997ec681f3Smrg} 700