panfrost: Fix polygon list size computations
authorIcecream95 <ixn@disroot.org>
Sat, 22 May 2021 19:10:19 +0000 (07:10 +1200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 24 May 2021 13:05:32 +0000 (13:05 +0000)
As noted in f5c293425fa ("panfrost: Correct polygon size computations"),
"We do have to be careful to add the header size to total comptued BO
size."

Fixes: ff3eada7eb4 ("panfrost: Use the generic preload and FB helpers in the gallium driver")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4660
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4737
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10943>

src/panfrost/lib/pan_tiler.c

index 4493f5c..e45240e 100644 (file)
@@ -389,5 +389,6 @@ panfrost_tiler_get_polygon_list_size(const struct panfrost_device *dev,
         unsigned hierarchy_mask =
                 panfrost_choose_hierarchy_mask(fb_width, fb_height, 1, hierarchy);
 
-        return panfrost_tiler_full_size(fb_width, fb_height, hierarchy_mask, hierarchy);
+        return panfrost_tiler_full_size(fb_width, fb_height, hierarchy_mask, hierarchy) +
+                panfrost_tiler_header_size(fb_width, fb_height, hierarchy_mask, hierarchy);
 }