add connector name to screen model
ClosedPublic

Authored by mart on Nov 11 2016, 12:14 PM.

Details

Summary

to uniquely identify screens (in QScreen::name()) add the conenctor
name and id (such as HDMI-A-1) to the model identification

Test Plan

tested a full plasma session

Diff Detail

Repository
R108 KWin
Branch
arcpatch-D3341
Lint
No Linters Available
Unit
No Unit Test Coverage
mart updated this revision to Diff 8090.Nov 11 2016, 12:14 PM
mart retitled this revision from to add connector name to screen model.
mart updated this object.
mart edited the test plan for this revision. (Show Details)
mart added a reviewer: Plasma.
Restricted Application added a project: KWin. · View Herald TranscriptNov 11 2016, 12:14 PM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
graesslin added inline comments.
plugins/platforms/drm/drm_output.cpp
198–249

I would prefer a static hashmap instead of a long switch statement. Similar to how it is done in Weston.

mart updated this revision to Diff 8153.Nov 15 2016, 10:56 AM
  • use a static map, like weston
Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptNov 15 2016, 10:56 AM
graesslin added inline comments.Nov 15 2016, 11:05 AM
plugins/platforms/drm/drm_output.cpp
141–159

I was more thinking of something like:

static QMap<int, QByteArray> s_connectorNames = {
    {DRM_MODE_CONNECTOR_Unknown, QByteArrayLiteral("Unknown")},
    {DRM_MODE_CONNECTOR_VGA, QByteArrayLIteral("VGA")},
    // and so on...
}

sorry for not having bean clear enough. Didn't mean that it should be a C variant.

mart updated this revision to Diff 8154.Nov 15 2016, 12:11 PM
  • use a Qt QHash instead
Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptNov 15 2016, 12:11 PM
graesslin added inline comments.Nov 15 2016, 1:00 PM
plugins/platforms/drm/drm_output.cpp
196

what if connector_type returns a number we don't know yet? Maybe a find would be better here with a fallback to unknown in case of not found.

mart updated this revision to Diff 8157.Nov 15 2016, 1:10 PM
  • fallback to "Unknown"
Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptNov 15 2016, 1:10 PM
graesslin added inline comments.Nov 15 2016, 2:47 PM
plugins/platforms/drm/drm_output.cpp
196 ↗(On Diff #8157)
QString connectorName = s_connectorNames.value(connector->connector_type, QByteArrayLiteral("Unknown");
mart updated this revision to Diff 8166.Nov 15 2016, 3:01 PM
  • shorter form of s_connectorNames.value()
Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptNov 15 2016, 3:01 PM
graesslin accepted this revision.Nov 15 2016, 3:02 PM
graesslin added a reviewer: graesslin.
This revision is now accepted and ready to land.Nov 15 2016, 3:02 PM
This revision was automatically updated to reflect the committed changes.