Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libobs/graphics: unbreak DMABUF on FreeBSD #7989

Merged
merged 1 commit into from
Jan 24, 2023
Merged

libobs/graphics: unbreak DMABUF on FreeBSD #7989

merged 1 commit into from
Jan 24, 2023

Conversation

jbeich
Copy link
Contributor

@jbeich jbeich commented Dec 31, 2022

Description

Trying to build wlrobs >= 1.1 I get the following error:

ld: error: undefined symbol: gs_texture_create_from_dmabuf
>>> referenced by dmabuf_source.c
>>>               libwlrobs.so.p/src_dmabuf_source.c.o:(ready)
cc: error: linker command failed with exit code 1 (use -v to see invocation)

despite

#elif defined(__linux__) || defined(__FreeBSD__)
EXPORT gs_texture_t *gs_texture_create_from_dmabuf(
unsigned int width, unsigned int height, uint32_t drm_format,
enum gs_color_format color_format, uint32_t n_planes, const int *fds,
const uint32_t *strides, const uint32_t *offsets,
const uint64_t *modifiers);

Motivation and Context

wlroots (Wayland) support on FreeBSD and DragonFly. wlrobs-1.0 already works fine but wlrobs-1.1 needs this change.

wlroots + wlrobs are also supported on DragonFly, so expose DMABUF API there as well.

How Has This Been Tested?

$ pkg install sway wlrobs glx-utils
$ sway
$ glxgears &
$ obs
<Sources>
<Add Source>
<Wayland output(dmabuf)>
<OK>

<Sources>
<Add Source>
<Window Capture (Xcomposite)>
<Window: glxgears>
<OK>

<Start recording>
<Stop recording>

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@gxalpha gxalpha added Bug Fix Non-breaking change which fixes an issue Other OS (*nix) Other Unix-like systems that are not officially supported (e.g. OpenBSD) labels Dec 31, 2022
@tytan652 tytan652 added Enhancement Improvement to existing functionality New Feature New feature or plugin labels Dec 31, 2022
@tytan652
Copy link
Collaborator

libobs/graphics: properly expose DMABUF API on BSDs after c50c625

Required under Wayland (wlrobs) on FreeBSD and DragonFly.

Change that by something like:

libobs/graphics: Enable DMABUF on FreeBSD and DragonFly

"BSDs" cover more than just FreeBSD and DragonFly.

Required under Wayland (wlrobs) on FreeBSD and DragonFly. DMABUF was
already partially exposed after c50c625.
@jbeich
Copy link
Contributor Author

jbeich commented Jan 6, 2023

Ping. Anything else?

@gxalpha
Copy link
Member

gxalpha commented Jan 6, 2023

It's been holidays and we haven't caught up with all new the PR's yet that came in over the last few weeks.
Please give us some time, your PR will get looked at.

@jbeich
Copy link
Contributor Author

jbeich commented Jan 22, 2023

No regressions reported after 3 weeks of dogfooding downstream:

If you want to test yourself use real hardware or pass-through GPU. DMABUF requires DRM but virtual GPU kernel drivers haven't been ported.

@RytoEX RytoEX self-assigned this Jan 22, 2023
@RytoEX RytoEX merged commit c082c4a into obsproject:master Jan 24, 2023
@RytoEX RytoEX mentioned this pull request Jan 25, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Non-breaking change which fixes an issue Enhancement Improvement to existing functionality New Feature New feature or plugin Other OS (*nix) Other Unix-like systems that are not officially supported (e.g. OpenBSD)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants