Lines Matching defs:layout
219 panfrost_get_layer_stride(const struct pan_image_layout *layout,
222 if (layout->dim != MALI_TEXTURE_DIMENSION_3D)
223 return layout->array_stride;
224 else if (drm_is_afbc(layout->modifier))
225 return layout->slices[level].afbc.surface_stride;
227 return layout->slices[level].surface_stride;
231 panfrost_get_legacy_stride(const struct pan_image_layout *layout,
234 unsigned row_stride = layout->slices[level].row_stride;
236 panfrost_block_size(layout->modifier, layout->format);
238 if (drm_is_afbc(layout->modifier)) {
239 unsigned width = u_minify(layout->width, level);
242 return width * util_format_get_blocksize(layout->format);
269 panfrost_texture_offset(const struct pan_image_layout *layout,
273 return layout->slices[level].offset +
274 (array_idx * layout->array_stride) +
275 (surface_idx * layout->slices[level].surface_stride);
307 pan_image_layout_init(struct pan_image_layout *layout,
314 (layout->depth > 1 || layout->nr_samples > 1 ||
315 layout->array_size > 1 || layout->dim != MALI_TEXTURE_DIMENSION_2D ||
316 layout->nr_slices > 1 || layout->crc_mode == PAN_IMAGE_CRC_INBAND))
326 !(pan_is_stride_aligned(layout->format, explicit_layout->offset) &&
327 pan_is_stride_aligned(layout->format, explicit_layout->row_stride)))
330 unsigned fmt_blocksize = util_format_get_blocksize(layout->format);
335 assert(layout->depth == 1 || layout->nr_samples == 1);
337 bool afbc = drm_is_afbc(layout->modifier);
338 bool linear = layout->modifier == DRM_FORMAT_MOD_LINEAR;
339 bool is_3d = layout->dim == MALI_TEXTURE_DIMENSION_3D;
344 panfrost_block_size(layout->modifier, layout->format);
346 unsigned width = layout->width;
347 unsigned height = layout->height;
348 unsigned depth = layout->depth;
355 align_w *= pan_afbc_tile_size(layout->modifier);
356 align_h *= pan_afbc_tile_size(layout->modifier);
359 for (unsigned l = 0; l < layout->nr_slices; ++l) {
360 struct pan_image_slice_layout *slice = &layout->slices[l];
362 unsigned effective_width = ALIGN_POT(util_format_get_nblocksx(layout->format, width), align_w);
363 unsigned effective_height = ALIGN_POT(util_format_get_nblocksy(layout->format, height), align_h);
391 assert(pan_is_stride_aligned(layout->format, row_stride) &&
399 pan_afbc_row_stride(layout->modifier, effective_width);
402 pan_afbc_body_align(layout->modifier));
429 slice_one_size * depth * layout->nr_samples;
433 assert(pan_is_stride_aligned(layout->format, slice->surface_stride) &&
443 if (layout->crc_mode != PAN_IMAGE_CRC_NONE) {
447 if (layout->crc_mode == PAN_IMAGE_CRC_INBAND) {
463 layout->array_stride = ALIGN_POT(offset, 64);
465 layout->data_size = offset;
467 layout->data_size = ALIGN_POT(layout->array_stride * layout->array_size, 4096);
468 layout->crc_size = oob_crc_offset;
479 assert(level < iview->image->layout.nr_slices);
483 bool is_3d = iview->image->layout.dim == MALI_TEXTURE_DIMENSION_3D;
484 const struct pan_image_slice_layout *slice = &iview->image->layout.slices[level];
487 if (drm_is_afbc(iview->image->layout.modifier)) {
491 ASSERTED unsigned depth = u_minify(iview->image->layout.depth, level);
499 assert(layer < iview->image->layout.array_size);
501 panfrost_texture_offset(&iview->image->layout,
510 panfrost_texture_offset(&iview->image->layout, level,