drm_hwcomposer: Add HDMI connector as a valid type
Accept DRM_MODE_CONNECTOR_HDMIA connector type. Look for primary DrmConnector amongst external connectors after looking for primary amongst internal ones first. Signed-off-by: Robert Foss <robert.foss@collabora.com> Signed-off-by: Rob Herring <robh@kernel.org>
This commit is contained in:
parent
bd03b9996a
commit
610d98990b
3 changed files with 27 additions and 5 deletions
|
|
@ -67,11 +67,19 @@ void DrmConnector::set_display(int display) {
|
|||
display_ = display;
|
||||
}
|
||||
|
||||
bool DrmConnector::built_in() const {
|
||||
bool DrmConnector::internal() const {
|
||||
return type_ == DRM_MODE_CONNECTOR_LVDS || type_ == DRM_MODE_CONNECTOR_eDP ||
|
||||
type_ == DRM_MODE_CONNECTOR_DSI || type_ == DRM_MODE_CONNECTOR_VIRTUAL;
|
||||
}
|
||||
|
||||
bool DrmConnector::external() const {
|
||||
return type_ == DRM_MODE_CONNECTOR_HDMIA;
|
||||
}
|
||||
|
||||
bool DrmConnector::valid_type() const {
|
||||
return internal() || external();
|
||||
}
|
||||
|
||||
int DrmConnector::UpdateModes() {
|
||||
int fd = drm_->fd();
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,9 @@ class DrmConnector {
|
|||
int display() const;
|
||||
void set_display(int display);
|
||||
|
||||
bool built_in() const;
|
||||
bool internal() const;
|
||||
bool external() const;
|
||||
bool valid_type() const;
|
||||
|
||||
int UpdateModes();
|
||||
|
||||
|
|
|
|||
|
|
@ -154,16 +154,28 @@ int DrmResources::Init() {
|
|||
break;
|
||||
}
|
||||
|
||||
if (conn->built_in() && !found_primary) {
|
||||
connectors_.emplace_back(std::move(conn));
|
||||
}
|
||||
|
||||
// First look for primary amongst internal connectors
|
||||
for (auto &conn : connectors_) {
|
||||
if (conn->internal() && !found_primary) {
|
||||
conn->set_display(0);
|
||||
found_primary = true;
|
||||
} else {
|
||||
conn->set_display(display_num);
|
||||
++display_num;
|
||||
}
|
||||
|
||||
connectors_.emplace_back(std::move(conn));
|
||||
}
|
||||
|
||||
// Then look for primary amongst external connectors
|
||||
for (auto &conn : connectors_) {
|
||||
if (conn->external() && !found_primary) {
|
||||
conn->set_display(0);
|
||||
found_primary = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (res)
|
||||
drmModeFreeResources(res);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue