From patchwork Mon Nov 14 09:59:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9426969 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 8744560471 for ; Mon, 14 Nov 2016 10:00:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C834286D4 for ; Mon, 14 Nov 2016 10:00:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71765286FE; Mon, 14 Nov 2016 10:00:33 +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=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=unavailable 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 38E6F286D4 for ; Mon, 14 Nov 2016 10:00:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 80D9B6E3B8; Mon, 14 Nov 2016 10:00:02 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5E9C76E3AA; Mon, 14 Nov 2016 09:59:53 +0000 (UTC) Received: by mail-pg0-f66.google.com with SMTP id e9so8270297pgc.1; Mon, 14 Nov 2016 01:59:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8r1aR+EtH2+3VYOn0I/M7Pez3S+abst77g4PpEg5hlE=; b=Dg2HUA8vTr54MucwyumeFXSJAgdSyLoZQpDjytNcCnUuI2c24oK14cxXBDcBhe8Vun epvYgPf7ZbCndu23jUSK1f/J5KYvBinZnNyYGQzZ0IurZj273Bhp50kLsmu870vwYbpI PoCZuNVUwB2DJXnZzVbzf8Q3L/0ioACXIQVqUgxzN6ysByfueVmazu0uaZBYgoFyY9iZ pyyUGHGm/aWsNce9/yooGte+vLvSQZQkAJug9gXdPdJsHncgkwjuWcWEuuvrwnOO54Fu xYoX6nWI/isj6wRRisgYLoRhV/Oot2DXUwQzR3I5TR2H1zT+dA3ZdQQPJO/8e1tEUeNJ 9x/w== X-Gm-Message-State: ABUngvd439yzuKq7uy8BK2Muo0ELOZtFrLwfTPlZUDIxQ2XIedcKI9JKqb7JTh8KNrUczA== X-Received: by 10.98.36.195 with SMTP id k64mr34498187pfk.126.1479117592677; Mon, 14 Nov 2016 01:59:52 -0800 (PST) Received: from jade.nodan1.kt.home.ne.jp (202-72-64-164.koalanet.ne.jp. [202.72.64.164]) by smtp.gmail.com with ESMTPSA id p125sm14320235pfg.33.2016.11.14.01.59.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Nov 2016 01:59:52 -0800 (PST) From: Gustavo Padovan To: intel-gfx@lists.freedesktop.org Date: Mon, 14 Nov 2016 18:59:20 +0900 Message-Id: <1479117566-17709-9-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1479117566-17709-1-git-send-email-gustavo@padovan.org> References: <1479117566-17709-1-git-send-email-gustavo@padovan.org> Cc: dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH 06/12] lib/igt_kms: Add support for the IN_FENCE_FD property X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Robert Foss Add support dor the IN_FENCE_FD property to enable setting in fences for atomic commits. Signed-off-by: Robert Foss --- lib/igt_kms.c | 20 ++++++++++++++++++++ lib/igt_kms.h | 5 +++++ 2 files changed, 25 insertions(+) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 8aaff5b..4748c0a 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -164,6 +164,7 @@ const char *igt_plane_prop_names[IGT_NUM_PLANE_PROPS] = { "CRTC_H", "FB_ID", "CRTC_ID", + "IN_FENCE_FD", "type", "rotation" }; @@ -1426,6 +1427,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) n_planes++; plane->pipe = pipe; plane->drm_plane = drm_plane; + plane->fence_fd = -1; if (is_atomic == 0) { display->is_atomic = 1; @@ -1712,6 +1714,11 @@ igt_atomic_prepare_plane_commit(igt_plane_t *plane, igt_pipe_t *pipe, plane->index, fb_id); + if (plane->fence_fd >= 0) { + uint32_t fence_fd = plane->fence_fd; + igt_atomic_populate_plane_req(req, plane, IGT_PLANE_IN_FENCE_FD, fence_fd); + } + if (plane->fb_changed) { igt_atomic_populate_plane_req(req, plane, IGT_PLANE_CRTC_ID, fb_id ? crtc_id : 0); igt_atomic_populate_plane_req(req, plane, IGT_PLANE_FB_ID, fb_id); @@ -2522,6 +2529,19 @@ void igt_plane_set_fb(igt_plane_t *plane, struct igt_fb *fb) plane->size_changed = true; } +/** + * igt_plane_set_fence_fd: + * @plane: plane + * @fence_fd: fence fd, disable fence_fd by setting it to 0 + * + * This function sets a fence fd to enable a commit to wait for some event to + * occur before completing. + */ +void igt_plane_set_fence_fd(igt_plane_t *plane, uint32_t fence_fd) +{ + plane->fence_fd = fence_fd; +} + void igt_plane_set_position(igt_plane_t *plane, int x, int y) { igt_pipe_t *pipe = plane->pipe; diff --git a/lib/igt_kms.h b/lib/igt_kms.h index ae2b505..344f931 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -213,6 +213,7 @@ enum igt_atomic_plane_properties { IGT_PLANE_FB_ID, IGT_PLANE_CRTC_ID, + IGT_PLANE_IN_FENCE_FD, IGT_PLANE_TYPE, IGT_PLANE_ROTATION, IGT_NUM_PLANE_PROPS @@ -266,6 +267,9 @@ typedef struct { uint32_t src_h; igt_rotation_t rotation; + + /* in fence fd */ + int32_t fence_fd; uint32_t atomic_props_plane[IGT_NUM_PLANE_PROPS]; } igt_plane_t; @@ -349,6 +353,7 @@ void igt_pipe_set_ctm_matrix(igt_pipe_t *pipe, void *ptr, size_t length); void igt_pipe_set_gamma_lut(igt_pipe_t *pipe, void *ptr, size_t length); void igt_plane_set_fb(igt_plane_t *plane, struct igt_fb *fb); +void igt_plane_set_fence_fd(igt_plane_t *plane, uint32_t fence_fd); void igt_plane_set_position(igt_plane_t *plane, int x, int y); void igt_plane_set_size(igt_plane_t *plane, int w, int h); void igt_plane_set_rotation(igt_plane_t *plane, igt_rotation_t rotation);