Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit d7e19ac

Browse files
zhi-wang-linuxzhiwang1
authored andcommitted
drm/i915/gvt: add the missing mdev attribute "name"
The mdev attribute "name" is required by some middle software, e.g. KubeVirt, an open source SW that manages VM on Kubernetes cluster uses the mdev sysfs directory/file structure to discover mediated device in nodes in the cluster. v2: - Fix the missing defination in gvt_type_attrs. (Zhenyu) Cc: Zhenyu Wang <[email protected]> Cc: Hui Chun Ong <[email protected]> Cc: Terrence Xu <[email protected]> Cc: Zhi Wang <[email protected]> Signed-off-by: Zhi Wang <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Zhenyu Wang <[email protected]>
1 parent 3f8bd46 commit d7e19ac

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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

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

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

193207
static struct attribute *gvt_type_attrs[] = {
194208
&mdev_type_attr_available_instances.attr,
195209
&mdev_type_attr_device_api.attr,
196210
&mdev_type_attr_description.attr,
211+
&mdev_type_attr_name.attr,
197212
NULL,
198213
};
199214

0 commit comments

Comments
 (0)