From: Raag Jadav <raag.jadav@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: intel-xe@lists.freedesktop.org,
Stuart Summers <stuart.summers@intel.com>,
Matt Roper <matthew.d.roper@intel.com>,
Riana Tauro <riana.tauro@intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>,
Tvrtko Ursulin <tursulin@ursulin.net>
Subject: Re: [PATCH v4 4/6] drm/xe/configfs: Allow to select by class only
Date: Fri, 12 Sep 2025 07:58:44 +0200 [thread overview]
Message-ID: <aMO2lGS2ldLZ6945@black.igk.intel.com> (raw)
In-Reply-To: <dc5frrvi2wi6fbfd3mggumu3ohlbjohbifrxil4fzsy7pqxa75@zaofnmz5tea5>
On Fri, Sep 12, 2025 at 12:30:03AM -0500, Lucas De Marchi wrote:
> On Fri, Sep 12, 2025 at 07:18:37AM +0200, Raag Jadav wrote:
> > On Thu, Sep 11, 2025 at 12:36:28PM -0700, Lucas De Marchi wrote:
> > > For a future configfs attribute, it's desirable to select by engine mask
> > > only as the instance doesn't make sense.
> > >
> > > Rename the function lookup_engine_mask() to lookup_engine_info() and
> > > make it return the entry. This allows parse_engine() to still return an
> > > item if the caller wants to allow parsing a class-only string like
> > > "rcs", "bcs", "ccs", etc.
> > >
> > > Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> > > Reviewed-by: Raag Jadav <raag.jadav@intel.com>
> > > ---
> > > v2:
> > > - Rename function to lookup_engine_info() and return the entry
> > > directly instead of the index (Raag Jadav)
> > > - Add named initializer for new entry for consistency (Raag Jadav)
> > > ---
> > > drivers/gpu/drm/xe/xe_configfs.c | 50 ++++++++++++++++++++++++++++------------
> > > 1 file changed, 35 insertions(+), 15 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/xe/xe_configfs.c b/drivers/gpu/drm/xe/xe_configfs.c
> > > index 8db7a2af11011..45fdb6cf26b5d 100644
> > > --- a/drivers/gpu/drm/xe/xe_configfs.c
> > > +++ b/drivers/gpu/drm/xe/xe_configfs.c
> > > @@ -152,6 +152,7 @@ static void set_device_defaults(struct xe_config_device *config)
> > > struct engine_info {
> > > const char *cls;
> > > u64 mask;
> > > + enum xe_engine_class engine_class;
> > > };
> > >
> > > /* Some helpful macros to aid on the sizing of buffer allocation when parsing */
> > > @@ -159,12 +160,12 @@ struct engine_info {
> > > #define MAX_ENGINE_INSTANCE_CHARS 2
> > >
> > > static const struct engine_info engine_info[] = {
> > > - { .cls = "rcs", .mask = XE_HW_ENGINE_RCS_MASK },
> > > - { .cls = "bcs", .mask = XE_HW_ENGINE_BCS_MASK },
> > > - { .cls = "vcs", .mask = XE_HW_ENGINE_VCS_MASK },
> > > - { .cls = "vecs", .mask = XE_HW_ENGINE_VECS_MASK },
> > > - { .cls = "ccs", .mask = XE_HW_ENGINE_CCS_MASK },
> > > - { .cls = "gsccs", .mask = XE_HW_ENGINE_GSCCS_MASK },
> > > + { .cls = "rcs", .mask = XE_HW_ENGINE_RCS_MASK, .engine_class = XE_ENGINE_CLASS_RENDER },
> > > + { .cls = "bcs", .mask = XE_HW_ENGINE_BCS_MASK, .engine_class = XE_ENGINE_CLASS_COPY },
> > > + { .cls = "vcs", .mask = XE_HW_ENGINE_VCS_MASK, .engine_class = XE_ENGINE_CLASS_VIDEO_DECODE },
> > > + { .cls = "vecs", .mask = XE_HW_ENGINE_VECS_MASK, .engine_class = XE_ENGINE_CLASS_VIDEO_ENHANCE },
> >
> > Hmm, so now checkpatch doesn't feel so good about this.
> > I usually try to shorten the variable/macro names instead of wrapping,
> > but I guess a few more lines in an already huge driver wouldn't be much
> > noticeable ;)
>
> it's a table and wrapping the line doesn't really improve readability.
> In this case we should taked checkpatch output with a grain of salt
Ofcourse. I had the same understanding, but I've always managed to find
myself coming across random DRM rules :D
Raag
next prev parent reply other threads:[~2025-09-12 5:58 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-11 19:36 [PATCH v4 0/6] drm/xe: Add user commands to WA BB via configfs Lucas De Marchi
2025-09-11 19:36 ` [PATCH v4 1/6] drm/xe: Update workaround documentation Lucas De Marchi
2025-09-11 19:36 ` [PATCH v4 2/6] drm/xe/configfs: Fix documentation warning Lucas De Marchi
2025-09-11 19:36 ` [PATCH v4 3/6] drm/xe/configfs: Extract function to parse engine Lucas De Marchi
2025-09-11 19:36 ` [PATCH v4 4/6] drm/xe/configfs: Allow to select by class only Lucas De Marchi
2025-09-12 5:18 ` Raag Jadav
2025-09-12 5:30 ` Lucas De Marchi
2025-09-12 5:58 ` Raag Jadav [this message]
2025-09-11 19:36 ` [PATCH v4 5/6] drm/xe/lrc: Allow to add user commands on context switch Lucas De Marchi
2025-09-16 20:27 ` Rodrigo Vivi
2025-09-16 21:07 ` Lucas De Marchi
2025-09-16 21:16 ` Rodrigo Vivi
2025-09-16 21:19 ` Lucas De Marchi
2025-09-11 19:36 ` [PATCH v4 6/6] drm/xe/configfs: Add post context restore bb Lucas De Marchi
2025-09-12 8:05 ` Raag Jadav
2025-09-12 14:07 ` Lucas De Marchi
2025-09-12 16:56 ` Raag Jadav
2025-09-11 20:19 ` ✗ CI.checkpatch: warning for drm/xe: Add user commands to WA BB via configfs Patchwork
2025-09-11 20:20 ` ✓ CI.KUnit: success " Patchwork
2025-09-11 21:06 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-12 3:16 ` ✗ Xe.CI.Full: failure " Patchwork
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=aMO2lGS2ldLZ6945@black.igk.intel.com \
--to=raag.jadav@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=matthew.d.roper@intel.com \
--cc=riana.tauro@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=stuart.summers@intel.com \
--cc=tursulin@ursulin.net \
--cc=umesh.nerlige.ramappa@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