From: Damien Lespiau Subject: [PATCH i-g-t 03/43] igt_kms: Provide a get_plane_property() shorthand Date: Thu, 10 Jul 2014 19:00:04 +0100 Message-ID: <1405015244-11370-4-git-send-email-damien.lespiau@intel.com> References: <1405015244-11370-1-git-send-email-damien.lespiau@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 4A3616E025 for ; Thu, 10 Jul 2014 11:01:12 -0700 (PDT) In-Reply-To: <1405015244-11370-1-git-send-email-damien.lespiau@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org So one doesn't have to write the plane type all the time. Signed-off-by: Damien Lespiau --- lib/igt_kms.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 666b0d0..5c8a3cc 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -529,6 +529,14 @@ out: return found; } +static bool +get_plane_property(igt_display_t *display, uint32_t plane_id, const char *name, + uint32_t *prop_id /* out */, uint64_t *value /* out */) +{ + return get_property(display, plane_id, DRM_MODE_OBJECT_PLANE, + name, prop_id, value); +} + /* * Walk a plane's property list to determine its type. If we don't * find a type property, then the kernel doesn't support universal @@ -539,8 +547,8 @@ static int get_drm_plane_type(igt_display_t *display, uint32_t plane_id) uint64_t value; bool has_prop; - has_prop = get_property(display, plane_id, DRM_MODE_OBJECT_PLANE, - "type", NULL /* prop_id */, &value); + has_prop = get_plane_property(display, plane_id, "type", + NULL /* prop_id */, &value); if (has_prop) return (int)value; -- 1.8.3.1