[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241002103809.26d34ee0@collabora.com>
Date: Wed, 2 Oct 2024 10:38:09 +0200
From: Boris Brezillon <boris.brezillon@...labora.com>
To: Adrián Larumbe <adrian.larumbe@...labora.com>
Cc: Steven Price <steven.price@....com>, Liviu Dudau <liviu.dudau@....com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, Maxime Ripard
<mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>, David Airlie
<airlied@...il.com>, Simona Vetter <simona@...ll.ch>, Sumit Semwal
<sumit.semwal@...aro.org>, Christian König
<christian.koenig@....com>, kernel@...labora.com,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
linux-media@...r.kernel.org, linaro-mm-sig@...ts.linaro.org
Subject: Re: [PATCH v8 1/5] drm/panthor: introduce job cycle and timestamp
accounting
On Tue, 24 Sep 2024 00:06:21 +0100
Adrián Larumbe <adrian.larumbe@...labora.com> wrote:
> +static u32 calc_profiling_ringbuf_num_slots(struct panthor_device *ptdev,
> + u32 cs_ringbuf_size)
> +{
> + u32 min_profiled_job_instrs = U32_MAX;
> + u32 last_flag = fls(PANTHOR_DEVICE_PROFILING_ALL);
> +
> + /*
> + * We want to calculate the minimum size of a profiled job's CS,
> + * because since they need additional instructions for the sampling
> + * of performance metrics, they might take up further slots in
> + * the queue's ringbuffer. This means we might not need as many job
> + * slots for keeping track of their profiling information. What we
> + * need is the maximum number of slots we should allocate to this end,
> + * which matches the maximum number of profiled jobs we can place
> + * simultaneously in the queue's ring buffer.
> + * That has to be calculated separately for every single job profiling
> + * flag, but not in the case job profiling is disabled, since unprofiled
> + * jobs don't need to keep track of this at all.
> + */
> + for (u32 i = 0; i < last_flag; i++) {
> + if (BIT(i) & PANTHOR_DEVICE_PROFILING_ALL)
I'll get rid of this check when applying, as suggested by Steve. Steve,
with this modification do you want me to add your R-b?
BTW, I've also fixed a bunch of checkpatch errors/warnings, so you
might want to run checkpatch --strict next time.
> + min_profiled_job_instrs =
> + min(min_profiled_job_instrs, calc_job_credits(BIT(i)));
> + }
> +
> + return DIV_ROUND_UP(cs_ringbuf_size, min_profiled_job_instrs * sizeof(u64));
> +}
Powered by blists - more mailing lists