]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/gpu/drm/i915/gvt/kvmgt.c
Merge tag 'v4.11-rc7' into drm-next
[karo-tx-linux.git] / drivers / gpu / drm / i915 / gvt / kvmgt.c
index e466259034e24b2c62b82265978298c3500b79c5..1ae0b4083ce10b933e877ab7cafdd41b543a2b60 100644 (file)
@@ -295,10 +295,12 @@ static ssize_t description_show(struct kobject *kobj, struct device *dev,
                return 0;
 
        return sprintf(buf, "low_gm_size: %dMB\nhigh_gm_size: %dMB\n"
-                      "fence: %d\nresolution: %s\n",
+                      "fence: %d\nresolution: %s\n"
+                      "weight: %d\n",
                       BYTES_TO_MB(type->low_gm_size),
                       BYTES_TO_MB(type->high_gm_size),
-                      type->fence, vgpu_edid_str(type->resolution));
+                      type->fence, vgpu_edid_str(type->resolution),
+                      type->weight);
 }
 
 static MDEV_TYPE_ATTR_RO(available_instances);
@@ -1150,8 +1152,40 @@ static long intel_vgpu_ioctl(struct mdev_device *mdev, unsigned int cmd,
        return 0;
 }
 
+static ssize_t
+vgpu_id_show(struct device *dev, struct device_attribute *attr,
+            char *buf)
+{
+       struct mdev_device *mdev = mdev_from_dev(dev);
+
+       if (mdev) {
+               struct intel_vgpu *vgpu = (struct intel_vgpu *)
+                       mdev_get_drvdata(mdev);
+               return sprintf(buf, "%d\n", vgpu->id);
+       }
+       return sprintf(buf, "\n");
+}
+
+static DEVICE_ATTR_RO(vgpu_id);
+
+static struct attribute *intel_vgpu_attrs[] = {
+       &dev_attr_vgpu_id.attr,
+       NULL
+};
+
+static const struct attribute_group intel_vgpu_group = {
+       .name = "intel_vgpu",
+       .attrs = intel_vgpu_attrs,
+};
+
+static const struct attribute_group *intel_vgpu_groups[] = {
+       &intel_vgpu_group,
+       NULL,
+};
+
 static const struct mdev_parent_ops intel_vgpu_ops = {
        .supported_type_groups  = intel_vgpu_type_groups,
+       .mdev_attr_groups       = intel_vgpu_groups,
        .create                 = intel_vgpu_create,
        .remove                 = intel_vgpu_remove,