[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221209154843.4162814-4-andrzej.hajda@intel.com>
Date: Fri, 9 Dec 2022 16:48:42 +0100
From: Andrzej Hajda <andrzej.hajda@...el.com>
To: linux-kernel@...r.kernel.org, intel-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org
Cc: Andrzej Hajda <andrzej.hajda@...el.com>,
Jani Nikula <jani.nikula@...ux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>,
Andi Shyti <andi.shyti@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Arnd Bergmann <arnd@...db.de>
Subject: [PATCH 4/5] drm/i915/gvt: kill fetch_and_zero usage
Better use recently introduced kernel core helper.
Signed-off-by: Andrzej Hajda <andrzej.hajda@...el.com>
---
drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +-
drivers/gpu/drm/i915/gvt/scheduler.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
index 077892a9aa8fdc..061302abb0a189 100644
--- a/drivers/gpu/drm/i915/gvt/kvmgt.c
+++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
@@ -1831,7 +1831,7 @@ static int init_service_thread(struct intel_gvt *gvt)
*/
static void intel_gvt_clean_device(struct drm_i915_private *i915)
{
- struct intel_gvt *gvt = fetch_and_zero(&i915->gvt);
+ struct intel_gvt *gvt = exchange(&i915->gvt, NULL);
if (drm_WARN_ON(&i915->drm, !gvt))
return;
diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c
index 9cd8fcbf7cad16..6699135f366f3f 100644
--- a/drivers/gpu/drm/i915/gvt/scheduler.c
+++ b/drivers/gpu/drm/i915/gvt/scheduler.c
@@ -826,7 +826,7 @@ static int dispatch_workload(struct intel_vgpu_workload *workload)
/* We might still need to add request with
* clean ctx to retire it properly..
*/
- rq = fetch_and_zero(&workload->req);
+ rq = exchange(&workload->req, NULL);
i915_request_put(rq);
}
@@ -1103,7 +1103,7 @@ static void complete_current_workload(struct intel_gvt *gvt, int ring_id)
intel_vgpu_trigger_virtual_event(vgpu, event);
}
- i915_request_put(fetch_and_zero(&workload->req));
+ i915_request_put(exchange(&workload->req, 0));
}
gvt_dbg_sched("ring id %d complete workload %p status %d\n",
--
2.34.1
Powered by blists - more mailing lists