From: Deepak R Varma <drv@mailo.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Cc: Saurabh Singh Sengar <ssengar@microsoft.com>,
Praveen Kumar <kumarpraveen@linux.microsoft.com>,
Deepak R Varma <drv@mailo.com>
Subject: [PATCH v2 2/2] drm/i915/selftests: Convert atomic_* API calls for i915_active.count refcount_*
Date: Sun, 25 Dec 2022 13:18:05 +0530 [thread overview]
Message-ID: <1cce7ada5c91f81f9b3d6b2d68eb7fda4dd9fbf7.1671952191.git.drv@mailo.com> (raw)
In-Reply-To: <cover.1671952191.git.drv@mailo.com>
Handle the struct i915_active member variable count transition from
atomic_t type to refcount_t type for selftest use cases. Transition the
atomic_*() API calls to their equivalent refcount_*() API calls.
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Deepak R Varma <drv@mailo.com>
---
Please note:
1. Proposed changes are compile tested only.
2. This patch 2/2 is required to be applied after patch 1/2 due to
inter dependency.
Changes in v2:
1. Patch added to patch series.
2. Handle build issues Reported-by: kernel test robot <lkp@intel.com>
Include changes for i915/selftests use cases for atomic_* to refcount_*
transition.
drivers/gpu/drm/i915/selftests/i915_active.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/selftests/i915_active.c b/drivers/gpu/drm/i915/selftests/i915_active.c
index b61fe850e924..f1eca59e0180 100644
--- a/drivers/gpu/drm/i915/selftests/i915_active.c
+++ b/drivers/gpu/drm/i915/selftests/i915_active.c
@@ -125,9 +125,9 @@ __live_active_setup(struct drm_i915_private *i915)
pr_err("i915_active retired before submission!\n");
err = -EINVAL;
}
- if (atomic_read(&active->base.count) != count) {
+ if (refcount_read(&active->base.count) != count) {
pr_err("i915_active not tracking all requests, found %d, expected %d\n",
- atomic_read(&active->base.count), count);
+ refcount_read(&active->base.count), count);
err = -EINVAL;
}
@@ -279,7 +279,7 @@ static struct intel_engine_cs *node_to_barrier(struct active_node *it)
void i915_active_print(struct i915_active *ref, struct drm_printer *m)
{
drm_printf(m, "active %ps:%ps\n", ref->active, ref->retire);
- drm_printf(m, "\tcount: %d\n", atomic_read(&ref->count));
+ drm_printf(m, "\tcount: %d\n", refcount_read(&ref->count));
drm_printf(m, "\tpreallocated barriers? %s\n",
str_yes_no(!llist_empty(&ref->preallocated_barriers)));
@@ -324,7 +324,7 @@ static void active_flush(struct i915_active *ref,
spin_lock_irq(fence->lock);
__list_del_entry(&active->cb.node);
spin_unlock_irq(fence->lock); /* serialise with fence->cb_list */
- atomic_dec(&ref->count);
+ refcount_dec(&ref->count);
GEM_BUG_ON(!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags));
}
--
2.34.1
prev parent reply other threads:[~2022-12-25 7:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-25 7:45 [PATCH v2 0/2] convert i915_active.count from atomic_t to refcount_t Deepak R Varma
2022-12-25 7:47 ` [PATCH v2 1/2] drm/i915: " Deepak R Varma
2022-12-28 11:58 ` kernel test robot
2022-12-28 14:43 ` Praveen Kumar
2022-12-25 7:48 ` Deepak R Varma [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1cce7ada5c91f81f9b3d6b2d68eb7fda4dd9fbf7.1671952191.git.drv@mailo.com \
--to=drv@mailo.com \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=kumarpraveen@linux.microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rodrigo.vivi@intel.com \
--cc=ssengar@microsoft.com \
--cc=tvrtko.ursulin@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®