Compiling drivers for Intel Nuc6i5SYH

wayland is not working because of drivers, so its time to compile some shit myselve
122 Replies
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
how would I get started? do I have to compile on the nuc or can I do that on my pc to (ryzen 5 1500) @pixelperfect1 so this would be the patch I would need to cherrypick? https://gitlab.freedesktop.org/mesa/mesa/-/commit/70ce634dc6d9c61db8af4dc5cb888b3ef51deef8.patch
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
@KyleGospo from wich mesa branch would I start best? https://gitlab.freedesktop.org/mesa/mesa ?
GitLab
Mesa / mesa Β· GitLab
Mesa 3D graphics library
Kyle Gospo
Kyle Gospoβ€’15mo ago
you would need to apply that patch to the version of mesa we ship
Pixel πŸ”œ SF 🎧
in theory you could patch the srpm of the mesa you have installed http://bradthemad.org/tech/notes/patching_rpms.php
Kyle Gospo
Kyle Gospoβ€’15mo ago
see the repo's spec_files/mesa folder
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
which one are you shipping?
Kyle Gospo
Kyle Gospoβ€’15mo ago
it's in the repo
Pixel πŸ”œ SF 🎧
You’ll need to use distrobox to set up an rpmbuild environment if you’re doing it on the NUC
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
I would prefer doing the compiling on my desktop you mean bazzite git repo, or that i can run rpm-ostree to get the version ? so youre running 23.1.6
Name: mesa
Summary: Mesa graphics libraries
%global ver 23.1.6
Name: mesa
Summary: Mesa graphics libraries
%global ver 23.1.6
Pixel πŸ”œ SF 🎧
GitHub
bazzite/spec_files/mesa at main Β· ublue-os/bazzite
Bazzite is an OCI image that serves as an alternative operating system for the Steam Deck, and a ready-to-game SteamOS-like for desktop computers and living room home theater PCs. - ublue-os/bazzite
Pixel πŸ”œ SF 🎧
he meant the repo
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
yea ive already got that and in the repo it says 23.1.6 I now got a local copy of the offical mesa repo of 23.1.6 I now gonna try building it without modifications, so that I can see that that works with my enve atleast
Pixel πŸ”œ SF 🎧
you need to use that spec file and build it using rpmbuild, not using make in the sync'd repo you can add that patch to the spec file and use rpmbuild to build it
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
ahh oaky
Pixel πŸ”œ SF 🎧
I believe it will even grab the sources? yeah--it should
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
so how ecaxt would I use rpmbuild, any arguments? in the spec_files/mesa folder? or would i make a build folder? ahh found it: rpmbuild -ba file.spec @KyleGospo is that right? can I do the building on my Desktop (running fedora 38 kde?) or do I have to do it on the nuc itselve?
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
damn
No description
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
what am I doing wrong?
Kyle Gospo
Kyle Gospoβ€’15mo ago
You'll want to do it in copr
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
?
Kyle Gospo
Kyle Gospoβ€’15mo ago
Learning curve is more of a brick wall here
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
gimme docs I shoudl read
Pixel πŸ”œ SF 🎧
eh?
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
so, step 1 is creatingg a custom copr repo?
Pixel πŸ”œ SF 🎧
rpmbuild is fine? it can be layered? just to ensure the patch even works--the same spec would then be able to be pushed to a copr?
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
well, I did compiling stuff before, I even worked with opengl itsleve, so I guess, I atleast could get some grip on that wall
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
@KyleGospo could I follow this to setup a new copr? https://docs.fedoraproject.org/en-US/quick-docs/publish-rpm-on-copr/
Fedora Docs
How to Publish your Software on Copr, Fedora’s User Repository
This is a short tutorial on how to create and maintain a Copr repository for your software in an automated fashion. It assumes some basic familiarity with Git & how…
Pixel πŸ”œ SF 🎧
or, is the spec using macros that only work on copr? I'm just so lost as to why you need copr here
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
welll, ive ive read right, I first need a git: https://git.euph.dev/Snoweuph/Copr-mesa-nuc6i5syh
Giteuph
Copr-mesa-nuc6i5syh
My try to fix the mesa driver for my nuc
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
@KyleGospo would I just copy the spec file from bazzites repo, or would I use a git module for this? would i use tito?
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
No description
Pixel πŸ”œ SF 🎧
# git_dir_name returns repository name derived from remote Git repository URL
Name: {{{ git_dir_name }}}

# git_dir_version returns version based on commit and tag history of the Git project
Version: {{{ git_dir_version }}}
# git_dir_name returns repository name derived from remote Git repository URL
Name: {{{ git_dir_name }}}

# git_dir_version returns version based on commit and tag history of the Git project
Version: {{{ git_dir_version }}}
so, yes, these are copr-related macros https://docs.pagure.org/rpkg-util/quick_start.html theoretically you could use rpkg locally? unfamiliar here
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
so
No description
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
I started following the official fedora guide for creating an copr
Pixel πŸ”œ SF 🎧
if I find time, my theory * clone bazzite locally * modify spec file to include patch file * git add ./path/to/spec ./path/to/patch * git commit -m "test" * rpkg local ./path/to/spec would be the minimum to get an RPM built for testing
Kyle Gospo
Kyle Gospoβ€’15mo ago
Fork bazzite in GitHub Create Copr account Create repo, point to Mesa spec file in your fork
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
so that I get github actions? for the build?
Kyle Gospo
Kyle Gospoβ€’15mo ago
Add patch to spec file, build on copr Edit containerfile to add Copr repo and use that mesa
Pixel πŸ”œ SF 🎧
ah yeah, you know what, copr would be easier lol
Kyle Gospo
Kyle Gospoβ€’15mo ago
Then you have your own bazzite build for old intel And it'll stay up to date Like I said, brick wall learning curve But you can do it
Pixel πŸ”œ SF 🎧
there are hackier ways to add a copr but that would even make it sharable
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
well, just doing a fork, prolly is the easiest yay cor website is online again
Pixel πŸ”œ SF 🎧
oh wow--looks like copr has some documentation on reproducing copr builds locally https://docs.pagure.org/copr.copr/user_documentation/reproducing_builds.html#reproducing-builds but yeah, best to just do things publicly and set up the tooling to let it all update automatically
Kyle Gospo
Kyle Gospoβ€’15mo ago
saves you having to do all this again every update
Pixel πŸ”œ SF 🎧
yeah especially considering how often mesa gets updates
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
what do I set for the build options?
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
No description
Pixel πŸ”œ SF 🎧
f38?
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
No description
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
No description
Pixel πŸ”œ SF 🎧
you'll want to build x86_64 specifically
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
No description
Pixel πŸ”œ SF 🎧
you don't need ppc, aarch, arm. i386? @KyleGospo probably not--I don't think we need 32bit mesa? I would just start with x86_64 for now and you can enable more later if need be, but you should be good--you could optionally enable. f39, f40, rawhide, but eh
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
just only gonna use f38 for now
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
anyting I put here?
No description
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
what do I put here?
No description
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
and what for option 4
No description
Kyle Gospo
Kyle Gospoβ€’15mo ago
38, 39, rawhide all x86_64 keep follow fedora branching checked no other changes
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
Kyle Gospo
Kyle Gospoβ€’15mo ago
yep add your spec file from your forked repo name it mesa
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
No description
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
like this?
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
No description
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
No description
Kyle Gospo
Kyle Gospoβ€’15mo ago
clone url is your github repo check auto rebuild
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
No description
No description
Kyle Gospo
Kyle Gospoβ€’15mo ago
ending in .git the repo url you'd use to clone
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
No description
Kyle Gospo
Kyle Gospoβ€’15mo ago
good
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
whats next? running rebuild action?
Kyle Gospo
Kyle Gospoβ€’15mo ago
did you edit the spec to have your patch?
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
No description
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
not yet
Kyle Gospo
Kyle Gospoβ€’15mo ago
do that first then worry about building this is ready to build whenever
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
so how and where would I do that inthe spec file?
Kyle Gospo
Kyle Gospoβ€’15mo ago
you'd make a .patch file that applies to the current version of mesa put it in spec_files/mesa
Pixel πŸ”œ SF 🎧
there's two other patches in the file already
Kyle Gospo
Kyle Gospoβ€’15mo ago
add it as a PatchX in the spec next to the others and then build it in copr
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
patchX.patch?
Kyle Gospo
Kyle Gospoβ€’15mo ago
name doesn't matter make it useful to you look in the spec to figure out what PatchX means
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
and then I just copy this in therre?
Kyle Gospo
Kyle Gospoβ€’15mo ago
what
Kyle Gospo
Kyle Gospoβ€’15mo ago
if that applies to the latest mesa, yea if it doesn't you'll have to make a new one
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
@pixelperfect1 had givven me taht one
Kyle Gospo
Kyle Gospoβ€’15mo ago
it's dated 2022 no guarantees might have to be updated
Pixel πŸ”œ SF 🎧
that was the one from the thread. it may or may not work, yeah
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
so just gonna trial and error now and then add the .patch to the .spec ?
Kyle Gospo
Kyle Gospoβ€’15mo ago
yes
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
as patch30 ?
No description
Kyle Gospo
Kyle Gospoβ€’15mo ago
sure
Pixel πŸ”œ SF 🎧
the number I believe just denotes the order the patches are applied, incremented by 1--why these are by 10? idk, probably just in case a patch for a patch is needed by a downstream?
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
ahh, so like systemd files okay, now if I want to make a build
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
No description
Kyle Gospo
Kyle Gospoβ€’15mo ago
just press rebuild and change nothing
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
No description
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
okay
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
now waiting
No description
Pixel πŸ”œ SF 🎧
+ cd mesa-23.1.6
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/gnome-shell-glthread-disable.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/gamescope.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/nuc-specific-fix.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
7 out of 7 hunks FAILED -- saving rejects to file src/intel/vulkan/anv_formats.c.rej
error: Bad exit status from /var/tmp/rpm-tmp.gCyFIm (%prep)
+ cd mesa-23.1.6
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/gnome-shell-glthread-disable.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/gamescope.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/nuc-specific-fix.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
7 out of 7 hunks FAILED -- saving rejects to file src/intel/vulkan/anv_formats.c.rej
error: Bad exit status from /var/tmp/rpm-tmp.gCyFIm (%prep)
Kyle Gospo
Kyle Gospoβ€’15mo ago
patch needs to be updated
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
not update, patched lmao xD well, its quite late for me allready, gonna not work on it more today
Pixel πŸ”œ SF 🎧
odd the srpm that it output didn't include that reject file?
~/mesa-23.1.6 -$ ls -la src/intel/vulkan/anv_formats.c.rej
ls: src/intel/vulkan/anv_formats.c.rej: No such file or directory
~/mesa-23.1.6 -$
~/mesa-23.1.6 -$ ls -la src/intel/vulkan/anv_formats.c.rej
ls: src/intel/vulkan/anv_formats.c.rej: No such file or directory
~/mesa-23.1.6 -$
Kyle Gospo
Kyle Gospoβ€’15mo ago
nah that's normal just copr things
Pixel πŸ”œ SF 🎧
is there any way to get the rejected patchfile or do you need to specify it as a build target...
Kyle Gospo
Kyle Gospoβ€’15mo ago
easiest to just download the mesa source for that version patch manually and make a new .patch from it then you know it applies cleanly
Pixel πŸ”œ SF 🎧
true, making a new diff wouldn't be hard oh yeah there's been a lot added to that .c file for example, there's a whole new section that's been added
- format_feature_flags = anv_get_image_format_features2(devinfo, info->format,
- format, info->tiling,
- isl_mod_info);
-

## Literally smack inbetween these

- /* Remove the VkFormatFeatureFlags that are incompatible with any declared
- * image view format. (Removals are more likely to occur when a DRM format
- * modifier is present).
- */
- format_feature_flags = anv_get_image_format_features2(devinfo, info->format,
- format, info->tiling,
- isl_mod_info);
-

## Literally smack inbetween these

- /* Remove the VkFormatFeatureFlags that are incompatible with any declared
- * image view format. (Removals are more likely to occur when a DRM format
- * modifier is present).
- */
Pixel πŸ”œ SF 🎧
wait, that links to an MR that's been merged? https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17182
GitLab
anv: Improve image/view usage bits verification (!17182) Β· Merge re...
This change makes usage bits verification closer to the Vulkan spec (at least as I understand it). VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT does not always require all formats to support...
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
So, that means, part of the patch got merged?
Pixel πŸ”œ SF 🎧
I wasn’t able to take time to look at Mesa’s actual code, but following the thread, gamesvope devs say: β€œthis won’t be fixed. We are waiting for this upstream MR to fix this issue” The upstream MR has been merged, so theoretically the issue was already patched, but you’re clearly still having issues
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
Damn I should tryout some distros to see if it works on others, and when I find ine that works, then I could search for the differences How do I check if im using software or hardware rendering again? Or is that a stupid idea? @KyleGospo what would you suggest? I just booted fedora 38 stock life, and in the about system in the settings there, on the live image its saying wayland
Kyle Gospo
Kyle Gospoβ€’15mo ago
Booting X isn't a sign of an issue We force X on the deck builds atm because steam input doesn't support Wayland SteamOS does the same
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
So, what was the specific sigb twelling us that the driver is not working?
Kyle Gospo
Kyle Gospoβ€’15mo ago
You have a specific issue with some Vulkan extension That renders gamemode unusable
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
So how would I test thet out? Is there somethin like vktest ?
Kyle Gospo
Kyle Gospoβ€’15mo ago
You'd have to install and launch gamescope That being said we ship the same Mesa that's in Fedora We add two patches on top, neither of which touch intel
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
So, it would make sense to try out another distro?
Kyle Gospo
Kyle Gospoβ€’15mo ago
Not really, it's not like Fedora ships a different Mesa than anybody else
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
Damn Im just confused because that one pr is merged, that is supposed to fix my problem so, I now Need to find out where the problem lies in mesa and my only help is:
gamescope: ../src/rendervulkan.cpp:2152: bool CVulkanTexture::BInit(uint32_t, uint32_t, uint32_t, uint32_t, createFlags, wlr_dmabuf_attributes*, uint32_t, uint32_t, CVulkanTexture*): Assertion `drmFormatDesc != nullptr' failed.
gamescope: ../src/rendervulkan.cpp:2152: bool CVulkanTexture::BInit(uint32_t, uint32_t, uint32_t, uint32_t, createFlags, wlr_dmabuf_attributes*, uint32_t, uint32_t, CVulkanTexture*): Assertion `drmFormatDesc != nullptr' failed.
in that file of gamescope , the surounding lines are:
const struct wlr_drm_format *drmFormatDesc = wlr_drm_format_set_get( &g_DRM.primary_formats, drmFormat );
assert( drmFormatDesc != nullptr );
possibleModifiers = drmFormatDesc->modifiers;
numPossibleModifiers = drmFormatDesc->len;
const struct wlr_drm_format *drmFormatDesc = wlr_drm_format_set_get( &g_DRM.primary_formats, drmFormat );
assert( drmFormatDesc != nullptr );
possibleModifiers = drmFormatDesc->modifiers;
numPossibleModifiers = drmFormatDesc->len;
so the problem of gamescope is: that it want something in that pointer related to drm, but instead it is just null. so next step is to find more out aboutthat wlr_drm_format_set_get function, so that I can maybe point it more down towhat is acutally failing in the driver I guess that wlr stands for wlroots
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
okay, found it:
const struct wlr_drm_format *wlr_drm_format_set_get( const struct wlr_drm_format_set *set, uint32_t format) {
return format_set_get(set, format);
}
const struct wlr_drm_format *wlr_drm_format_set_get( const struct wlr_drm_format_set *set, uint32_t format) {
return format_set_get(set, format);
}
static struct wlr_drm_format *format_set_get(const struct wlr_drm_format_set *set, uint32_t format) {
for (size_t i = 0; i < set->len; ++i) {
if (set->formats[i].format == format) {
return &set->formats[i];
}
}

return NULL;
}
static struct wlr_drm_format *format_set_get(const struct wlr_drm_format_set *set, uint32_t format) {
for (size_t i = 0; i < set->len; ++i) {
if (set->formats[i].format == format) {
return &set->formats[i];
}
}

return NULL;
}
https://gitlab.freedesktop.org/wlroots/wlroots/-/blob/master/render/drm_format_set.c
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
things I could look at: 1. test that the pointer primary_formats and the value drmFormat are good before they are given to the wlr_drm_format_set_get function. 2. look into the wlr_drm_format_set_get of wlroots to see what it is actually doing, and then reproducing that in a test script, that I can then use to test if the cahnges to the drivers are working. 3.write an issue on gamescope in the hope to get the needed information to do something more myself I modifyed gamescope to log me the values and builded it myselve and this is the output: Value of &g_DRM.primary_formats: 0x6dc200 Value of drmFormat: 808669761 I did multiple test runs and these values are allways the same
//log by Snoweuph
FILE *logfile;

uintptr_t actualValueOfPrimaryFormats = (uintptr_t)&g_DRM.primary_formats;

logfile = fopen("/home/snoweuph/custom-gamescope-log.txt", "w");

if (!logfile) {
std::cerr << "Error: Unable to open the log file!" << std::endl;
return 1;
}

// Log the actual value of &g_DRM.primary_formats
fprintf(logfile, "Value of &g_DRM.primary_formats: %p\n", &g_DRM.primary_formats);
// Log the value of drmFormat
fprintf(logfile, "Value of drmFormat: %u\n", drmFormat);

fprintf(logfile, "fd: %d\n", g_DRM.fd);
fprintf(logfile, "preferred_width: %d\n", g_DRM.preferred_width);
fprintf(logfile, "preferred_height: %d\n", g_DRM.preferred_height);
fprintf(logfile, "preferred_refresh: %d\n", g_DRM.preferred_refresh);

fprintf(logfile, "cursor_width: %" PRIu64 "\n", g_DRM.cursor_width);
fprintf(logfile, "cursor_height: %" PRIu64 "\n", g_DRM.cursor_height);
fprintf(logfile, "allow_modifiers: %s\n", g_DRM.allow_modifiers ? "true" : "false");

// Log formats information (if relevant)
fprintf(logfile, "Number of formats: %zu\n", g_DRM.formats.len);


// Log atomic request details
fprintf(logfile, "req: %p\n", (void*)g_DRM.req);
fprintf(logfile, "flags: %u\n", g_DRM.flags);

// Log framebuffer management information
fprintf(logfile, "Number of framebuffers in req: %zu\n", g_DRM.fbids_in_req.size());
fprintf(logfile, "Number of framebuffers queued: %zu\n", g_DRM.fbids_queued.size());
fprintf(logfile, "Number of framebuffers on screen: %zu\n", g_DRM.fbids_on_screen.size());

// Log synchronization-related fields
fprintf(logfile, "Flipcount: %" PRIu64 "\n", g_DRM.flipcount.load());
fprintf(logfile, "Paused: %s\n", g_DRM.paused.load() ? "true" : "false");
fprintf(logfile, "Out of Date: %d\n", g_DRM.out_of_date.load());
fprintf(logfile, "Needs Modeset: %s\n", g_DRM.needs_modeset.load() ? "true" : "false");


fprintf(logfile, "Primary Formats:\n");
for (size_t i = 0; i < g_DRM.primary_formats.len; ++i) {
const struct wlr_drm_format *format = *(g_DRM.primary_formats.formats + i);
// Now, 'format' points to a 'struct wlr_drm_format', and you can access its fields.
fprintf(logfile, "Format %zu: format=%u\n", i, format->format);

// Log modifiers if they exist
fprintf(logfile, "Modifiers: ");
for (size_t j = 0; j < format->len; ++j) {
fprintf(logfile, "%llu ", format->modifiers[j]);
}
fprintf(logfile, "\n");

}

// Close the log file when done
fclose(logfile);
//log by Snoweuph
FILE *logfile;

uintptr_t actualValueOfPrimaryFormats = (uintptr_t)&g_DRM.primary_formats;

logfile = fopen("/home/snoweuph/custom-gamescope-log.txt", "w");

if (!logfile) {
std::cerr << "Error: Unable to open the log file!" << std::endl;
return 1;
}

// Log the actual value of &g_DRM.primary_formats
fprintf(logfile, "Value of &g_DRM.primary_formats: %p\n", &g_DRM.primary_formats);
// Log the value of drmFormat
fprintf(logfile, "Value of drmFormat: %u\n", drmFormat);

fprintf(logfile, "fd: %d\n", g_DRM.fd);
fprintf(logfile, "preferred_width: %d\n", g_DRM.preferred_width);
fprintf(logfile, "preferred_height: %d\n", g_DRM.preferred_height);
fprintf(logfile, "preferred_refresh: %d\n", g_DRM.preferred_refresh);

fprintf(logfile, "cursor_width: %" PRIu64 "\n", g_DRM.cursor_width);
fprintf(logfile, "cursor_height: %" PRIu64 "\n", g_DRM.cursor_height);
fprintf(logfile, "allow_modifiers: %s\n", g_DRM.allow_modifiers ? "true" : "false");

// Log formats information (if relevant)
fprintf(logfile, "Number of formats: %zu\n", g_DRM.formats.len);


// Log atomic request details
fprintf(logfile, "req: %p\n", (void*)g_DRM.req);
fprintf(logfile, "flags: %u\n", g_DRM.flags);

// Log framebuffer management information
fprintf(logfile, "Number of framebuffers in req: %zu\n", g_DRM.fbids_in_req.size());
fprintf(logfile, "Number of framebuffers queued: %zu\n", g_DRM.fbids_queued.size());
fprintf(logfile, "Number of framebuffers on screen: %zu\n", g_DRM.fbids_on_screen.size());

// Log synchronization-related fields
fprintf(logfile, "Flipcount: %" PRIu64 "\n", g_DRM.flipcount.load());
fprintf(logfile, "Paused: %s\n", g_DRM.paused.load() ? "true" : "false");
fprintf(logfile, "Out of Date: %d\n", g_DRM.out_of_date.load());
fprintf(logfile, "Needs Modeset: %s\n", g_DRM.needs_modeset.load() ? "true" : "false");


fprintf(logfile, "Primary Formats:\n");
for (size_t i = 0; i < g_DRM.primary_formats.len; ++i) {
const struct wlr_drm_format *format = *(g_DRM.primary_formats.formats + i);
// Now, 'format' points to a 'struct wlr_drm_format', and you can access its fields.
fprintf(logfile, "Format %zu: format=%u\n", i, format->format);

// Log modifiers if they exist
fprintf(logfile, "Modifiers: ");
for (size_t j = 0; j < format->len; ++j) {
fprintf(logfile, "%llu ", format->modifiers[j]);
}
fprintf(logfile, "\n");

}

// Close the log file when done
fclose(logfile);
I did some logging
[snoweuph@fedora ~]$ cat custom-gamescope-log.txt
Value of &g_DRM.primary_formats: 0x6dd200
Value of drmFormat: 808669761
fd: 11
preferred_width: 0
preferred_height: 0
preferred_refresh: 0
cursor_width: 256
cursor_height: 256
allow_modifiers: true
Number of formats: 15
req: (nil)
flags: 0
Number of framebuffers in req: 0
Number of framebuffers queued: 0
Number of framebuffers on screen: 0
Flipcount: 0
Paused: false
Out of Date: 0
Needs Modeset: true
Primary Formats:
Format 0: format=538982467
Modifiers: 72057594037927935 72057594037927938 72057594037927937 0
Format 1: format=909199186
Modifiers: 72057594037927935 72057594037927939 72057594037927938 72057594037927937 0
Format 2: format=875713112
Modifiers: 72057594037927935 72057594037927941 72057594037927940 72057594037927939 72057594037927938 72057594037927937 0
Format 3: format=875709016
Modifiers: 72057594037927935 72057594037927941 72057594037927940 72057594037927939 72057594037927938 72057594037927937 0
Format 4: format=875713089
Modifiers: 72057594037927935 72057594037927941 72057594037927940 72057594037927939 72057594037927938 72057594037927937 0
Format 5: format=875708993
Modifiers: 72057594037927935 72057594037927941 72057594037927940 72057594037927939 72057594037927938 72057594037927937 0
Format 6: format=808669784
Modifiers: 72057594037927935 72057594037927939 72057594037927938 72057594037927937 0
Format 7: format=808665688
Modifiers: 72057594037927935 72057594037927939 72057594037927938 72057594037927937 0
Format 8: format=1211388504
Modifiers: 72057594037927935 72057594037927938 72057594037927937 0
Format 9: format=1211384408
Modifiers: 72057594037927935 72057594037927938 72057594037927937 0
Format 10: format=1448695129
Modifiers: 72057594037927935 72057594037927939 72057594037927938 72057594037927937 0
Format 11: format=1431918169
Modifiers: 72057594037927935 72057594037927939 72057594037927938 72057594037927937 0
Format 12: format=1498831189
Modifiers: 72057594037927935 72057594037927939 72057594037927938 72057594037927937 0
Format 13: format=1498765654
Modifiers: 72057594037927935 72057594037927939 72057594037927938 72057594037927937 0
Format 14: format=1448434008
Modifiers: 72057594037927935 72057594037927939 72057594037927938 72057594037927937 0
[snoweuph@fedora ~]$ cat custom-gamescope-log.txt
Value of &g_DRM.primary_formats: 0x6dd200
Value of drmFormat: 808669761
fd: 11
preferred_width: 0
preferred_height: 0
preferred_refresh: 0
cursor_width: 256
cursor_height: 256
allow_modifiers: true
Number of formats: 15
req: (nil)
flags: 0
Number of framebuffers in req: 0
Number of framebuffers queued: 0
Number of framebuffers on screen: 0
Flipcount: 0
Paused: false
Out of Date: 0
Needs Modeset: true
Primary Formats:
Format 0: format=538982467
Modifiers: 72057594037927935 72057594037927938 72057594037927937 0
Format 1: format=909199186
Modifiers: 72057594037927935 72057594037927939 72057594037927938 72057594037927937 0
Format 2: format=875713112
Modifiers: 72057594037927935 72057594037927941 72057594037927940 72057594037927939 72057594037927938 72057594037927937 0
Format 3: format=875709016
Modifiers: 72057594037927935 72057594037927941 72057594037927940 72057594037927939 72057594037927938 72057594037927937 0
Format 4: format=875713089
Modifiers: 72057594037927935 72057594037927941 72057594037927940 72057594037927939 72057594037927938 72057594037927937 0
Format 5: format=875708993
Modifiers: 72057594037927935 72057594037927941 72057594037927940 72057594037927939 72057594037927938 72057594037927937 0
Format 6: format=808669784
Modifiers: 72057594037927935 72057594037927939 72057594037927938 72057594037927937 0
Format 7: format=808665688
Modifiers: 72057594037927935 72057594037927939 72057594037927938 72057594037927937 0
Format 8: format=1211388504
Modifiers: 72057594037927935 72057594037927938 72057594037927937 0
Format 9: format=1211384408
Modifiers: 72057594037927935 72057594037927938 72057594037927937 0
Format 10: format=1448695129
Modifiers: 72057594037927935 72057594037927939 72057594037927938 72057594037927937 0
Format 11: format=1431918169
Modifiers: 72057594037927935 72057594037927939 72057594037927938 72057594037927937 0
Format 12: format=1498831189
Modifiers: 72057594037927935 72057594037927939 72057594037927938 72057594037927937 0
Format 13: format=1498765654
Modifiers: 72057594037927935 72057594037927939 72057594037927938 72057594037927937 0
Format 14: format=1448434008
Modifiers: 72057594037927935 72057594037927939 72057594037927938 72057594037927937 0
So, it looks like its tryng to get a specific DRM format out of the list of available ones, but it does not exist found the missing format in mesa: DRM_FORMAT_ARGB2101010 is not included in the list Okay, I was able to backtrace the call to Bint to the vulkan_make_output_images function, next I gonna do some logging here to get more info, goal is to find out why that format is missing I was able to find out that this is equal to: VK_FORMAT_A2R10G10B10_UNORM_PACK32 or also known as the number 58 as a vulkan Format so now the next question I mighty wanna solve is: is the format its trying to get not in the list of formats because it shouldnt be or is it missing because of some problem @KyleGospo the struct that stores the available drms is defined in the drm.hhp, but I have problerms finding out, where it gets filled with the actuall data In rendervulkan.ccp there is a call to vulkan_make_output() which says: outputFormat = VK_FORMAT_A2B10G10R10_UNIFORM_PACK32 well, I just did some more looging and it doesnt even reach the point. @KyleGospo gamescopes checks in the vulkan_make_output if its a VR || Headless session else if SDL session else it just takes the pre defined "Invalid DRM format" and converts and uses it, and thats where im landing. Now my question: if im running gamescope from TTY, what kind of session is it?
Kyle Gospo
Kyle Gospoβ€’15mo ago
I'll have to look, but TTY should be the same as how the session starts it
Snoweuph[matrix]
Snoweuph[matrix]OPβ€’15mo ago
Yea, the question is, if its a headless or sdl session or something else on machines were its working right Because depending on the session type its trying diffrent stuff, and knowing this will allow me to eliminate a bif chunk of code In the end im still trying to figure out where the drives are doing me wrong
Want results from more Discord servers?
Add your server