Skip to content

iris: use helper util_resource_at_index

zhangn1985 requested to merge zhangn1985/mesa:usehelper into main

What does this MR do and why?

iris: use help util_resource_at_index

Signed-off-by: Zhang Ning <zhangn1985@outlook.com>
static struct iris_resource *
get_resource_for_plane(struct pipe_resource *resource,
                       unsigned plane)
{
   unsigned count = 0;
   for (struct pipe_resource *cur = resource; cur; cur = cur->next) {
      if (count++ == plane)
         return (struct iris_resource *)cur;
   }

   return NULL;
}
struct pipe_resource *
util_resource_at_index(const struct pipe_resource *res, unsigned index)
{
   const struct pipe_resource *cur;
   unsigned count;

   for (count = 0, cur = res; cur; cur = cur->next) {
      if (count++ == index)
         return (struct pipe_resource *)cur;
   }

   return NULL;
}

they are same, just let iris use util_resource_at_index

Edited by zhangn1985

Merge request reports