226382f271a8985a970e18bd82cc582ffff3d2e9
2 * Copyright (C) 2018 Rob Clark <robclark@freedesktop.org>
3 * Copyright © 2018 Google, Inc.
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * Rob Clark <robclark@freedesktop.org>
30 #include "freedreno_layout.h"
33 fdl_layout_buffer(struct fdl_layout
*layout
, uint32_t size
)
35 layout
->width0
= size
;
39 layout
->cpp_shift
= 0;
41 layout
->format
= PIPE_FORMAT_R8_UINT
;
42 layout
->nr_samples
= 1;
46 fdl_dump_layout(struct fdl_layout
*layout
)
48 for (uint32_t level
= 0; level
< ARRAY_SIZE(layout
->slices
) && layout
->slices
[level
].size0
; level
++) {
49 struct fdl_slice
*slice
= &layout
->slices
[level
];
50 struct fdl_slice
*ubwc_slice
= &layout
->ubwc_slices
[level
];
52 fprintf(stderr
, "%s: %ux%ux%u@%ux%u:\t%2u: stride=%4u, size=%6u,%6u, aligned_height=%3u, offset=0x%x,0x%x, layersz %5u,%5u tiling=%d\n",
53 util_format_name(layout
->format
),
54 u_minify(layout
->width0
, level
),
55 u_minify(layout
->height0
, level
),
56 u_minify(layout
->depth0
, level
),
57 layout
->cpp
, layout
->nr_samples
,
60 slice
->size0
, ubwc_slice
->size0
,
61 slice
->size0
/ slice
->pitch
,
62 slice
->offset
, ubwc_slice
->offset
,
63 layout
->layer_size
, layout
->ubwc_layer_size
,
64 fdl_tile_mode(layout
, level
));