Skip to content
GitLab
Projects Groups Topics 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
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 3.2k
    • Issues 3.2k
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1k
    • Merge requests 1k
  • 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
  • MesaMesa
  • mesamesa
  • Merge requests
  • !9902

GBM alternate backend discovery and loading

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged James Jones requested to merge cubanismo/mesa:gbm_loader into main Mar 29, 2021
  • Overview 138
  • Commits 17
  • Pipelines 22
  • Changes 15

From my reading, the GBM core code was intended to support, or perhaps at some point in the past did support loading backends other than the built-in DRI one. This series extends the current code to enable loading of alternate backends in general, and as a straw-man proposal, specifically uses the DRM driver name of the FD passed to gbm_create_device() to construct a library name of a potential alternate backend. Other schemes could be implemented on top of the basic functionality added here, but this simple one seemed sufficient.

Issues addressed in the series:

  • The ability to dynamically load backends from DSOs.
  • Thread-safe tracking and refcounting of dynamically-loaded backends.
  • Versioning of the GBM driver ABI to enable backwards and forwards binary compatibility between the GBM loader and backends.
  • Discovery of alternate/external backend DSOs.

Here's a rundown of the backend discovery logic implemented in the series:

  • If the GBM_BACKEND env var is set, attempt to load the backend library it names and create a device from it if found.
  • If that fails or the env var is not set, call drmGetVersion() on the fd, and if that succeeds, attempt to load libgbm_.so.0 and create a device from it if found.
  • If that fails, try the built-in DRI backend.
Edited Jun 25, 2021 by James Jones
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: gbm_loader