Skip to content

Commit 4546281

Browse files
Merge tag 'gvt-next-2022-03-07' of https://github.com/intel/gvt-linux into drm-intel-next-fixes
- add the missing attribute "name" in VFIO mdev hierarchy. Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> From: "Wang, Zhi A" <zhi.a.wang@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/e38f0725-6b22-8e49-b8f6-41986b0ece06@intel.com
2 parents 5c8107d + 43d26c4 commit 4546281

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

drivers/gpu/drm/i915/gvt/kvmgt.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,29 @@ static ssize_t description_show(struct mdev_type *mtype,
188188
type->weight);
189189
}
190190

191+
static ssize_t name_show(struct mdev_type *mtype,
192+
struct mdev_type_attribute *attr, char *buf)
193+
{
194+
struct intel_vgpu_type *type;
195+
struct intel_gvt *gvt = kdev_to_i915(mtype_get_parent_dev(mtype))->gvt;
196+
197+
type = &gvt->types[mtype_get_type_group_id(mtype)];
198+
if (!type)
199+
return 0;
200+
201+
return sprintf(buf, "%s\n", type->name);
202+
}
203+
191204
static MDEV_TYPE_ATTR_RO(available_instances);
192205
static MDEV_TYPE_ATTR_RO(device_api);
193206
static MDEV_TYPE_ATTR_RO(description);
207+
static MDEV_TYPE_ATTR_RO(name);
194208

195209
static struct attribute *gvt_type_attrs[] = {
196210
&mdev_type_attr_available_instances.attr,
197211
&mdev_type_attr_device_api.attr,
198212
&mdev_type_attr_description.attr,
213+
&mdev_type_attr_name.attr,
199214
NULL,
200215
};
201216

0 commit comments

Comments
 (0)