Skip to content

gl.rs: Fix Mali Bifrost GPU detection on Mesa's Panfrost driver#300

Closed
qwertychouskie wants to merge 1 commit into
mozilla-firefox:mainfrom
qwertychouskie:patch-1
Closed

gl.rs: Fix Mali Bifrost GPU detection on Mesa's Panfrost driver#300
qwertychouskie wants to merge 1 commit into
mozilla-firefox:mainfrom
qwertychouskie:patch-1

Conversation

@qwertychouskie

Copy link
Copy Markdown

The GL_RENDERER string contains more information when using the Panfrost driver from Mesa. For example, an Arm Mali-G31 GPU currently returns this render string: Mali-G31 MC1 (Panfrost)

Exact-matching the string would result in not properly considering these GPUs to be Bifrost. Using starts_with instead should make these GPUs detect properly when using Panfrost, while not changing detection with the proprietary driver.

Note: This will probably result in supports_render_target_partial_update being false when using Panfrost on a Bifrost GPU, were it would have returned true before, due to the GPU being mistakenly identified as Valhall. If supports_render_target_partial_update works on Panfrost, the check should probably be updated to only return false if Panfrost isn't present in the render string. Honestly, a lot of the generation-specific feature disabling probably needs to be tested and adjusted to account for Panfrost anyways. (For that matter, this probably applies to other Mesa drivers, such as Freedreno.) That said, it's better safe than sorry, so for now, properly detecting Bifrost GPUs as Bifrost and not Valhall is probably the best first step.

Note: I haven't tested this; I actually noticed this issue while doing some research unrelated to Firefox. It should be correct from a technical standpoint, as best as I can tell, and the change is extremely simple, so I feel comfortable submitting this PR.

The `GL_RENDERER` string contains more information when using the Panfrost driver from Mesa.  For example, an Arm Mali-G31 GPU currently returns this render string: `Mali-G31 MC1 (Panfrost)`

Exact-matching the string would result in not properly considering these GPUs to be Bifrost.  Using `starts_with` instead should make these GPUs detect properly when using Panfrost, while not changing detection with the proprietary driver.

Signed-off-by: QwertyChouskie <qwertychouskie@users.noreply.github.com>
@firefoxci-taskcluster

Copy link
Copy Markdown
No Taskcluster jobs started for this pull request

The allowPullRequests configuration for this repository (in .taskcluster.yml on the default branch) does not allow starting tasks for this pull request.

@github-actions

Copy link
Copy Markdown
Contributor

(Automated Close) Please do not file pull requests here, see https://firefox-source-docs.mozilla.org/contributing/how_to_submit_a_patch.html

@github-actions github-actions Bot closed this Jun 18, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant