From patchwork Wed Apr 11 15:22:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru-Cosmin Gheorghe X-Patchwork-Id: 10335693 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5B20560365 for ; Wed, 11 Apr 2018 15:23:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CAD22897C for ; Wed, 11 Apr 2018 15:23:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40D0928980; Wed, 11 Apr 2018 15:23:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8DD162897C for ; Wed, 11 Apr 2018 15:23:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 992FC6E6A8; Wed, 11 Apr 2018 15:23:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20055.outbound.protection.outlook.com [40.107.2.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id E6E556E6A6 for ; Wed, 11 Apr 2018 15:23:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=UD8jihTrURnfREyE/NqhpymT6ssUyGn2+xpgUJKHjxI=; b=Ds8VFocuD71O7iJY9sbzpDEOYR+ciIkuA+d7zV8/WsVxhCXw04ZidYaAhWbMTqjG60jHEQ+UUtHDO2LPbh8en9Vtx8JfXKABCn0swNdfSXjfTRb5CNCRd6RFo1DXaDyMQUxYFTx0tEZ+4bRVTT8itnwuYBTtCBKtigXydzcS+tQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Alexandru-Cosmin.Gheorghe@arm.com; Received: from e114479-lin.cambridge.arm.com (217.140.96.140) by AM5PR0801MB1249.eurprd08.prod.outlook.com (2603:10a6:203:1e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.675.10; Wed, 11 Apr 2018 15:23:19 +0000 From: Alexandru Gheorghe To: dri-devel@lists.freedesktop.org, liviu.dudau@arm.com, brian.starkey@arm.com, ayan.halder@arm.com, seanpaul@chromium.org Subject: [PATCH hwc v2 05/18] drm_hwcomposer: Enable resource manager support Date: Wed, 11 Apr 2018 16:22:16 +0100 Message-Id: <1523460149-1740-6-git-send-email-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523460149-1740-1-git-send-email-alexandru-cosmin.gheorghe@arm.com> References: <1523460149-1740-1-git-send-email-alexandru-cosmin.gheorghe@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: VI1PR0701CA0066.eurprd07.prod.outlook.com (2603:10a6:800:5f::28) To AM5PR0801MB1249.eurprd08.prod.outlook.com (2603:10a6:203:1e::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603328)(7153060)(7193020); SRVR:AM5PR0801MB1249; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1249; 3:EcPgZDcnbLcR/U/4l4C67iA8MqnH11aVd5JEXclev+FCIUnXyi84wzp01GsxPlgdzEGLrtISOcPujN5wbRDTH9diXMdIEGjIxEm/AgbKq1qYLXfwHmaT3FkW43+qZZ1ciKhKcxwFHjM15MvV6mebqf/RvczANTkwrGscimeHt/rSDJ+Igb3oKZn46FWV/XBb9a1SBjeuiUhmTXikKw331gNsKukVdQAfJ9rA1gveDtbdS8ZYCO7aFkfY7MT8mnbd; 25:kysLB6Gl09HKmR6zaho+28vw9x11C5dkT78v7nArGS1prfwiPyzQFl5o8XMx/Bl5kU51u6UtwxMlmXRQaklS4qGIs79pmsMZMFixgwNRSd0yKrBoAnwp+vvC8OY4HyWDezUWEGRsLad1ELj4dPqtvb9aRZ3IwgrjOddjD5vH1Pz8uH/GiH9Kym7GAtfX8Cki209a9lfbJhC2vZgsaGVfycFZmj9hrUHhHbcaoCVGU8j30iW+O+D7KsFHbUTpDid/IU+tijm1vIC9tpXNMaLPouPwVIZyxPizxAVdSxd4nMHVOv+OzxAQgai2wl58I9+NwuW7ubicp9PKjOVmS15Pow==; 31:c3PfG6nFrZgvRgLYBFKC0xSSA594uoeMwVumu0cqfNp1BHAhFbBbJdqUkB+0LlJxtYaVuvvlbj/tk9+ZYHinvk6A1k3w4cJmSfYQh4lDy3rD9AtdTY4218pFla0MhgIvb3GtitCd54LDbEjcjSyPHQ2kvP3LH4I/teOX1de+6Hd59YX1uJ2tSzBCI5t8KFOoFJP7kPxT28Owe8VNsOWmUNHAyMbX2H02by8vtRmX+N4= X-MS-TrafficTypeDiagnostic: AM5PR0801MB1249: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1249; 20:fsCrF14Ea0MRJN8JuYcsxENqL811XIHgbk/LcXCoyGOJ087/lXIM226urWvgwfHdJXZJOlY+FxW3eLpevTknPt+i6sRdvE6fnsd+FduMeGLhGjoONygAvdS8cKdMDiTcDyyFxP7ZOrK+6zkuUQ0FxlLT5p2dkGLVkG1ejqmRUqw=; 4:Id6uB2lwi95BZJoV/gzt5U9cKRPI9j/9jIYFSqA5XgSQE2g0/w3QFxev0lmSXFEgF6hnAe0VI3pEFpaTlGOk1pUL0QbSk1lFtAzliVtCukFgJ9e5pa/zJghbjoELt0XnDwZ5puqExVrG0RKe3xFVosy8CYwmW+U9FBS7zSKU+P3oFpO5S/6SpSu7Cw9V+mpwnuW9hmoo0QnaJ71dmD2Se5wXxhV/oL7qchM4ZVoetRL3YsxwdLSMqysoPVq3wdEQdX9PqkZ6RN6OypST4hy7n7Z642QlJfFXucPPJoyCB8BgQm6Gn8MFbk4NPvAb07rj X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231221)(944501327)(52105095)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:AM5PR0801MB1249; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0801MB1249; X-Forefront-PRVS: 0639027A9E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(346002)(396003)(376002)(366004)(39860400002)(189003)(199004)(16526019)(478600001)(305945005)(50226002)(16586007)(68736007)(7736002)(86362001)(81156014)(8676002)(316002)(81166006)(4326008)(25786009)(2906002)(50466002)(8936002)(6486002)(105586002)(48376002)(186003)(956004)(5660300001)(6666003)(72206003)(106356001)(476003)(53936002)(3846002)(76176011)(51416003)(52116002)(47776003)(7696005)(36756003)(66066001)(11346002)(446003)(386003)(97736004)(6116002)(2616005)(26005)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0801MB1249; H:e114479-lin.cambridge.arm.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1249; 23:xiE8qApoA9oG/QSUGN4rd7WSvRNYanTLXBQe5Tj?= =?us-ascii?Q?PJFxZH0uE5SIBKN1/n2dwSkT5chypVn2U8EtGRSWtsLd4bcE4JWFTPfGAGi+?= =?us-ascii?Q?jD0AiDG/Tj4sHgh65VF27izZzm8i/k0PsjXTpbGAdB92ViYottMQpopq2VwY?= =?us-ascii?Q?4kEFsYfv/nQSjhf+WSpMFjyV58mmmAa7fuhQz3P1oyH42J4Va7hJoo+8RQR5?= =?us-ascii?Q?brSIHd2kqbRC/0Pj8pfWojTI/1k3cKB//o4Hv2idshtBq/nqz/6Og7QOtivg?= =?us-ascii?Q?Bu+L8FNcZ+7MbmVqwXkU/tQjKj1Tx2xEW/acJNs7FCjIzskr0AoiobvaFLw5?= =?us-ascii?Q?z+okA0lW/GtcPZAsnvCK0IVCoLY2fmj/q4nTLrVk06OHuKdJtmflF5S0Q4b6?= =?us-ascii?Q?uMJnmuBxh8QFNkcXic+ue7C22EPF4rlJmVmTX6V1oXh4i3EvADq29Ln4pSRg?= =?us-ascii?Q?R4qJZWTKkxmtoMmae4TK+yRjO6Zyt9QM4Gp9AaJEuNvHAlrLgahF5qEXmufe?= =?us-ascii?Q?Qnhx8qVX4ZklgtGtgwodDfwY6beBBxgLBw5F1U3d0DXwClz/q6ja1HpFieqR?= =?us-ascii?Q?iDKqLZsDFTEfKq1qLnH/Gx6VlnuPuxxr0v82COKVvMKXe45Lh5EkQN/nBHj+?= =?us-ascii?Q?32bzsoiff57PrYoq0tSH4h2mMHRKleISYxfnf2CuT1aSTUPqnAGK+gTYLndm?= =?us-ascii?Q?7pM/qgjEUyBVPjiI4faT3xbTCwh4GfCygwFlxvcCEd/9Z0TfEogZsJK+vopR?= =?us-ascii?Q?7QjHxqTmVS/LpPNnrUDGNq4i5/TsXO3FMqvsLWWqHyGaeQWgCVtuAxWmgbej?= =?us-ascii?Q?8uWK4j0TT5PsR1ML5jVUQhmxKG2aIOW/uH1gpLRnb8fkM/riy0c5+ueOpIfn?= =?us-ascii?Q?jgZapTJVNFJKAzDvcBT9um6wyAtNb+0cqqZl5puY9HL6yBqbzY3hzMqPRZRp?= =?us-ascii?Q?gDsNx2SQ6rG1z1kihbzEFqkpEO5lNO4YKGS3iZRJrmdS28E4PRm7oNoBnxiy?= =?us-ascii?Q?wkn6JrrBWmsPxcgZKH8MWtUDA7p6IXpwiykqpUb8iYrtgWcD5ZpRuLXlbIjI?= =?us-ascii?Q?yrPo3+zbppmUAh/2NYa+9EcJJCJP4k5A7I2/8U4sdcCqJN10ocwifOZ3F/fc?= =?us-ascii?Q?xRTzWpivN1JFQQv+956a9rzlbjFsem4KV923tiy+SpgNMK777U99mTg=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Antispam-Message-Info: EXMnOVv10IRKYLe3/OvVbi96aOARpfXfw/wkuBtTVkdocwlm1ys2i8I4Cxl+FUftM5UtoIAsVsaPRQY+vk0l3T/6HOkUYiaImQtDRsfHLnMCdElrtCJX3oUyM/PxY0GN7y51GZ1NGrepRzSftjDzjsc0nsVCsFvNfayb6JeFLJLKXrv2hJ++uHy783GzJhgY X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1249; 6:hy0UjxPV2ktspnGeYvuC4e5+IhILaBdt/tZKUd9QZlCCqhNseEOc5uUG3dyyMNi2NyEwMBcS7v1kYRib83lVqdEg5cnbtvVDorRg1gkj5pzLMcx3urOQLjT33SZV8ue5FUTYro1JLYDFZuNZ4dzSMoErFvTKTaQ9shlJgxc0cta5tx5FeDYAIANnM3hYhs2QKDplIfGUGEVGq92cQO3xyfXC5iViub5UEX8hSrCSHl1pIlPap8nQZ+nKXWdDVTGLXGykgTHsSQ1e2l37IffEWcHXJLvUjXxhDxm/iBvFz2xlqPExfy+krtOCMjW+BhBqMTQiyiB8V12A2j0PAfYMNlyki6P8c3XsYGLp8VvBVHRsuQShN2G1KaqBuMCfjKVbqf0wUYa+JchS9usrguBvTKqEBIEXU2yKqQGun8gmHzvMTgXgq6oPcCcWvcJV+9GjbFviKMMqvv/2MLPOfFAyoA==; 5:0b5+Xjmo8mtZ6m7Ur7rZhy676LiJ03GUvgEkQNEOK7ejFI2ACK3hjL3Pkz8WKmNiF22Yno8bUNvX6d3gF5iZSheaDOt1gmtQv+fG6GzItfwuXJ6rDSZ0/ud+TxI1F7q9T7xLi+MWKkOTgy5NJekrg804YSJcL6OZWTqzXA7Cq5E=; 24:tk5mL7IiGPWKP3FoHDe5G69TsqUzLHfaZJVRes/WrjSHhDAYtT0Wwza8biOqX/rcHl58CWWF+Zr6nwy9IFYSf+Y+IwYNHBGJfkNuKpNa1D0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1249; 7:tYw1HEQCU7Wf4QznRAia+rBrFLXIGMMzPfahKYY/KRXWZw49ujP0bcVybQcKWFsDj1WXA54IfExC1vHDYnKNQb0nvULpAOAFfj8+FLJf003mxTGqWBf484c4Nn2BddZMnE3khs5f3tY+fJo9BGCfH6JYaWrylzplUQV4xCmb9KjCfyQ4yBVVnCnY4tfNJY+HkuGVfegI8VBS6lLsir795zA+3z2T6nMEficoCrhzdKrO8mL3rTgGFUGw9oXaNt6E X-MS-Office365-Filtering-Correlation-Id: f9ab8338-1e7a-4ee6-e8cd-08d59fc0286a X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2018 15:23:19.8541 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f9ab8338-1e7a-4ee6-e8cd-08d59fc0286a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1249 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nd@arm.com, Alexandru Gheorghe Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use the newly added ResourceManager for creating and detecting all the drm devices instead of assuming that there is only one device. Signed-off-by: Alexandru Gheorghe --- drmhwctwo.cpp | 34 +++++++++++++--------------------- drmhwctwo.h | 4 +--- drmresources.cpp | 25 ++++++++++++++++++------- drmresources.h | 14 +++++++++++--- 4 files changed, 43 insertions(+), 34 deletions(-) diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp index dfca1a6..cddd5da 100644 --- a/drmhwctwo.cpp +++ b/drmhwctwo.cpp @@ -58,40 +58,32 @@ DrmHwcTwo::DrmHwcTwo() { } HWC2::Error DrmHwcTwo::Init() { - int ret = drm_.Init(); + int ret = resource_manager_.Init(); if (ret) { - ALOGE("Can't initialize drm object %d", ret); + ALOGE("Can't initialize the resource manager %d", ret); return HWC2::Error::NoResources; } - importer_.reset(Importer::CreateInstance(&drm_)); - if (!importer_) { - ALOGE("Failed to create importer instance"); + DrmResources *drm = resource_manager_.GetDrmResources(HWC_DISPLAY_PRIMARY); + std::shared_ptr importer = + resource_manager_.GetImporter(HWC_DISPLAY_PRIMARY); + if (!drm || !importer) { + ALOGE("Failed to get a valid drmresource and importer"); return HWC2::Error::NoResources; } + displays_.emplace( + std::piecewise_construct, std::forward_as_tuple(HWC_DISPLAY_PRIMARY), + std::forward_as_tuple(drm, importer, resource_manager_.GetGralloc(), + HWC_DISPLAY_PRIMARY, HWC2::DisplayType::Physical)); - ret = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, - (const hw_module_t **)&gralloc_); - if (ret) { - ALOGE("Failed to open gralloc module %d", ret); - return HWC2::Error::NoResources; - } - - displays_.emplace(std::piecewise_construct, - std::forward_as_tuple(HWC_DISPLAY_PRIMARY), - std::forward_as_tuple(&drm_, importer_, gralloc_, - HWC_DISPLAY_PRIMARY, - HWC2::DisplayType::Physical)); - - DrmCrtc *crtc = drm_.GetCrtcForDisplay(static_cast(HWC_DISPLAY_PRIMARY)); + DrmCrtc *crtc = drm->GetCrtcForDisplay(static_cast(HWC_DISPLAY_PRIMARY)); if (!crtc) { ALOGE("Failed to get crtc for display %d", static_cast(HWC_DISPLAY_PRIMARY)); return HWC2::Error::BadDisplay; } - std::vector display_planes; - for (auto &plane : drm_.planes()) { + for (auto &plane : drm->planes()) { if (plane->GetCrtcSupported(*crtc)) display_planes.push_back(plane.get()); } diff --git a/drmhwctwo.h b/drmhwctwo.h index 0490e2a..beb5d2d 100644 --- a/drmhwctwo.h +++ b/drmhwctwo.h @@ -262,9 +262,7 @@ class DrmHwcTwo : public hwc2_device_t { HWC2::Error RegisterCallback(int32_t descriptor, hwc2_callback_data_t data, hwc2_function_pointer_t function); - DrmResources drm_; - std::shared_ptr importer_; // Shared with HwcDisplay - const gralloc_module_t *gralloc_; + ResourceManager resource_manager_; std::map displays_; std::map callbacks_; }; diff --git a/drmresources.cpp b/drmresources.cpp index 32dd376..a5ddda0 100644 --- a/drmresources.cpp +++ b/drmresources.cpp @@ -42,10 +42,9 @@ DrmResources::~DrmResources() { event_listener_.Exit(); } -int DrmResources::Init() { - char path[PROPERTY_VALUE_MAX]; - property_get("hwc.drm.device", path, "/dev/dri/card0"); - +int DrmResources::Init(ResourceManager *resource_manager, char *path, + int start_display_index) { + resource_manager_ = resource_manager; /* TODO: Use drmOpenControl here instead */ fd_.Set(open(path, O_RDWR)); if (fd() < 0) { @@ -76,8 +75,8 @@ int DrmResources::Init() { max_resolution_ = std::pair(res->max_width, res->max_height); - bool found_primary = false; - int display_num = 1; + bool found_primary = start_display_index != 0; + int display_num = found_primary ? start_display_index : 1; for (int i = 0; !ret && i < res->count_crtcs; ++i) { drmModeCrtcPtr c = drmModeGetCrtc(fd(), res->crtcs[i]); @@ -161,9 +160,11 @@ int DrmResources::Init() { for (auto &conn : connectors_) { if (conn->internal() && !found_primary) { conn->set_display(0); + displays_[0] = 0; found_primary = true; } else { conn->set_display(display_num); + displays_[display_num] = display_num; ++display_num; } } @@ -171,7 +172,9 @@ int DrmResources::Init() { // Then look for primary amongst external connectors for (auto &conn : connectors_) { if (conn->external() && !found_primary) { + displays_.erase(conn->display()); conn->set_display(0); + displays_[0] = 0; found_primary = true; } } @@ -226,7 +229,11 @@ int DrmResources::Init() { return ret; } } - return 0; + return displays_.size() ? displays_.rbegin()->first : -EINVAL; +} + +bool DrmResources::HandlesDisplay(int display) const { + return displays_.find(display) != displays_.end(); } DrmConnector *DrmResources::GetConnectorForDisplay(int display) const { @@ -349,6 +356,10 @@ DrmEventListener *DrmResources::event_listener() { return &event_listener_; } +ResourceManager *DrmResources::resource_manager() { + return resource_manager_; +} + int DrmResources::GetProperty(uint32_t obj_id, uint32_t obj_type, const char *prop_name, DrmProperty *property) { drmModeObjectPropertiesPtr props; diff --git a/drmresources.h b/drmresources.h index 4cca48c..4cdcd87 100644 --- a/drmresources.h +++ b/drmresources.h @@ -17,22 +17,26 @@ #ifndef ANDROID_DRM_H_ #define ANDROID_DRM_H_ +#include #include "drmconnector.h" #include "drmcrtc.h" #include "drmencoder.h" #include "drmeventlistener.h" #include "drmplane.h" - -#include +#include "platform.h" +#include "resourcemanager.h" namespace android { +class ResourceManager; + class DrmResources { public: DrmResources(); ~DrmResources(); - int Init(); + int Init(ResourceManager *resource_manager, char *path, + int start_display_index); int fd() const { return fd_.get(); @@ -58,6 +62,7 @@ class DrmResources { DrmCrtc *GetCrtcForDisplay(int display) const; DrmPlane *GetPlane(uint32_t id) const; DrmEventListener *event_listener(); + ResourceManager *resource_manager(); int GetPlaneProperty(const DrmPlane &plane, const char *prop_name, DrmProperty *property); @@ -71,6 +76,7 @@ class DrmResources { int CreatePropertyBlob(void *data, size_t length, uint32_t *blob_id); int DestroyPropertyBlob(uint32_t blob_id); + bool HandlesDisplay(int display) const; private: int TryEncoderForDisplay(int display, DrmEncoder *enc); @@ -90,6 +96,8 @@ class DrmResources { std::pair min_resolution_; std::pair max_resolution_; + std::map displays_; + ResourceManager *resource_manager_; }; }