Re: [PATCH 13/13] drm/msm: Add PERFCNTR_CONFIG ioctl

From: Rob Clark

Date: Wed Apr 22 2026 - 10:22:34 EST


On Tue, Apr 21, 2026 at 8:41 PM Dmitry Baryshkov
<dmitry.baryshkov@xxxxxxxxxxxxxxxx> wrote:
>
> On Mon, Apr 20, 2026 at 03:25:35PM -0700, Rob Clark wrote:
> > Add new UABI and implementation of PERFCNTR_CONFIG ioctl.
> >
> > A bit more work is required to configure the pwrup_reglist for the GMU
> > to restore SELect regs on exist of IFPC, before we can stop disabling
> > IFPC while global counter collection. This will follow in a later
> > commit, but will be transparent to userspace.
> >
> > Signed-off-by: Rob Clark <robin.clark@xxxxxxxxxxxxxxxx>
> > ---
> > drivers/gpu/drm/msm/msm_drv.c | 1 +
> > drivers/gpu/drm/msm/msm_drv.h | 2 +
> > drivers/gpu/drm/msm/msm_perfcntr.c | 489 +++++++++++++++++++++++++++++
> > drivers/gpu/drm/msm/msm_perfcntr.h | 54 ++++
> > include/uapi/drm/msm_drm.h | 41 +++
> > 5 files changed, 587 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> > index 3066547f319b..0a7fc06113e0 100644
> > --- a/drivers/gpu/drm/msm/msm_drv.c
> > +++ b/drivers/gpu/drm/msm/msm_drv.c
> > @@ -801,6 +801,7 @@ static const struct drm_ioctl_desc msm_ioctls[] = {
> > DRM_IOCTL_DEF_DRV(MSM_SUBMITQUEUE_CLOSE, msm_ioctl_submitqueue_close, DRM_RENDER_ALLOW),
> > DRM_IOCTL_DEF_DRV(MSM_SUBMITQUEUE_QUERY, msm_ioctl_submitqueue_query, DRM_RENDER_ALLOW),
> > DRM_IOCTL_DEF_DRV(MSM_VM_BIND, msm_ioctl_vm_bind, DRM_RENDER_ALLOW),
> > + DRM_IOCTL_DEF_DRV(MSM_PERFCNTR_CONFIG, msm_ioctl_perfcntr_config, DRM_RENDER_ALLOW),
> > };
> >
> > static void msm_show_fdinfo(struct drm_printer *p, struct drm_file *file)
>
>
> Should we also increase MSM_VERSION_MINOR?

Generally I only bump minor for a change that can't
otherwise/reasonably be probed for. In this case, userspace can try
the new ioctl to see if it succeeds. And since it is only supported
on gens w/ perfcntr support, userspace would still need to probe even
if we bumped minor.

BR,
-R

> --
> With best wishes
> Dmitry