From patchwork Fri Apr 15 01:29:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 8844171 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4BC589F3D1 for ; Fri, 15 Apr 2016 01:30:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 662082034C for ; Fri, 15 Apr 2016 01:30:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 570742034A for ; Fri, 15 Apr 2016 01:30:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1067A6EB65; Fri, 15 Apr 2016 01:30:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id B6A856EB61 for ; Fri, 15 Apr 2016 01:29:54 +0000 (UTC) Received: by mail-pa0-f44.google.com with SMTP id zm5so50121907pac.0 for ; Thu, 14 Apr 2016 18:29:54 -0700 (PDT) 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=gwr43oGVkVJoDRCylQ8yQSlDFKEDb+aEPU9TctRWi3k=; b=JuY2Y3UHn9w1zVkN8Zl036F/2K2QDNgNWEK0Z9tCA+fSkHgxgPnklGvOzozs3K4+Cs mTX/STf9gBnDkC32AAZWq/Q+YhUOIgyPi8n07s17f2mdCdPRnqUM1heWZzU8hlUykO0L QDZjO5Itg12G6AajptqK/GVX5v5Kdlmdfyhn7FRn4YQbHirLMxkt9iuQQjLz7+TBhnaH ky1/R2HZRh1+HcY/Q/zjmu55VDtV9bU1KkGFVzHAeCavTljCqYH7EALw57JZvgPJSG5d /DUthgG95jdqnN3fTlvOy9v3C0meExFUtRRXpUvAUbpYWSNoQr2kO6NnuwqXjHEJxQC3 Al6A== X-Gm-Message-State: AOPr4FWcw/yGyJr9XRByn+DdMvUnP8nUusYQH2Hivzodv2L5ORpxe+mD/H8QICs99527uQ== X-Received: by 10.66.65.169 with SMTP id y9mr25707230pas.102.1460683794140; Thu, 14 Apr 2016 18:29:54 -0700 (PDT) Received: from jade.localdomain (c-73-241-147-137.hsd1.ca.comcast.net. [73.241.147.137]) by smtp.gmail.com with ESMTPSA id 132sm10740538pfw.35.2016.04.14.18.29.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Apr 2016 18:29:53 -0700 (PDT) From: Gustavo Padovan To: dri-devel@lists.freedesktop.org Subject: [RFC 7/8] drm/fence: create per-crtc sync_timeline Date: Thu, 14 Apr 2016 18:29:40 -0700 Message-Id: <1460683781-22535-8-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1460683781-22535-1-git-send-email-gustavo@padovan.org> References: <1460683781-22535-1-git-send-email-gustavo@padovan.org> Cc: marcheu@google.com, Daniel Stone , seanpaul@google.com, Daniel Vetter , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , linux-kernel@vger.kernel.org, Riley Andrews , laurent.pinchart@ideasonboard.com, Gustavo Padovan , John Harrison , m.chehab@samsung.com 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-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Gustavo Padovan Add one timeline per-crtc that will be use to handle fence signalling to userspace via sync_files. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/drm_crtc.c | 9 +++++++++ include/drm/drm_crtc.h | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 65212ce..e1204cf 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -709,6 +709,13 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc, return -ENOMEM; } + crtc->timeline = sync_timeline_create(dev->driver->name, crtc->name); + if (!crtc->timeline) { + drm_mode_object_put(dev, &crtc->base); + kfree(crtc->name); + return -ENOMEM; + } + crtc->base.properties = &crtc->properties; list_add_tail(&crtc->head, &config->crtc_list); @@ -755,6 +762,8 @@ void drm_crtc_cleanup(struct drm_crtc *crtc) if (crtc->state && crtc->funcs->atomic_destroy_state) crtc->funcs->atomic_destroy_state(crtc, crtc->state); + sync_timeline_destroy(crtc->timeline); + kfree(crtc->name); memset(crtc, 0, sizeof(*crtc)); diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 5ba3cda..7934178 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -715,6 +716,7 @@ struct drm_crtc_funcs { * @helper_private: mid-layer private data * @properties: property tracking for this CRTC * @state: current atomic state for this CRTC + * @timeline: sync timeline for fence sigalling * @acquire_ctx: per-CRTC implicit acquire context used by atomic drivers for * legacy IOCTLs * @@ -771,6 +773,8 @@ struct drm_crtc { struct drm_crtc_state *state; + struct sync_timeline *timeline; + /* * For legacy crtc IOCTLs so that atomic drivers can get at the locking * acquire context.