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

Commit a7cc0fe

Browse files
committed
Merge remote-tracking branch 'origin/gvt-next' into gvt-staging
2 parents 7a11cf6 + d7e19ac commit a7cc0fe

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
@@ -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)