iris,crocus: Add proper way of assigning num_levels value

Changes miptree_level_range_length function
to use correct macro and
num_levels value assignment.

Closes: mesa/mesa#8256

Signed-off-by: Viktoriia Palianytsia <v.palianytsia@globallogic.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22067>
This commit is contained in:
Viktoriia Palianytsia
2023-03-20 13:41:16 +02:00
committed by Marge Bot
parent acce5c3fe1
commit c4e8b1cddb
2 changed files with 4 additions and 4 deletions

View File

@@ -760,8 +760,8 @@ miptree_level_range_length(const struct crocus_resource *res,
{
assert(start_level < res->surf.levels);
if (num_levels == INTEL_REMAINING_LAYERS)
num_levels = res->surf.levels;
if (num_levels == INTEL_REMAINING_LEVELS)
num_levels = res->surf.levels - start_level;
/* Check for overflow */
assert(start_level + num_levels >= start_level);

View File

@@ -751,8 +751,8 @@ miptree_level_range_length(const struct iris_resource *res,
{
assert(start_level < res->surf.levels);
if (num_levels == INTEL_REMAINING_LAYERS)
num_levels = res->surf.levels;
if (num_levels == INTEL_REMAINING_LEVELS)
num_levels = res->surf.levels - start_level;
/* Check for overflow */
assert(start_level + num_levels >= start_level);