Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751609AbdHSMC6 (ORCPT ); Sat, 19 Aug 2017 08:02:58 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:37820 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750999AbdHSMC4 (ORCPT ); Sat, 19 Aug 2017 08:02:56 -0400 Subject: Re: [PATCH 1/4] gpu: host1x: Enable Tegra186 syncpoint protection To: Mikko Perttunen , thierry.reding@gmail.com, jonathanh@nvidia.com Cc: dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org References: <20170818161553.27597-1-mperttunen@nvidia.com> <20170818161553.27597-2-mperttunen@nvidia.com> From: Dmitry Osipenko Message-ID: <3818913a-ec8f-f939-a71c-6f7b9ccd4be8@gmail.com> Date: Sat, 19 Aug 2017 15:02:53 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20170818161553.27597-2-mperttunen@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1422 Lines: 41 On 18.08.2017 19:15, Mikko Perttunen wrote: > Since Tegra186 the Host1x hardware allows syncpoints to be assigned to > specific channels, preventing any other channels from incrementing > them. > > Enable this feature where available and assign syncpoints to channels > when submitting a job. Syncpoints are currently never unassigned from > channels since that would require extra work and is unnecessary with > the current channel allocation model. > > Signed-off-by: Mikko Perttunen > --- [snip] > diff --git a/drivers/gpu/host1x/syncpt.c b/drivers/gpu/host1x/syncpt.c > index 048ac9e344ce..fe4d963b3e2a 100644 > --- a/drivers/gpu/host1x/syncpt.c > +++ b/drivers/gpu/host1x/syncpt.c > @@ -398,6 +398,8 @@ int host1x_syncpt_init(struct host1x *host) > for (i = 0; i < host->info->nb_pts; i++) { > syncpt[i].id = i; > syncpt[i].host = host; > + > + host1x_hw_syncpt_assign_channel(host, &syncpt[i], NULL); > } What about to factor out that assignment and add a comment, something like this: /* clear syncpoint-channel assignments on Tegra186+ */ for (i = 0; i < host->info->nb_pts; i++) host1x_hw_syncpt_assign_channel(host, &syncpt[i], NULL); And maybe even add an inline function for clarity, like: static inline void host1x_hw_syncpt_deassign_channel(struct host1x *host, struct host1x_syncpt *sp) { return host->syncpt_op->assign_channel(sp, NULL); } -- Dmitry