From: Boris Brezillon <boris.brezillon@collabora.com>
To: "Adrián Larumbe" <adrian.larumbe@collabora.com>
Cc: "Steven Price" <steven.price@arm.com>,
"Liviu Dudau" <liviu.dudau@arm.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Christian König" <christian.koenig@amd.com>,
kernel@collabora.com, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
linaro-mm-sig@lists.linaro.org
Subject: Re: [PATCH v8 3/5] drm/panthor: add DRM fdinfo support
Date: Wed, 2 Oct 2024 10:40:06 +0200 [thread overview]
Message-ID: <20241002104006.5e2f744b@collabora.com> (raw)
In-Reply-To: <20240923230912.2207320-4-adrian.larumbe@collabora.com>
On Tue, 24 Sep 2024 00:06:23 +0100
Adrián Larumbe <adrian.larumbe@collabora.com> wrote:
> +static void update_fdinfo_stats(struct panthor_job *job)
> +{
> + struct panthor_group *group = job->group;
> + struct panthor_queue *queue = group->queues[job->queue_idx];
> + struct panthor_gpu_usage *fdinfo = &group->fdinfo.data;
> + struct panthor_job_profiling_data *times;
> +
> + times = (struct panthor_job_profiling_data *)
> + ((unsigned long) queue->profiling.slots->kmap +
> + (job->profiling.slot * sizeof(struct panthor_job_profiling_data)));
The casting done here is a bit of a mess, so I replaced it by:
struct panthor_job_profiling_data *slots = queue->profiling.slots->kmap;
struct panthor_job_profiling_data *data = &slots[job->profiling.slot];
> +
> + mutex_lock(&group->fdinfo.lock);
> + if (job->profiling.mask & PANTHOR_DEVICE_PROFILING_CYCLES)
> + fdinfo->cycles += times->cycles.after - times->cycles.before;
> + if (job->profiling.mask & PANTHOR_DEVICE_PROFILING_TIMESTAMP)
> + fdinfo->time += times->time.after - times->time.before;
> + mutex_unlock(&group->fdinfo.lock);
> +}
next prev parent reply other threads:[~2024-10-02 8:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-23 23:06 [PATCH v8 0/5] Support fdinfo runtime and memory stats on Panthor Adrián Larumbe
2024-09-23 23:06 ` [PATCH v8 1/5] drm/panthor: introduce job cycle and timestamp accounting Adrián Larumbe
2024-10-02 8:38 ` Boris Brezillon
2024-10-02 8:54 ` Steven Price
2024-09-23 23:06 ` [PATCH v8 2/5] drm/panthor: record current and maximum device clock frequencies Adrián Larumbe
2024-09-23 23:06 ` [PATCH v8 3/5] drm/panthor: add DRM fdinfo support Adrián Larumbe
2024-09-29 0:25 ` kernel test robot
2024-10-02 8:14 ` Boris Brezillon
2024-10-02 8:40 ` Boris Brezillon [this message]
2024-09-23 23:06 ` [PATCH v8 4/5] drm/panthor: enable fdinfo for memory stats Adrián Larumbe
2024-09-23 23:06 ` [PATCH v8 5/5] drm/panthor: add sysfs knob for enabling job profiling Adrián Larumbe
2024-10-02 8:57 ` [PATCH v8 0/5] Support fdinfo runtime and memory stats on Panthor Boris Brezillon
2024-10-02 9:26 ` Jani Nikula
2024-10-02 9:58 ` Boris Brezillon
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=20241002104006.5e2f744b@collabora.com \
--to=boris.brezillon@collabora.com \
--cc=adrian.larumbe@collabora.com \
--cc=airlied@gmail.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@collabora.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=steven.price@arm.com \
--cc=sumit.semwal@linaro.org \
--cc=tzimmermann@suse.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.