Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • mesa mesa
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,064
    • Issues 3,064
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1,011
    • Merge requests 1,011
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.

Update #1:

Due to abusive users subverting our CI facilities to mine cryptocurrency, breaking out of the container sandbox in the process, we have been forced to take actions to limit the usage of the public runners to official projects only.

The policy will be enforced on 2023-03-23 (or before if we detect abuses).

Please see this issue for more context and to see if and how you are impacted.

  • MesaMesa
  • mesamesa
  • Merge requests
  • !19482

panfrost: Choose hierarchy masks based on vertex count

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Alyssa Rosenzweig requested to merge alyssa/mesa:panfrost/firefox into main Nov 02, 2022
  • Overview 7
  • Commits 4
  • Pipelines 21
  • Changes 5

Currently, we always use a hierarchy mask with all levels enabled. While this is efficient for geometry-heavy workloads like 3D games, it is wasteful for 2D applications that draw very few vertices. For drawing just a few textured quads, the overhead of small bin sizes outweighs any performance advantages, so it's a bit slower. More problematically, small bin sizes require tremendous amounts of memory for the polygon lists, leading to significant memory consumption (~10MB) for the polygon list for even the simplest of 2D blits.

To reduce our memory footprint, we need to choose our hierarchy masks more carefully. In general, we want to allow small bin sizes for geometry-heavy workloads but not for geometry-light workloads. We estimate vertex count in the driver as a proxy for this, and use a simple heuristic to select a bin size based on the estimated vertex count. None of this is an exact science, and the heuristic could probably be tuned. Nevertheless, the heuristic used (comparing framebuffer size to vertex count) works well in practice, significantly reducing the memory footprint of 2D applications like Firefox without hurting the performance of 3D applications.

I originally wrote this patch while diagnosing high memory footprints on my Midgard laptop, which is why only Midgard is in scope here. On Bifrost and Valhall, we have a similar hiearchy mask selection problem. It seems likely that the same heuristic would work there too, but it's a different code path that I have not integrated or tested. I'll leave that for the adventurous reader, to get the memory footprint win there too.

(It's also possible the win is smaller on newer Malis than on Midgard, since Arm claims they optimized the tiler data structures on the newer parts. There's probably still some merit to the idea.)

Edited Mar 10, 2023 by Alyssa Rosenzweig
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: panfrost/firefox