Skip to content

Conversation

@stefan11111
Copy link
Contributor

@stefan11111 stefan11111 commented Nov 12, 2025

Only a proof of concept for now.

libgbm from mesa is a generic buffer management library for gpu buffers.
In the modesetting driver, we also roll our own dumb_bo implementation, so that we don't depend on libgbm.
libgbm supports allocating dumb buffers, as well as "smarter" buffers.

With this, everything that was only implemented with dumb_bo, is now also implemented with libgbm.

The next steps after this are to decouple libgbm from glamor, to allow using it even when we don't have accelerated modesetting.

After that, I think we should remove the dumb_bo implementation, and use libgbm for everything.

While writing this, I also noticed some questionable code, which I wrote some comment about.

Closes: #734

@stefan11111
Copy link
Contributor Author

stefan11111 commented Nov 12, 2025

@notbabaisyou ping

case 16:
return GBM_FORMAT_RGB565;
case 30:
return GBM_FORMAT_ARGB2101010;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know It is offtopic, shouldn't be here to be something smarter? Because all nvida card which i have, only supports xBGR2101010

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what we can do better here.
Do we have any way of querying the format?

@stefan11111 stefan11111 mentioned this pull request Nov 13, 2025
#define MAX(a,b) ((a) > (b) ? (a) : (b))

#ifndef GBM_BO_USE_FRONT_RENDERING
#define GBM_BO_USE_FRONT_RENDERING 0
Copy link
Contributor

@notbabaisyou notbabaisyou Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make more sense to assign the actual value, distros with older libgbm that don't support the feature would ignore the value anyway.

Copy link
Contributor Author

@stefan11111 stefan11111 Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd be passing flags to libgbm that it doesn't support, and hope that it does the right thing and ignores them.

@stefan11111
Copy link
Contributor Author

gbm-only path now works with/without glamor, with/without shadowfb (on my system, at least)

@github-actions
Copy link

Merge Conflict found

1 similar comment
@github-actions
Copy link

Merge Conflict found

@stefan11111
Copy link
Contributor Author

@metux @callmetango @cepelinas9000 @notbabaisyou @ONykyf
Thoughts on the idea to implement everything with libgbm and use that as the primary path?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants