Re: [PATCH 03/10] drm/xe: Split out configfs data structures
Matt Roper <[email protected]>
| Newsgroups | org.freedesktop.lists.intel-xe |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Aug 20, 2026 at 09:06:42PM +0000, Stuart Summers wrote: > Planning on moving debug specific configfs parameters > to their own file in a future patch. In preparation for > that change, move the structures in xe_configfs.c to a > new _types.h file so we can easily access them in the > different configfs files. > > Doing that separately here instead of combining with > the patch that adds the debug file for ease of review. > > Signed-off-by: Stuart Summers <[email protected]> > Assisted-by: Copilot:claude-sonnet-4.6,claude-opus-4.7 Reviewed-by: Matt Roper <[email protected]> > --- > drivers/gpu/drm/xe/xe_configfs.c | 41 -------------------- > drivers/gpu/drm/xe/xe_configfs.h | 2 +- > drivers/gpu/drm/xe/xe_configfs_types.h | 53 ++++++++++++++++++++++++++ > 3 files changed, 54 insertions(+), 42 deletions(-) > create mode 100644 drivers/gpu/drm/xe/xe_configfs_types.h > > diff --git a/drivers/gpu/drm/xe/xe_configfs.c b/drivers/gpu/drm/xe/xe_configfs.c > index cb6ab1fcb8c1..029c9f682c8e 100644 > --- a/drivers/gpu/drm/xe/xe_configfs.c > +++ b/drivers/gpu/drm/xe/xe_configfs.c > @@ -4,7 +4,6 @@ > */ > > #include <linux/bitops.h> > -#include <linux/ctype.h> > #include <linux/configfs.h> > #include <linux/cleanup.h> > #include <linux/find.h> > @@ -17,10 +16,7 @@ > #include "xe_configfs.h" > #include "xe_defaults.h" > #include "xe_gt_types.h" > -#include "xe_hw_engine_types.h" > #include "xe_module.h" > -#include "xe_pci_types.h" > -#include "xe_sriov_types.h" > > /** > * DOC: Xe Configfs > @@ -259,43 +255,6 @@ > * # rmdir /sys/kernel/config/xe/0000:03:00.0/ > */ > > -/* Similar to struct xe_bb, but not tied to HW (yet) */ > -struct wa_bb { > - u32 *cs; > - u32 len; /* in dwords */ > -}; > - > -struct xe_config_group_device { > - struct config_group group; > - struct config_group sriov; > - > - /* > - * Fields sorted by type (largest first) then name: struct arrays, > - * u64, u32/unsigned int, u8, bool, sub-structs last. Within each > - * type, entries are sorted alphabetically. > - */ > - struct xe_config_device { > - struct wa_bb ctx_restore_mid_bb[XE_ENGINE_CLASS_MAX]; > - struct wa_bb ctx_restore_post_bb[XE_ENGINE_CLASS_MAX]; > - u64 engines_allowed; > - u64 gt_types_allowed; > - bool enable_multi_queue; > - bool enable_psmi; > - bool survivability_mode; > - struct { > - unsigned int max_vfs; > - bool admin_only_pf; > - } sriov; > - } config; > - > - /* protects attributes */ > - struct mutex lock; > - /* matching descriptor */ > - const struct xe_device_desc *desc; > - /* tentative SR-IOV mode */ > - enum xe_sriov_mode mode; > -}; > - > static const struct xe_config_device device_defaults = { > .engines_allowed = U64_MAX, > .gt_types_allowed = U64_MAX, > diff --git a/drivers/gpu/drm/xe/xe_configfs.h b/drivers/gpu/drm/xe/xe_configfs.h > index bba592fb612c..7db2f46291fa 100644 > --- a/drivers/gpu/drm/xe/xe_configfs.h > +++ b/drivers/gpu/drm/xe/xe_configfs.h > @@ -8,8 +8,8 @@ > #include <linux/limits.h> > #include <linux/types.h> > > +#include "xe_configfs_types.h" > #include "xe_defaults.h" > -#include "xe_hw_engine_types.h" > #include "xe_module.h" > > struct pci_dev; > diff --git a/drivers/gpu/drm/xe/xe_configfs_types.h b/drivers/gpu/drm/xe/xe_configfs_types.h > new file mode 100644 > index 000000000000..3be7d6160b4c > --- /dev/null > +++ b/drivers/gpu/drm/xe/xe_configfs_types.h > @@ -0,0 +1,53 @@ > +/* SPDX-License-Identifier: MIT */ > +/* > + * Copyright © 2026 Intel Corporation > + */ > +#ifndef _XE_CONFIGFS_TYPES_H_ > +#define _XE_CONFIGFS_TYPES_H_ > + > +#include <linux/configfs.h> > +#include <linux/mutex.h> > +#include <linux/types.h> > + > +#include "xe_hw_engine_types.h" > +#include "xe_pci_types.h" > +#include "xe_sriov_types.h" > + > +/* Similar to struct xe_bb, but not tied to HW (yet) */ > +struct wa_bb { > + u32 *cs; > + u32 len; /* in dwords */ > +}; > + > +struct xe_config_group_device { > + struct config_group group; > + struct config_group sriov; > + > + /* > + * Fields sorted by type (largest first) then name: struct arrays, > + * u64, u32/unsigned int, u8, bool, sub-structs last. Within each > + * type, entries are sorted alphabetically. > + */ > + struct xe_config_device { > + struct wa_bb ctx_restore_mid_bb[XE_ENGINE_CLASS_MAX]; > + struct wa_bb ctx_restore_post_bb[XE_ENGINE_CLASS_MAX]; > + u64 engines_allowed; > + u64 gt_types_allowed; > + bool enable_multi_queue; > + bool enable_psmi; > + bool survivability_mode; > + struct { > + unsigned int max_vfs; > + bool admin_only_pf; > + } sriov; > + } config; > + > + /* protects attributes */ > + struct mutex lock; > + /* matching descriptor */ > + const struct xe_device_desc *desc; > + /* tentative SR-IOV mode */ > + enum xe_sriov_mode mode; > +}; > + > +#endif /* _XE_CONFIGFS_TYPES_H_ */ > -- > 2.43.0 > -- Matt Roper Graphics Software Engineer Linux GPU Platform Enablement Intel Corporation