Received: by 10.223.164.200 with SMTP id h8csp59845wrb; Sun, 5 Nov 2017 03:05:09 -0800 (PST) X-Google-Smtp-Source: ABhQp+RekqvNu8C8RLiq8lrm6Xpgw6a5mI9Skfz0ZOVejmGw/cXPvoL/HEzAZ8okvEop7pW56C60 X-Received: by 10.159.234.12 with SMTP id be12mr11987951plb.350.1509879909055; Sun, 05 Nov 2017 03:05:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509879909; cv=none; d=google.com; s=arc-20160816; b=pij3JwMsskDUo1dVAeKn3sy/gwUXJYsxAMR62c1x5lp19pSM3eeITMMByYA5JykhyC cmVrQ0Ow5uNuUkctYGUad2tgO1K1M5e5ZH1s7yP4EOu4wdIFjNm7jCETzIaPQ34R1tMl ghPJ9nO3MRNA0Brnk3RNOqZcffUPDzWhH62MS+WByL6JBLEogwp5vjqE39SCPAyEu6Y8 NSqLJbS2A4oSZSUNmbroWiuYAwSqof9LEA1qV+BTJsqNPzfQHxS0zw/YKXR3dEa9I5md QOVgaPjHpxCvZl3w4ygjCLNE4EHN/e3wZOAV7+5Swkzn7T8QRT71zFxnJjDgufDmss/p bspA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=82mMQXgPlGREsatuWJePx8EKYVq5WoTlYOgHIE00bQc=; b=pIbcrWQuTNO+UqS/H7gBvk1h7OWF59lOM7X18xy3jEm/WE60j3bDax/8KhYh6dmpab c6GnuRZk0YxMajp5NKXgO4D2RvX7NVcfhgGfmqEADQ8zGUHpDKe51TC8VYJzGKFawpKN rjvAqgCfGUuJYLsciq7l25nVu8yz7bR3inpVcpd5X5LyZPIVw4JFhSyhkHO/L8vD5JzP xxaERPtPmbCTFWfyugOYaAR6WJrFJmVzmc+U2zuYkrh5fj1EXvslgG1SdjMAM16clnYh eY4e5VUJhSBM04fHAqgShsQtNSvYagwU2NvOKNqjZX960tkfdjFP/mboh6e3JchCw5h5 3X1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kapsi.fi header.s=20161220 header.b=o4t/WjOr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 11si8819925plf.247.2017.11.05.03.04.55; Sun, 05 Nov 2017 03:05:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kapsi.fi header.s=20161220 header.b=o4t/WjOr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752902AbdKELCx (ORCPT + 96 others); Sun, 5 Nov 2017 06:02:53 -0500 Received: from mail.kapsi.fi ([91.232.154.25]:42704 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751541AbdKELCE (ORCPT ); Sun, 5 Nov 2017 06:02:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=82mMQXgPlGREsatuWJePx8EKYVq5WoTlYOgHIE00bQc=; b=o4t/WjOrZ50+rVT7ftUETcv9rocuJkxHvI6QK1jWVjFNQiqmhllqtVq+EMR8ui2xxM5/0h8wRsCs34uSjUynylRc9T1B83hOeJ1T+LUilZIcdXuqj24Eo6mWTK+cqvs/bqQiCswTmDIAWw+SIoDs8JfIxWI7IGF+K0iC9rafaKFDTYYc0xPGlINu64Sy5xUNtgBqcAfI7dd5iwQxzMWKiBhMWQj5Vli7N1LJtFJpOlTuYgUuxOYCv51dIT1XgWcrEe0q5B2zvd8ZKaSURO1j/Q4jTEiqkNl5d7Ntx1iQWavcD5S4kCNgspAyVNGZ2aY6or0KWrYefrIg3L1uXw+2rg==; Received: from dsl-hkibng22-54f983-249.dhcp.inet.fi ([84.249.131.249] helo=localhost.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eBIgk-0006dR-KV; Sun, 05 Nov 2017 13:02:02 +0200 From: Mikko Perttunen To: thierry.reding@gmail.com, jonathanh@nvidia.com Cc: digetx@gmail.com, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, Mikko Perttunen Subject: [PATCH 07/10] drm/tegra: Make syncpoints be per-context Date: Sun, 5 Nov 2017 13:01:15 +0200 Message-Id: <20171105110118.15142-8-mperttunen@nvidia.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171105110118.15142-1-mperttunen@nvidia.com> References: <20171105110118.15142-1-mperttunen@nvidia.com> X-SA-Exim-Connect-IP: 84.249.131.249 X-SA-Exim-Mail-From: mperttunen@nvidia.com X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As a preparation for each context potentially being able to have a separate hardware channel, and thus requiring a separate syncpoint, move syncpoints to be stored inside each context instead of global client data. Signed-off-by: Mikko Perttunen --- drivers/gpu/drm/tegra/drm.c | 8 ++++---- drivers/gpu/drm/tegra/drm.h | 1 + drivers/gpu/drm/tegra/gr2d.c | 2 ++ drivers/gpu/drm/tegra/gr3d.c | 2 ++ drivers/gpu/drm/tegra/vic.c | 2 ++ 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index 3e2a4a19412e..b964e18e3058 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -783,12 +783,12 @@ static int tegra_get_syncpt(struct drm_device *drm, void *data, goto unlock; } - if (args->index >= context->client->base.num_syncpts) { + if (args->index >= 1) { err = -EINVAL; goto unlock; } - syncpt = context->client->base.syncpts[args->index]; + syncpt = context->syncpt; args->id = host1x_syncpt_id(syncpt); unlock: @@ -837,12 +837,12 @@ static int tegra_get_syncpt_base(struct drm_device *drm, void *data, goto unlock; } - if (args->syncpt >= context->client->base.num_syncpts) { + if (args->syncpt >= 1) { err = -EINVAL; goto unlock; } - syncpt = context->client->base.syncpts[args->syncpt]; + syncpt = context->syncpt; base = host1x_syncpt_get_base(syncpt); if (!base) { diff --git a/drivers/gpu/drm/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h index 079aebb3fb38..11d690846fd0 100644 --- a/drivers/gpu/drm/tegra/drm.h +++ b/drivers/gpu/drm/tegra/drm.h @@ -79,6 +79,7 @@ struct tegra_drm_context { struct tegra_drm_client *client; struct host1x_channel *channel; + struct host1x_syncpt *syncpt; unsigned int id; }; diff --git a/drivers/gpu/drm/tegra/gr2d.c b/drivers/gpu/drm/tegra/gr2d.c index 6ea070da7718..3db3bcac48b9 100644 --- a/drivers/gpu/drm/tegra/gr2d.c +++ b/drivers/gpu/drm/tegra/gr2d.c @@ -76,6 +76,8 @@ static int gr2d_open_channel(struct tegra_drm_client *client, if (!context->channel) return -ENOMEM; + context->syncpt = client->base.syncpts[0]; + return 0; } diff --git a/drivers/gpu/drm/tegra/gr3d.c b/drivers/gpu/drm/tegra/gr3d.c index cee2ab645cde..279438342c8c 100644 --- a/drivers/gpu/drm/tegra/gr3d.c +++ b/drivers/gpu/drm/tegra/gr3d.c @@ -86,6 +86,8 @@ static int gr3d_open_channel(struct tegra_drm_client *client, if (!context->channel) return -ENOMEM; + context->syncpt = client->base.syncpts[0]; + return 0; } diff --git a/drivers/gpu/drm/tegra/vic.c b/drivers/gpu/drm/tegra/vic.c index 6697a21a250d..efe5f3af933e 100644 --- a/drivers/gpu/drm/tegra/vic.c +++ b/drivers/gpu/drm/tegra/vic.c @@ -240,6 +240,8 @@ static int vic_open_channel(struct tegra_drm_client *client, return -ENOMEM; } + context->syncpt = client->base.syncpts[0]; + return 0; } -- 2.14.2 From 1583210830922009922@xxx Sun Nov 05 07:38:26 +0000 2017 X-GM-THRID: 1582946571328910726 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread