From patchwork Wed Sep 27 11:58:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foss X-Patchwork-Id: 9973873 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 43F3D602D6 for ; Wed, 27 Sep 2017 11:59:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 380672888B for ; Wed, 27 Sep 2017 11:59:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CEA728DF0; Wed, 27 Sep 2017 11:59:18 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 C05D32888B for ; Wed, 27 Sep 2017 11:59:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 989FF6E70F; Wed, 27 Sep 2017 11:59:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8727C6E6F8 for ; Wed, 27 Sep 2017 11:59:02 +0000 (UTC) Received: from localhost.localdomain (unknown [IPv6:2a02:8109:9a3f:ee3b:c7ab:3df6:4b82:1a62]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: robertfoss) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 2F16726CE62; Wed, 27 Sep 2017 12:59:01 +0100 (BST) From: Robert Foss To: dri-devel@lists.freedesktop.org, robh@kernel.org, salidoa@google.com, seanpaul@chromium.org, zachr@google.com Subject: [PATCH hwc v2 5/6] drm_hwcomposer: Add GetCrtcCount function Date: Wed, 27 Sep 2017 13:58:40 +0200 Message-Id: <20170927115841.29134-6-robert.foss@collabora.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170927115841.29134-1-robert.foss@collabora.com> References: <20170927115841.29134-1-robert.foss@collabora.com> 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" X-Virus-Scanned: ClamAV using ClamSMTP This GetCrtrcCount helper functions enables convenient fetching of the number of Crtcs from DrmResources. Signed-off-by: Robert Foss --- drmresources.cpp | 4 ++++ drmresources.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drmresources.cpp b/drmresources.cpp index 762f5ef..0578cc6 100644 --- a/drmresources.cpp +++ b/drmresources.cpp @@ -241,6 +241,10 @@ DrmPlane *DrmResources::GetPlane(uint32_t id) const { return NULL; } +uint32_t DrmResources::GetCrtcCount() const { + return (uint32_t) crtcs_.size(); +} + uint32_t DrmResources::next_mode_id() { return ++mode_id_; } diff --git a/drmresources.h b/drmresources.h index a2d8d16..0cc2456 100644 --- a/drmresources.h +++ b/drmresources.h @@ -66,6 +66,7 @@ class DrmResources { int GetConnectorProperty(const DrmConnector &connector, const char *prop_name, DrmProperty *property); + uint32_t GetCrtcCount() const; uint32_t next_mode_id(); int CreatePropertyBlob(void *data, size_t length, uint32_t *blob_id);