mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 16:30:10 +01:00
panfrost: Fix estimate_texture_payload_size() on Bifrost
Bifrost mandates manual stride usage.
Fixes: a3d2936a8e ("panfrost: The texture descriptor has a pointer to a trampoline")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8449>
This commit is contained in:
parent
2cf41ae494
commit
38823ba60d
3 changed files with 21 additions and 12 deletions
|
|
@ -1064,7 +1064,8 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
|
|||
|
||||
unsigned size =
|
||||
(is_bifrost ? 0 : MALI_MIDGARD_TEXTURE_LENGTH) +
|
||||
panfrost_estimate_texture_payload_size(first_level, last_level,
|
||||
panfrost_estimate_texture_payload_size(device,
|
||||
first_level, last_level,
|
||||
first_layer, last_layer,
|
||||
texture->nr_samples,
|
||||
type,
|
||||
|
|
|
|||
|
|
@ -220,14 +220,19 @@ panfrost_texture_num_elements(
|
|||
* as an allocation amount */
|
||||
|
||||
unsigned
|
||||
panfrost_estimate_texture_payload_size(
|
||||
unsigned first_level, unsigned last_level,
|
||||
unsigned first_layer, unsigned last_layer,
|
||||
unsigned nr_samples,
|
||||
enum mali_texture_dimension dim, uint64_t modifier)
|
||||
panfrost_estimate_texture_payload_size(const struct panfrost_device *dev,
|
||||
unsigned first_level,
|
||||
unsigned last_level,
|
||||
unsigned first_layer,
|
||||
unsigned last_layer,
|
||||
unsigned nr_samples,
|
||||
enum mali_texture_dimension dim,
|
||||
uint64_t modifier)
|
||||
{
|
||||
bool is_bifrost = dev->quirks & IS_BIFROST;
|
||||
/* Assume worst case */
|
||||
unsigned manual_stride = (modifier == DRM_FORMAT_MOD_LINEAR);
|
||||
unsigned manual_stride = is_bifrost ||
|
||||
(modifier == DRM_FORMAT_MOD_LINEAR);
|
||||
|
||||
unsigned elements = panfrost_texture_num_elements(
|
||||
first_level, last_level,
|
||||
|
|
|
|||
|
|
@ -124,11 +124,14 @@ unsigned
|
|||
panfrost_block_dim(uint64_t modifier, bool width, unsigned plane);
|
||||
|
||||
unsigned
|
||||
panfrost_estimate_texture_payload_size(
|
||||
unsigned first_level, unsigned last_level,
|
||||
unsigned first_layer, unsigned last_layer,
|
||||
unsigned nr_samples,
|
||||
enum mali_texture_dimension dim, uint64_t modifier);
|
||||
panfrost_estimate_texture_payload_size(const struct panfrost_device *dev,
|
||||
unsigned first_level,
|
||||
unsigned last_level,
|
||||
unsigned first_layer,
|
||||
unsigned last_layer,
|
||||
unsigned nr_samples,
|
||||
enum mali_texture_dimension dim,
|
||||
uint64_t modifier);
|
||||
|
||||
void
|
||||
panfrost_new_texture(const struct panfrost_device *dev,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue