Skip to content

fix(linux/kms)!: Use connector type index from KMS instead of self calculation - #5489

Merged
ReenigneArcher merged 1 commit into
LizardByte:masterfrom
Kishi85:kms-use-connector-type-id
Aug 10, 2026
Merged

fix(linux/kms)!: Use connector type index from KMS instead of self calculation#5489
ReenigneArcher merged 1 commit into
LizardByte:masterfrom
Kishi85:kms-use-connector-type-id

Conversation

@Kishi85

@Kishi85 Kishi85 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Description

Instead of calculating the index for each connector_type manually use the connector_type_id index provided by KMS to ensure correct values.

For details see https://www.kernel.org/doc/html/latest/gpu/drm-kms.html#c.drm_connector and related docs for connector_type and connector_type_id

Screenshot

Issues Fixed or Closed

This might fix some issues related to #5444 but needs to be tested first before adding to this list.

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

See our AI usage policy.

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@Kishi85
Kishi85 force-pushed the kms-use-connector-type-id branch from 7ade044 to 489d6ea Compare August 9, 2026 07:08
@Kishi85

Kishi85 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

@ReenigneArcher I don't think this'll impact #5481 much but might reduce the need for it as KMS monitors should always line-up properly with this change.

@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

@ReenigneArcher

Copy link
Copy Markdown
Member

@ReenigneArcher I don't think this'll impact #5481 much but might reduce the need for it as KMS monitors should always line-up properly with this change.

Thanks for letting me know. I don't really know if that will fix the issue mentioned. I just asked GPT 5.6 to address the stale issues instead of continuing to ignore them. Not sure the affected users will respond or test it though.

Could you try a force push for this PR to get the sonar build to work?

@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@f0eef8c). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/platform/linux/kmsgrab.cpp 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #5489   +/-   ##
=========================================
  Coverage          ?   28.10%           
=========================================
  Files             ?      109           
  Lines             ?    24711           
  Branches          ?    10910           
=========================================
  Hits              ?     6944           
  Misses            ?    14895           
  Partials          ?     2872           
Flag Coverage Δ
Archlinux 0.00% <0.00%> (?)
FreeBSD-amd64 13.99% <ø> (?)
Homebrew-macos-14 22.55% <ø> (?)
Homebrew-macos-15 23.20% <ø> (?)
Homebrew-macos-26 23.34% <ø> (?)
Homebrew-ubuntu-24.04 14.02% <0.00%> (?)
Linux-AppImage 13.42% <0.00%> (?)
Windows-AMD64 17.42% <ø> (?)
Windows-ARM64 14.98% <ø> (?)
macOS-arm64 19.81% <ø> (?)
macOS-x86_64 20.52% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/platform/linux/kmsgrab.cpp 3.57% <0.00%> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f0eef8c...88f9099. Read the comment docs.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Last Updated 2026-08-10 16:58:53 UTC
Source Run CI Run #4916
Commit 88f909934061f88820153249f83a4af7e23e7890

Screenshot Comparison

PR #5489 screenshots vs screenshots baseline.

Matrix: AppImage

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: Windows-AMD64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: Windows-ARM64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-arm64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-x86_64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

@Kishi85
Kishi85 force-pushed the kms-use-connector-type-id branch from 489d6ea to fa3654e Compare August 9, 2026 16:57
@Kishi85
Kishi85 marked this pull request as draft August 9, 2026 18:37
@Kishi85

Kishi85 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

I'll do a few more tests to make sure this does what it should (at least on my setup). I'll mark this ready for review again once I'm done.

@Kishi85

Kishi85 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

I'll have to flag this as a breaking change as it might reorder monitor indices but those are not guaranteed to be stable for KMS anyway and no longer recommended for the output_name configuration option.

Also should be extensively tested in multi-monitor setups before merging.

@Kishi85
Kishi85 marked this pull request as ready for review August 9, 2026 19:00
@ReenigneArcher ReenigneArcher changed the title fix(linux/kms): Use connector type index from KMS instead of self calculation fix(linux/kms)!: Use connector type index from KMS instead of self calculation Aug 9, 2026
@ReenigneArcher

Copy link
Copy Markdown
Member

Also should be extensively tested in multi-monitor setups before merging.

Was this something you were able to do, or no?

@Kishi85

Kishi85 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

Also should be extensively tested in multi-monitor setups before merging.

Was this something you were able to do, or no?

For my system, yes. But it might be a good idea to have this tested on a few different configurations (ideally but not necessarily also on currently misbehaving ones) to ensure proper function on a broader basis.

UPDATE: I've managed to test this successfully on a secondary system with a different monitor setup.

…culation

Instead of calculating the index for each connector_type manually
use the connector_type_id index provided by KMS to ensure correct values.
@ReenigneArcher
ReenigneArcher force-pushed the kms-use-connector-type-id branch from fa3654e to 88f9099 Compare August 10, 2026 15:43
@sonarqubecloud

Copy link
Copy Markdown

@Kishi85

Kishi85 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

#5444 (comment) confirms fixing the wayland correlation for KMS monitors with this change.

This means that this PR might already handle #5047 without needing the fallback from #5481 (as the cached monitor list is now correctly propagated).

@ReenigneArcher
ReenigneArcher merged commit 3cba9ba into LizardByte:master Aug 10, 2026
70 checks passed
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.

2 participants