Skip to content

Commit

Permalink
(#3729) only connected outputs can be added to the output list
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkae committed Feb 7, 2025
1 parent 54f9716 commit 40640cc
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#define MIR_LOG_COMPONENT "gbm-kms"
#include <algorithm>
#include "real_kms_output_container.h"
#include "real_kms_output.h"
#include "kms-utils/drm_mode_resources.h"
#include <mir/log.h>

namespace mgg = mir::graphics::gbm;

Expand Down Expand Up @@ -55,6 +57,12 @@ void mgg::RealKMSOutputContainer::update_from_hardware_state()
drm_fd == candidate->drm_fd();
});

if (connector->connection != DRM_MODE_CONNECTED)
{
mir::log_warning("Connector is not connected, so not adding this output to the list.");
continue;
}

if (existing_output != outputs.end())
{
// We could drop this down to O(n) by being smarter about moving out
Expand Down

0 comments on commit 40640cc

Please sign in to comment.