Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-drm_hwcomposer: Commit

external/drm_hwcomposer


Commit MetaInfo

Révision2c0e2c3e7d7695fe010da66c46bdc031aad0c2cd (tree)
l'heure2018-11-02 16:06:13
AuteurMauro Rossi <issor.oruam@gmai...>
CommiterChih-Wei Huang

Message de Log

Take Connection state into account. (v2)

(v2) porting of original commit 76fb87e675 of android-ia master
with additional external connector types and removal of redundant HDMIA internal

(v1) There are various places where we should be really taking connection
state into account before querying the properties or assuming it
as primary. This patch fixes them.

BUG=None.
TEST=System boots up and shows UI.

(v1) Signed-off-by: Jim Bish <jim.bish@intel.com>

Change Summary

Modification

--- a/drmconnector.cpp
+++ b/drmconnector.cpp
@@ -69,8 +69,7 @@ void DrmConnector::set_display(int display) {
6969
7070 bool DrmConnector::internal() const {
7171 return type_ == DRM_MODE_CONNECTOR_LVDS || type_ == DRM_MODE_CONNECTOR_eDP ||
72- type_ == DRM_MODE_CONNECTOR_DSI || type_ == DRM_MODE_CONNECTOR_VIRTUAL ||
73- type_ == DRM_MODE_CONNECTOR_HDMIA;
72+ type_ == DRM_MODE_CONNECTOR_DSI || type_ == DRM_MODE_CONNECTOR_VIRTUAL;
7473 }
7574
7675 bool DrmConnector::external() const {
--- a/drmresources.cpp
+++ b/drmresources.cpp
@@ -159,7 +159,7 @@ int DrmResources::Init() {
159159
160160 // First look for primary amongst internal connectors
161161 for (auto &conn : connectors_) {
162- if (conn->internal() && !found_primary) {
162+ if (conn->state() == DRM_MODE_CONNECTED && conn->internal() && !found_primary) {
163163 conn->set_display(0);
164164 found_primary = true;
165165 } else {
@@ -170,7 +170,7 @@ int DrmResources::Init() {
170170
171171 // Then look for primary amongst external connectors
172172 for (auto &conn : connectors_) {
173- if (conn->external() && !found_primary) {
173+ if (conn->state() == DRM_MODE_CONNECTED && conn->external() && !found_primary) {
174174 conn->set_display(0);
175175 found_primary = true;
176176 }
@@ -292,6 +292,11 @@ int DrmResources::TryEncoderForDisplay(int display, DrmEncoder *enc) {
292292
293293 int DrmResources::CreateDisplayPipe(DrmConnector *connector) {
294294 int display = connector->display();
295+
296+ // skip not connected
297+ if (connector->state() == DRM_MODE_DISCONNECTED)
298+ return 0;
299+
295300 /* Try to use current setup first */
296301 if (connector->encoder()) {
297302 int ret = TryEncoderForDisplay(display, connector->encoder());
Afficher sur ancien navigateur de dépôt.