From patchwork Thu May 17 15:34:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 10407003 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 7D83E60155 for ; Thu, 17 May 2018 15:34:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C8182818E for ; Thu, 17 May 2018 15:34:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 611EF2857E; Thu, 17 May 2018 15:34:57 +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=-5.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 02B352818E for ; Thu, 17 May 2018 15:34:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 181026EA9F; Thu, 17 May 2018 15:34:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id F21CB6E99C for ; Thu, 17 May 2018 15:34:41 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id f8-v6so9921011wmc.4 for ; Thu, 17 May 2018 08:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=opmyHI7QiN8+La1a5kZvZjZ80Fg7Iq+ULm1C7sP+BWU=; b=ridUF0mdE7GLugc5/sr09Z4yhU1TjHrIrtFqAeMu1AaQhOHlLAZs5lqbIxMvoxg110 3zJmivPAbeiE5JBKlfiJBup19n0dpDqLFdCARvvGDFFE2j7N7VMfQK3DOU01CEha53j1 ng9m2Si/DTtjBBH/oqbk9TOP+XG4Mb4rDXHBoEFYGHTBZ7/NrMN7IipfdjCLTXT3ul4m yjdjsU7FODjep6JmT1m6bFKWekktfCBKNZbAhVOkhjev6IznJztY0R0mLuVeoGX/h6vB /yJIxxMpTaUX2nr3y5MGMcpRSAgtx8WIFMPFYzbuKYSVRtvDECKbx6PFRLRdSbUunJ4c +bbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=opmyHI7QiN8+La1a5kZvZjZ80Fg7Iq+ULm1C7sP+BWU=; b=VnUvY3le4Dpd/tRq1avNWA7U4+iB7Xv/ArvG7+fZhmUyJ06VTslAQo7XwnmdfNmTuz 0YzPjM0Ril6LxtXENfTsb3cq27LBwnlRq8Q9ta/bdu1KbCHkra1RD16zy/7BdFf9sEOc 8Bz7SCS2M1YOpRAo9jsmss7oNxNCktchmSCi20n9LdD0NiCFv1Ou47LI49/FnSny+XCv 7lWHSICa0gb0HM2Pgh/F/QGlmdaKwRQgXLhMG9GJVp9Kn1O11bCWOuQo8KkgimTe+tJY vv1jwmBYj6A1FDOKya/B5wNvrC1jK+J47jIVXY5vWUIzejLexhSjBijs6713gstWOODd 22SQ== X-Gm-Message-State: ALKqPwcO/PChaTe17Lq9RNf3vQTDqpkpKEAvtGv5cEEfd6A/x9TyhLiC 2p+dz/HzUOajwNyVKW0qDxnSnA== X-Google-Smtp-Source: AB8JxZpObwt2yHVTaB5tXzZI2Acv+8Tik3OdFUn6HV1QVdZCrR1tpcCjIypIgWtweSnoaHj0vRphvw== X-Received: by 2002:a1c:d755:: with SMTP id o82-v6mr1954390wmg.71.1526571280561; Thu, 17 May 2018 08:34:40 -0700 (PDT) Received: from localhost (p200300E41F19FC00D958180F3872A5C5.dip0.t-ipconnect.de. [2003:e4:1f19:fc00:d958:180f:3872:a5c5]) by smtp.gmail.com with ESMTPSA id b133-v6sm5557130wmh.12.2018.05.17.08.34.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 May 2018 08:34:39 -0700 (PDT) From: Thierry Reding To: Thierry Reding Subject: [PATCH 4/7] gpu: host1x: Drop unnecessary host1x argument Date: Thu, 17 May 2018 17:34:27 +0200 Message-Id: <20180517153430.9602-5-thierry.reding@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180517153430.9602-1-thierry.reding@gmail.com> References: <20180517153430.9602-1-thierry.reding@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, Dmitry Osipenko , dri-devel@lists.freedesktop.org, Mikko Perttunen MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding Functions taking a pointer to a host1x syncpoint as an argument don't need to specify a pointer to a host1x instance because it can be obtained from the syncpoint. Signed-off-by: Thierry Reding Reviewed-by: Dmitry Osipenko Tested-by: Dmitry Osipenko --- drivers/gpu/host1x/hw/channel_hw.c | 2 +- drivers/gpu/host1x/intr.c | 14 ++++++-------- drivers/gpu/host1x/intr.h | 8 +++++--- drivers/gpu/host1x/syncpt.c | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/host1x/hw/channel_hw.c b/drivers/gpu/host1x/hw/channel_hw.c index 4c9555038a95..d188f9068b91 100644 --- a/drivers/gpu/host1x/hw/channel_hw.c +++ b/drivers/gpu/host1x/hw/channel_hw.c @@ -164,7 +164,7 @@ static int channel_submit(struct host1x_job *job) trace_host1x_channel_submitted(dev_name(ch->dev), prev_max, syncval); /* schedule a submit complete interrupt */ - err = host1x_intr_add_action(host, job->syncpt_id, syncval, + err = host1x_intr_add_action(host, sp, syncval, HOST1X_INTR_ACTION_SUBMIT_COMPLETE, ch, completed_waiter, NULL); completed_waiter = NULL; diff --git a/drivers/gpu/host1x/intr.c b/drivers/gpu/host1x/intr.c index 6028cf7b681f..9629c009d10f 100644 --- a/drivers/gpu/host1x/intr.c +++ b/drivers/gpu/host1x/intr.c @@ -211,11 +211,11 @@ static void syncpt_thresh_work(struct work_struct *work) host1x_syncpt_load(host->syncpt + id)); } -int host1x_intr_add_action(struct host1x *host, unsigned int id, u32 thresh, - enum host1x_intr_action action, void *data, - struct host1x_waitlist *waiter, void **ref) +int host1x_intr_add_action(struct host1x *host, struct host1x_syncpt *syncpt, + u32 thresh, enum host1x_intr_action action, + void *data, struct host1x_waitlist *waiter, + void **ref) { - struct host1x_syncpt *syncpt; int queue_was_empty; if (waiter == NULL) { @@ -234,19 +234,17 @@ int host1x_intr_add_action(struct host1x *host, unsigned int id, u32 thresh, waiter->data = data; waiter->count = 1; - syncpt = host->syncpt + id; - spin_lock(&syncpt->intr.lock); queue_was_empty = list_empty(&syncpt->intr.wait_head); if (add_waiter_to_queue(waiter, &syncpt->intr.wait_head)) { /* added at head of list - new threshold value */ - host1x_hw_intr_set_syncpt_threshold(host, id, thresh); + host1x_hw_intr_set_syncpt_threshold(host, syncpt->id, thresh); /* added as first waiter - enable interrupt */ if (queue_was_empty) - host1x_hw_intr_enable_syncpt_intr(host, id); + host1x_hw_intr_enable_syncpt_intr(host, syncpt->id); } spin_unlock(&syncpt->intr.lock); diff --git a/drivers/gpu/host1x/intr.h b/drivers/gpu/host1x/intr.h index 1370c2bb75b8..6db96af484fe 100644 --- a/drivers/gpu/host1x/intr.h +++ b/drivers/gpu/host1x/intr.h @@ -22,6 +22,7 @@ #include #include +struct host1x_syncpt; struct host1x; enum host1x_intr_action { @@ -75,9 +76,10 @@ struct host1x_waitlist { * * This is a non-blocking api. */ -int host1x_intr_add_action(struct host1x *host, unsigned int id, u32 thresh, - enum host1x_intr_action action, void *data, - struct host1x_waitlist *waiter, void **ref); +int host1x_intr_add_action(struct host1x *host, struct host1x_syncpt *syncpt, + u32 thresh, enum host1x_intr_action action, + void *data, struct host1x_waitlist *waiter, + void **ref); /* * Unreference an action submitted to host1x_intr_add_action(). diff --git a/drivers/gpu/host1x/syncpt.c b/drivers/gpu/host1x/syncpt.c index 088c05dd884c..a5dbf1ba4645 100644 --- a/drivers/gpu/host1x/syncpt.c +++ b/drivers/gpu/host1x/syncpt.c @@ -255,7 +255,7 @@ int host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout, } /* schedule a wakeup when the syncpoint value is reached */ - err = host1x_intr_add_action(sp->host, sp->id, thresh, + err = host1x_intr_add_action(sp->host, sp, thresh, HOST1X_INTR_ACTION_WAKEUP_INTERRUPTIBLE, &wq, waiter, &ref); if (err)