Lines Matching refs:layout
114 panfrost_get_layer_stride(const struct pan_image_layout *layout,
117 if (layout->dim != MALI_TEXTURE_DIMENSION_3D)
118 return layout->array_stride;
119 else if (drm_is_afbc(layout->modifier))
120 return layout->slices[level].afbc.surface_stride;
122 return layout->slices[level].surface_stride;
129 panfrost_texture_offset(const struct pan_image_layout *layout,
133 return layout->slices[level].offset +
134 (array_idx * layout->array_stride) +
135 (surface_idx * layout->slices[level].surface_stride);
140 struct pan_image_layout *layout,
162 layout->crc_mode = crc_mode;
163 layout->modifier = modifier;
164 layout->format = format;
165 layout->dim = dim;
166 layout->width = width;
167 layout->height = height;
168 layout->depth = depth;
169 layout->array_size = array_size;
170 layout->nr_samples = nr_samples;
171 layout->nr_slices = nr_slices;
180 bool afbc = drm_is_afbc(layout->modifier);
181 bool tiled = layout->modifier == DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED;
182 bool linear = layout->modifier == DRM_FORMAT_MOD_LINEAR;
184 bool is_3d = layout->dim == MALI_TEXTURE_DIMENSION_3D;
191 tile_w = panfrost_block_dim(layout->modifier, true, 0);
192 tile_h = panfrost_block_dim(layout->modifier, false, 0);
198 struct pan_image_slice_layout *slice = &layout->slices[l];
297 layout->array_stride = ALIGN_POT(offset, 64);
299 layout->data_size = offset;
301 layout->data_size = ALIGN_POT(layout->array_stride * array_size, 4096);
302 layout->crc_size = oob_crc_offset;
313 assert(level < iview->image->layout.nr_slices);
317 bool is_3d = iview->image->layout.dim == MALI_TEXTURE_DIMENSION_3D;
318 const struct pan_image_slice_layout *slice = &iview->image->layout.slices[level];
321 if (drm_is_afbc(iview->image->layout.modifier)) {
325 ASSERTED unsigned depth = u_minify(iview->image->layout.depth, level);
333 assert(layer < iview->image->layout.array_size);
335 panfrost_texture_offset(&iview->image->layout,
344 panfrost_texture_offset(&iview->image->layout, level,
418 } else if (desc->layout == UTIL_FORMAT_LAYOUT_ASTC) {
488 (iview->image->layout.modifier == DRM_FORMAT_MOD_LINEAR);
493 iview->image->layout.nr_samples,
556 panfrost_get_surface_strides(const struct pan_image_layout *layout,
560 const struct pan_image_slice_layout *slice = &layout->slices[l];
562 if (drm_is_afbc(layout->modifier)) {
574 panfrost_get_surface_pointer(const struct pan_image_layout *layout,
582 if (layout->dim == MALI_TEXTURE_DIMENSION_3D) {
584 offset = layout->slices[l].offset +
585 (w * panfrost_get_layer_stride(layout, l));
587 offset = panfrost_texture_offset(layout, l, (w * face_mult) + f, s);
599 const struct pan_image_layout *layout = &iview->image->layout;
614 base |= panfrost_compression_tag(desc, layout->dim, layout->modifier);
616 assert(!drm_is_afbc(layout->modifier) && "no AFBC on v4");
617 assert(desc->layout != UTIL_FORMAT_LAYOUT_ASTC && "no ASTC on v4");
624 unsigned nr_samples = layout->nr_samples;
640 panfrost_get_surface_pointer(layout, iview->dim, base,
652 panfrost_get_surface_strides(layout, iter.level,
673 if (iview->image->layout.modifier != DRM_FORMAT_MOD_LINEAR)
680 unsigned actual = iview->image->layout.slices[l].line_stride;
682 DIV_ROUND_UP(u_minify(iview->image->layout.width, l), block_w) *
712 const struct pan_image_layout *layout = &iview->image->layout;
755 assert(layout->nr_samples == 1);
756 assert(layout->height == 1 && layout->depth == 1);
757 assert(iview->buf.offset + iview->buf.size <= layout->width);
760 width = u_minify(layout->width, iview->first_level);
767 cfg.height = u_minify(layout->height, iview->first_level);
769 cfg.depth = u_minify(layout->depth, iview->first_level);
771 cfg.sample_count = layout->nr_samples;
774 panfrost_modifier_to_layout(layout->modifier);