aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPei Zhang <pei.zhang@intel.com>2017-12-08 02:31:12 -0500
committerZhenyu Wang <zhenyuw@linux.intel.com>2017-12-08 03:18:49 -0500
commit072ec93d50fd4c4b27ea44fff160a95c2b581eb1 (patch)
tree34478ebb5fb0b1449765828a217d08c4f519c43a
parent1aec75ee327f2f2085a4e2b060a3d999b8f4d925 (diff)
drm/i915/gvt/kvmgt: fill info for ROM/VGA region
Both ROM/VGA region are not supported for vGPU in GVT. But if the device model want to get those region, we should return the correct information but not leave the structure with random data. Change to same operation of BAR3-BAR5 which are also not supported by vGPU. Refer to function @intel_vgpu_rw. Signed-off-by: Pei Zhang <pei.zhang@intel.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
-rw-r--r--drivers/gpu/drm/i915/gvt/kvmgt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
index b8a85e08091a..f86983d6655b 100644
--- a/drivers/gpu/drm/i915/gvt/kvmgt.c
+++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
@@ -1029,13 +1029,17 @@ static long intel_vgpu_ioctl(struct mdev_device *mdev, unsigned int cmd,
1029 case VFIO_PCI_BAR3_REGION_INDEX ... VFIO_PCI_BAR5_REGION_INDEX: 1029 case VFIO_PCI_BAR3_REGION_INDEX ... VFIO_PCI_BAR5_REGION_INDEX:
1030 info.offset = VFIO_PCI_INDEX_TO_OFFSET(info.index); 1030 info.offset = VFIO_PCI_INDEX_TO_OFFSET(info.index);
1031 info.size = 0; 1031 info.size = 0;
1032
1033 info.flags = 0; 1032 info.flags = 0;
1033
1034 gvt_dbg_core("get region info bar:%d\n", info.index); 1034 gvt_dbg_core("get region info bar:%d\n", info.index);
1035 break; 1035 break;
1036 1036
1037 case VFIO_PCI_ROM_REGION_INDEX: 1037 case VFIO_PCI_ROM_REGION_INDEX:
1038 case VFIO_PCI_VGA_REGION_INDEX: 1038 case VFIO_PCI_VGA_REGION_INDEX:
1039 info.offset = VFIO_PCI_INDEX_TO_OFFSET(info.index);
1040 info.size = 0;
1041 info.flags = 0;
1042
1039 gvt_dbg_core("get region info index:%d\n", info.index); 1043 gvt_dbg_core("get region info index:%d\n", info.index);
1040 break; 1044 break;
1041 default: 1045 default: