Skip to content
  • Michel Dänzer's avatar
    gallium/util: Break recursion in pipe_resource_reference · 3700dc5f
    Michel Dänzer authored and Andres Gomez's avatar Andres Gomez committed
    It calling itself recursively prevented it from being inlined, resulting
    in a copy being generated in every compilation unit referencing it. This
    bloated the text segment of the Gallium mega-driver *_dri.so by ~4%,
    and might also have impacted performance.
    
    Fixes: ecd6fce2
    
     ("mesa/st: support lowering multi-planar YUV")
    v2:
    * Add comment above pipe_resource_next_reference [Samuel Pitoiset]
    v3:
    * Use loop to unreference the full chain of resources referenced via
      the next members [Timothy Arceri]
    v4:
    * Stop chasing ->next chain at the first sub-resource which isn't
      destroyed [Nicolai Hähnle]
    
    Reviewed-by: default avatarNicolai Hähnle <nicolai.haehnle@amd.com>
    Reviewed-by: default avatarMarek Olšák <marek.olsak@amd.com>
    (cherry picked from commit 176e7615)
    3700dc5f