From patchwork Wed Nov 1 17:50:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 117732 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1167516qgn; Wed, 1 Nov 2017 10:50:40 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QAIUMjsAx5P/A5fKFYXuxT/kNXj34/A0utgEeidyZf4s5o7t+P9bmsR0y1WKzQIZAv5p+E X-Received: by 10.98.65.156 with SMTP id g28mr714263pfd.11.1509558640726; Wed, 01 Nov 2017 10:50:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509558640; cv=none; d=google.com; s=arc-20160816; b=i8kI0XeMf/B9HZISyI4Jter5lHT+qfso93NOGUWQqaxPZlOGjl04ooP8p1INHFe2qh j1rX2tz0yYCgYN+sBrS2IaagunJeZnHisUYfqeaX04goHaib3cbBLNSrxJccZYfdUMjW 6OJ/HlM20OkiqI9M5RX/pyeRFX4y3P74PAWMrQ7rulauwmcLiGC8opxG60cFlBFIhRNu beOIf0eFPVs2vkhOnT+ycoxRHsGA7u3YcFV8djFJt/kvHpeFCIZXEIu/yMarhZjxa1B4 SZO40IyImYtJ/b0eSogYWfoPnXf55/wQ2bldnjB37Zzs05ZjKyZlJwevNnRND2JEJC2p czQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=/WOmw52Lh+qWGqw/4Q8RtIDhdnfckxFhxigTKLeXvas=; b=o9VVAQ3TvhrxU6TlKDAsFNSZFibKJi+SO/7yn8dTLk3WIN2hEV4L9JkXo9ru/WbsCH 3jFJxsvCB4r3vesaDjJAkLnKknfDfLDVCFz8y0HBqrwaghz/wYCPsW0sBjoPrbcAnNZa KA1jZ4XHysWRaOqeMQThpbbkkwy+cHOuRofC+D+JL+glOfISQVYBzD0gESyrFHUheurb IiR969uzseXdkS9kfjRfXcYxDNbLsSYAKSRn3kJEPTWQA+EqmpQJ8PiIxnFiIuQ6f0UR I0RjV6D34XCnkJsadXahsu1MStDLZ710yxj+7DcMIn+4kYg7zQ8yv92tKGvpiG2GgGNE Vw8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id p20si1650309pgc.351.2017.11.01.10.50.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Nov 2017 10:50:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CF3C26E016; Wed, 1 Nov 2017 17:50:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-oi0-f66.google.com (mail-oi0-f66.google.com [209.85.218.66]) by gabe.freedesktop.org (Postfix) with ESMTPS id D57A56E016 for ; Wed, 1 Nov 2017 17:50:06 +0000 (UTC) Received: by mail-oi0-f66.google.com with SMTP id a132so5682271oih.11 for ; Wed, 01 Nov 2017 10:50:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=J4a4m/mG6ewvDFiwJkIgZ1cmS7ZoM3AIqTWmsIEjaFs=; b=oeD9iRuowcR3CvTs91Wfp/3KnARnuVPYQFdmS6ppxt+xr4fYVtwAW37oqYGPBsxzq+ r9mgIW4vu9eyXU+gJj7GUk1M6ker4oRJA+yUoMQY90wxLM80yntUpRtPOMZNnEZonaFs 75PqcnEIZc7MNHA1zx18iNofbY5jyIJck4StRRjulPR5D+NG1Gs99Izr3I2UjwxlA7/v 70ZMxS3pAiOxwZ6nzKvX6OhA4jdpMZW10n8RjQwy+JGsq5mR5BSKbUsp0cYS44pCAlix lqfYjgOPnNPBHO4pao2aWqKd9mjPol3JFBqFo1rzV/brEfEeFHqFUxkpROIznKVb9B1B x/zw== X-Gm-Message-State: AMCzsaX6bjkzYjI+ybR/Ywhb5poXcQWOTWfiQL7iJ/jWUnf4HnhIAYRV BmvD7V9p3RoTeT/rM6xE6Ke2Wh8= X-Received: by 10.202.252.132 with SMTP id a126mr410574oii.36.1509558605798; Wed, 01 Nov 2017 10:50:05 -0700 (PDT) Received: from xps15.herring.priv (216-188-254-6.dyn.grandenetworks.net. [216.188.254.6]) by smtp.googlemail.com with ESMTPSA id g6sm486826otb.24.2017.11.01.10.50.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Nov 2017 10:50:05 -0700 (PDT) From: Rob Herring To: dri-devel@lists.freedesktop.org Subject: [PATCH hwc] drm_hwcomposer: Add HDMI connector as a valid type Date: Wed, 1 Nov 2017 12:50:04 -0500 Message-Id: <20171101175004.21282-1-robh@kernel.org> X-Mailer: git-send-email 2.14.1 Cc: Robert Foss X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Robert Foss 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 Signed-off-by: Rob Herring --- This is needed to get dev boards like DB410c to work. drmconnector.cpp | 10 +++++++++- drmconnector.h | 4 +++- drmresources.cpp | 16 ++++++++++++++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/drmconnector.cpp b/drmconnector.cpp index ccb38e2f00dc..247f56bde748 100644 --- a/drmconnector.cpp +++ b/drmconnector.cpp @@ -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(); diff --git a/drmconnector.h b/drmconnector.h index e1488bb42a9a..5601e069f003 100644 --- a/drmconnector.h +++ b/drmconnector.h @@ -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(); diff --git a/drmresources.cpp b/drmresources.cpp index 67a853c587b3..32dd37636e73 100644 --- a/drmresources.cpp +++ b/drmresources.cpp @@ -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);