From patchwork Mon Nov 14 09:59:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9426973 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 E245A60471 for ; Mon, 14 Nov 2016 10:00:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D81A9286D4 for ; Mon, 14 Nov 2016 10:00:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CCFE0286FE; Mon, 14 Nov 2016 10:00:42 +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=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 64643286D4 for ; Mon, 14 Nov 2016 10:00:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 832C66E3C2; Mon, 14 Nov 2016 10:00:05 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0CA726E3B0; Mon, 14 Nov 2016 09:59:55 +0000 (UTC) Received: by mail-pf0-f196.google.com with SMTP id i88so5944012pfk.2; Mon, 14 Nov 2016 01:59:55 -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=1QEOUWUx2WGwtWQBF4Sa9Pbc4zVOBpZeOyyQMoE+sww=; b=BVFAF+iAgEtx7OUh+KmXUzJIDEpDZjejLD3hEjW/vBSQ3qe0Ls/VIIaLEMjrsNv3WB jq2x8ckJitB6w3LGFeMKxJtlkqNd9JSeyCQ9rq2WH3Kj1WfqWsF6mOz3pPei8rjvRK2J HQU6Lfsxmt7OqksKKtS25ah54AzGhruBn4snZak/XiNFuW13MTqDVeGHlNz263vRZEri g3iQay02jG5IpJrJZB1Y65081DOcDMV3DY1IEkvbf/OpRLmfUNRdlrEWNAbM+rHYD6mF UHWL9MONIDIk4C9R6y8od9B/ZFRz+RT/HrDvbkMWl1ywIYUck/ZVJfSMRU619yUbZCQ0 UMuw== X-Gm-Message-State: ABUngvevxxWTutJ3opbxHy2k1Ij3mzwJV6OvPOvn0kO8VWdwFssPH62Dj/MwKVDKSekdOA== X-Received: by 10.98.37.198 with SMTP id l189mr34166724pfl.39.1479117594594; Mon, 14 Nov 2016 01:59:54 -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.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Nov 2016 01:59:54 -0800 (PST) From: Gustavo Padovan To: intel-gfx@lists.freedesktop.org Date: Mon, 14 Nov 2016 18:59:21 +0900 Message-Id: <1479117566-17709-10-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: Gustavo Padovan , dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH 07/12] lib/igt_kms: Add support for the OUT_FENCE_PTR 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: Gustavo Padovan Add support for the OUT_FENCE_PTR property to enable setting out fences for atomic commits. Signed-off-by: Gustavo Padovan --- lib/igt_kms.c | 20 +++++++++++++++++++- lib/igt_kms.h | 3 +++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 4748c0a..f25e1eb 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -175,7 +175,8 @@ const char *igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = { "DEGAMMA_LUT", "GAMMA_LUT", "MODE_ID", - "ACTIVE" + "ACTIVE", + "OUT_FENCE_PTR" }; const char *igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = { @@ -2103,6 +2104,9 @@ static void igt_atomic_prepare_crtc_commit(igt_pipe_t *pipe_obj, drmModeAtomicRe igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_ACTIVE, !!output); } + if (pipe_obj->out_fence_ptr) + igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_OUT_FENCE_PTR, pipe_obj->out_fence_ptr); + /* * TODO: Add all crtc level properties here */ @@ -2683,6 +2687,20 @@ igt_pipe_set_gamma_lut(igt_pipe_t *pipe, void *ptr, size_t length) } /** + * igt_pipe_set_out_fence_ptr: + * @pipe: pipe pointer to which background color to be set + * @fence_ptr: out fence pointer + * + * Sets the out fence pointer that will be passed to the kernel in + * the atomic ioctl. When the kernel returns the out fence pointer + * will contain the fd number of the out fence created by KMS. + */ +void igt_pipe_set_out_fence_ptr(igt_pipe_t *pipe, int *fence_ptr) +{ + pipe->out_fence_ptr = (uint64_t) fence_ptr; +} + +/** * igt_crtc_set_background: * @pipe: pipe pointer to which background color to be set * @background: background color value in BGR 16bpc diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 344f931..02d7bd1 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -110,6 +110,7 @@ enum igt_atomic_crtc_properties { IGT_CRTC_GAMMA_LUT, IGT_CRTC_MODE_ID, IGT_CRTC_ACTIVE, + IGT_CRTC_OUT_FENCE_PTR, IGT_NUM_CRTC_PROPS }; @@ -298,6 +299,7 @@ struct igt_pipe { uint64_t mode_blob; bool mode_changed; + uint64_t out_fence_ptr; }; typedef struct { @@ -351,6 +353,7 @@ static inline bool igt_plane_supports_rotation(igt_plane_t *plane) void igt_pipe_set_degamma_lut(igt_pipe_t *pipe, void *ptr, size_t length); 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_pipe_set_out_fence_ptr(igt_pipe_t *pipe, int *fence_ptr); 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);