Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1922642pxb; Sat, 23 Jan 2021 09:58:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwF1gKhWLaS88FGDOEyOWlwbsc+Qhm4gL5ZmZUwsjmbpo2dsfumjl5LLAqdaDI1UqE4ydPU X-Received: by 2002:aa7:db96:: with SMTP id u22mr1239743edt.57.1611424739107; Sat, 23 Jan 2021 09:58:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611424739; cv=none; d=google.com; s=arc-20160816; b=uPmul7yZZWvp/6N49SaL0U9o2RSpXCsjjaWtOVrB0dITJV0qqP+gnF2V+QKPjOQd+/ 6bZqy3ULe8mSU1oyOnabZPftzcdcK9sGfzuXNDNOpKu+A0r/E6Kfe90czR8wr+fFNyYO zUKBD2+vscLllnEEBPq9hBGT1cbzyIJd+o+Dp+supR/qvilJTiTploWkOCjbreVuDlDV qXgL7TdSbOAI3zxb1P/iozAdaMWV+zximjg2k9DMVKfaknw7E/o54DzYFibhAgxkVM78 8jGBAPTSHibjhrlnTTMipzYFqCfgvD8qnmfaigQdLSwBBcb3mGhCWmV71ud6rzi4Lhu4 6WOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=ij8616FxgPL0g+EkHhBWQEtOFDxuaD1ectYgMChxWv8=; b=H1iwf/uJM5w/xXl6FYN81NvQ1ki8t1Dr0sQ9K09/2wc7Jqxpz4VDztSOlKCAhEdtZc cHgE28jXdjKJ05OdeIMqnKVkCcO64vZkkRkKSE77dO7N3yUy+PLBgAuMFLlN4fzUMrSZ M2FuaVdHykeA9vQgwGnXCd6E6du1dmQ4/CSGO97zeYszPDaLOpTN/wa0rghu05dNpe5M WxZcNsfn6YNA4Xw5ZT54Vs9PiX/zhs+eKD6ht2oYCNBXF4mqQuUWDX2CYkwwPR22MFLZ tU/D+g1UJnNn3yrhmGnZPGwuwXJ1p6EzFjQ60+DCnJw3DIK7cPSCgl8VheV/GyttYgvK RKwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IYvk8JYf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v1si5045493edt.548.2021.01.23.09.58.35; Sat, 23 Jan 2021 09:58:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IYvk8JYf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726210AbhAWR4K (ORCPT + 99 others); Sat, 23 Jan 2021 12:56:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726057AbhAWR4H (ORCPT ); Sat, 23 Jan 2021 12:56:07 -0500 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A2A2C06174A for ; Sat, 23 Jan 2021 09:55:27 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id r12so12178885ejb.9 for ; Sat, 23 Jan 2021 09:55:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ij8616FxgPL0g+EkHhBWQEtOFDxuaD1ectYgMChxWv8=; b=IYvk8JYfAiIZsz1p5pnAZJvCu20jExS7U36BT8xniNQS+M6g9nH5cvlrrDOFUxwjqQ TI2/Bzh1CoLRp6E2RWngCEkd93s+2uMFMBzm0pK33Yd2CtjTi2eH1dB2Lkw8nAn4t7jQ y9iXU0ajvp/gO8Wz0pPMEACKzmBsRHrutpZ589R2IYiQSb8N3uBA5FDoJq8xUT3fVqMR FBTUiXF4OsiXlleCRgq498rqH/di1Oe3/QhRY3x5p3G7HMqG6rqxDBU70LhbGPdS6NRm tuV8BUXpGlzcgAzGhI/T2fEfQEu7R0+CniZJThOr1ZKqFaef9/R0MuEkm2gRKt1YcUIj 315g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=ij8616FxgPL0g+EkHhBWQEtOFDxuaD1ectYgMChxWv8=; b=hyQ8AACv5mUP7US6Qu4HnWEwkUdPXwm1ClYqP0WGh3UrH4STGTED2EWq/k/WxBgFHJ e4CjE++4ICfMnL6b3UMonxsjly0BufacRYcKQBsMXgKl5J846I7r4jNlIVfXmlGjeIdS wtVl6lq8dCt9KsOLOpmwAbD/hWaYa9dMXZDP4fzypV+0QvNNtMHdIWfdWFmyOjkRyH4T eWmxyv3VtIBReTErvKoygV3fdRIflylMI0JNmEgS8wCgA7Z0WPLyXYoUuPoQZbsrDK4x wTgTZxtuVjSZE9hh0jZESZ5KJHD63tEPGd3olZ2be1dEHEVod0p5PboF4KnaVBe+EiVG VXiQ== X-Gm-Message-State: AOAM533kIRYfw/dC5dNMSxC4tu90nCWiE6T3WkNRaOeuFa+8et14Zb97 puUdSAQBLop3UwJMGEpLA/E= X-Received: by 2002:a17:906:589:: with SMTP id 9mr2152961ejn.229.1611424525856; Sat, 23 Jan 2021 09:55:25 -0800 (PST) Received: from stitch.. ([2a01:4262:1ab:c:de4:866f:76c3:151d]) by smtp.gmail.com with ESMTPSA id j23sm7533690edv.45.2021.01.23.09.55.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jan 2021 09:55:25 -0800 (PST) Sender: Emil Renner Berthing From: Emil Renner Berthing To: intel-gfx@lists.freedesktop.org Cc: Emil Renner Berthing , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Chris Wilson , Tvrtko Ursulin , Mika Kuoppala , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/i915/gt: use new tasklet API for execution list Date: Sat, 23 Jan 2021 18:55:02 +0100 Message-Id: <20210123175502.6154-1-esmil@mailme.dk> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Emil Renner Berthing This converts the driver to use the new tasklet API introduced in commit 12cc923f1ccc ("tasklet: Introduce new initialization API") Signed-off-by: Emil Renner Berthing --- Tested on my Dell XPS 13 9300. drivers/gpu/drm/i915/gt/intel_engine_cs.c | 4 +-- drivers/gpu/drm/i915/gt/intel_lrc.c | 27 +++++++++---------- drivers/gpu/drm/i915/gt/selftest_lrc.c | 4 +-- .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 6 ++--- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c index 0b31670343f5..a97a80ca0ba7 100644 --- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c +++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c @@ -1193,7 +1193,7 @@ void intel_engine_flush_submission(struct intel_engine_cs *engine) { struct tasklet_struct *t = &engine->execlists.tasklet; - if (!t->func) + if (!t->callback) return; /* Synchronise and wait for the tasklet on another CPU */ @@ -1204,7 +1204,7 @@ void intel_engine_flush_submission(struct intel_engine_cs *engine) if (tasklet_trylock(t)) { /* Must wait for any GPU reset in progress. */ if (__tasklet_is_enabled(t)) - t->func(t->data); + t->callback(t); tasklet_unlock(t); } local_bh_enable(); diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c index 26c7d0a50585..20aa0ec09507 100644 --- a/drivers/gpu/drm/i915/gt/intel_lrc.c +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c @@ -3194,9 +3194,9 @@ static bool preempt_timeout(const struct intel_engine_cs *const engine) * Check the unread Context Status Buffers and manage the submission of new * contexts to the ELSP accordingly. */ -static void execlists_submission_tasklet(unsigned long data) +static void execlists_submission_tasklet(struct tasklet_struct *t) { - struct intel_engine_cs * const engine = (struct intel_engine_cs *)data; + struct intel_engine_cs * const engine = from_tasklet(engine, t, execlists.tasklet); bool timeout = preempt_timeout(engine); process_csb(engine); @@ -4401,9 +4401,9 @@ static void execlists_reset_rewind(struct intel_engine_cs *engine, bool stalled) spin_unlock_irqrestore(&engine->active.lock, flags); } -static void nop_submission_tasklet(unsigned long data) +static void nop_submission_tasklet(struct tasklet_struct *t) { - struct intel_engine_cs * const engine = (struct intel_engine_cs *)data; + struct intel_engine_cs * const engine = from_tasklet(engine, t, execlists.tasklet); /* The driver is wedged; don't process any more events. */ WRITE_ONCE(engine->execlists.queue_priority_hint, INT_MIN); @@ -4487,7 +4487,7 @@ static void execlists_reset_cancel(struct intel_engine_cs *engine) execlists->queue = RB_ROOT_CACHED; GEM_BUG_ON(__tasklet_is_enabled(&execlists->tasklet)); - execlists->tasklet.func = nop_submission_tasklet; + execlists->tasklet.callback = nop_submission_tasklet; spin_unlock_irqrestore(&engine->active.lock, flags); } @@ -4503,7 +4503,7 @@ static void execlists_reset_finish(struct intel_engine_cs *engine) */ GEM_BUG_ON(!reset_in_progress(execlists)); if (!RB_EMPTY_ROOT(&execlists->queue.rb_root)) - execlists->tasklet.func(execlists->tasklet.data); + execlists->tasklet.callback(&execlists->tasklet); if (__tasklet_enable(&execlists->tasklet)) /* And kick in case we missed a new request submission. */ @@ -5093,7 +5093,7 @@ void intel_execlists_set_default_submission(struct intel_engine_cs *engine) { engine->submit_request = execlists_submit_request; engine->schedule = i915_schedule; - engine->execlists.tasklet.func = execlists_submission_tasklet; + engine->execlists.tasklet.callback = execlists_submission_tasklet; engine->reset.prepare = execlists_reset_prepare; engine->reset.rewind = execlists_reset_rewind; @@ -5220,8 +5220,7 @@ int intel_execlists_submission_setup(struct intel_engine_cs *engine) struct intel_uncore *uncore = engine->uncore; u32 base = engine->mmio_base; - tasklet_init(&engine->execlists.tasklet, - execlists_submission_tasklet, (unsigned long)engine); + tasklet_setup(&engine->execlists.tasklet, execlists_submission_tasklet); timer_setup(&engine->execlists.timer, execlists_timeslice, 0); timer_setup(&engine->execlists.preempt, execlists_preempt, 0); @@ -5670,9 +5669,9 @@ static intel_engine_mask_t virtual_submission_mask(struct virtual_engine *ve) return mask; } -static void virtual_submission_tasklet(unsigned long data) +static void virtual_submission_tasklet(struct tasklet_struct *t) { - struct virtual_engine * const ve = (struct virtual_engine *)data; + struct virtual_engine * const ve = from_tasklet(ve, t, base.execlists.tasklet); const int prio = READ_ONCE(ve->base.execlists.queue_priority_hint); intel_engine_mask_t mask; unsigned int n; @@ -5883,9 +5882,7 @@ intel_execlists_create_virtual(struct intel_engine_cs **siblings, INIT_LIST_HEAD(virtual_queue(ve)); ve->base.execlists.queue_priority_hint = INT_MIN; - tasklet_init(&ve->base.execlists.tasklet, - virtual_submission_tasklet, - (unsigned long)ve); + tasklet_setup(&ve->base.execlists.tasklet, virtual_submission_tasklet); intel_context_init(&ve->context, &ve->base); @@ -5913,7 +5910,7 @@ intel_execlists_create_virtual(struct intel_engine_cs **siblings, * layering if we handle cloning of the requests and * submitting a copy into each backend. */ - if (sibling->execlists.tasklet.func != + if (sibling->execlists.tasklet.callback != execlists_submission_tasklet) { err = -ENODEV; goto err_put; diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c index 95d41c01d0e0..8594ff72456e 100644 --- a/drivers/gpu/drm/i915/gt/selftest_lrc.c +++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c @@ -631,7 +631,7 @@ static int live_hold_reset(void *arg) } tasklet_disable(&engine->execlists.tasklet); - engine->execlists.tasklet.func(engine->execlists.tasklet.data); + engine->execlists.tasklet.callback(&engine->execlists.tasklet); GEM_BUG_ON(execlists_active(&engine->execlists) != rq); i915_request_get(rq); @@ -4577,7 +4577,7 @@ static int reset_virtual_engine(struct intel_gt *gt, } tasklet_disable(&engine->execlists.tasklet); - engine->execlists.tasklet.func(engine->execlists.tasklet.data); + engine->execlists.tasklet.callback(&engine->execlists.tasklet); GEM_BUG_ON(execlists_active(&engine->execlists) != rq); /* Fake a preemption event; failed of course */ diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c index fdfeb4b9b0f5..a52ce82f23e2 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c @@ -344,9 +344,9 @@ static void __guc_dequeue(struct intel_engine_cs *engine) execlists->active = execlists->inflight; } -static void guc_submission_tasklet(unsigned long data) +static void guc_submission_tasklet(struct tasklet_struct *t) { - struct intel_engine_cs * const engine = (struct intel_engine_cs *)data; + struct intel_engine_cs * const engine = from_tasklet(engine, t, execlists.tasklet); struct intel_engine_execlists * const execlists = &engine->execlists; struct i915_request **port, *rq; unsigned long flags; @@ -591,7 +591,7 @@ static void guc_set_default_submission(struct intel_engine_cs *engine) */ intel_execlists_set_default_submission(engine); - engine->execlists.tasklet.func = guc_submission_tasklet; + engine->execlists.tasklet.callback = guc_submission_tasklet; /* do not use execlists park/unpark */ engine->park = engine->unpark = NULL; -- 2.30.0