Skip to content

Commit 57cbec0

Browse files
committed
Merge tag 'gvt-fixes-2019-04-04' of https://github.com/intel/gvt-linux into drm-intel-fixes
gvt-fixes-2019-04-04 - Fix shadow mm pin count (Yan) - Fix cmd parser error path recover (Yan) - Fix vGPU display plane size calculation (Xiong) - Fix kerneldoc (Chris) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> From: Zhenyu Wang <zhenyuw@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190404003957.GB8327@zhen-hp.sh.intel.com
2 parents a145b5b + cf9ed66 commit 57cbec0

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ void intel_gvt_emulate_vblank(struct intel_gvt *gvt)
448448
/**
449449
* intel_vgpu_emulate_hotplug - trigger hotplug event for vGPU
450450
* @vgpu: a vGPU
451-
* @conncted: link state
451+
* @connected: link state
452452
*
453453
* This function is used to trigger hotplug interrupt for vGPU
454454
*

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,6 @@ static int vgpu_get_plane_info(struct drm_device *dev,
238238
default:
239239
gvt_vgpu_err("invalid tiling mode: %x\n", p.tiled);
240240
}
241-
242-
info->size = (((p.stride * p.height * p.bpp) / 8) +
243-
(PAGE_SIZE - 1)) >> PAGE_SHIFT;
244241
} else if (plane_id == DRM_PLANE_TYPE_CURSOR) {
245242
ret = intel_vgpu_decode_cursor_plane(vgpu, &c);
246243
if (ret)
@@ -262,14 +259,13 @@ static int vgpu_get_plane_info(struct drm_device *dev,
262259
info->x_hot = UINT_MAX;
263260
info->y_hot = UINT_MAX;
264261
}
265-
266-
info->size = (((info->stride * c.height * c.bpp) / 8)
267-
+ (PAGE_SIZE - 1)) >> PAGE_SHIFT;
268262
} else {
269263
gvt_vgpu_err("invalid plane id:%d\n", plane_id);
270264
return -EINVAL;
271265
}
272266

267+
info->size = (info->stride * info->height + PAGE_SIZE - 1)
268+
>> PAGE_SHIFT;
273269
if (info->size == 0) {
274270
gvt_vgpu_err("fb size is zero\n");
275271
return -EINVAL;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1946,7 +1946,7 @@ void _intel_vgpu_mm_release(struct kref *mm_ref)
19461946
*/
19471947
void intel_vgpu_unpin_mm(struct intel_vgpu_mm *mm)
19481948
{
1949-
atomic_dec(&mm->pincount);
1949+
atomic_dec_if_positive(&mm->pincount);
19501950
}
19511951

19521952
/**

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,8 +1486,9 @@ intel_vgpu_create_workload(struct intel_vgpu *vgpu, int ring_id,
14861486
intel_runtime_pm_put_unchecked(dev_priv);
14871487
}
14881488

1489-
if (ret && (vgpu_is_vm_unhealthy(ret))) {
1490-
enter_failsafe_mode(vgpu, GVT_FAILSAFE_GUEST_ERR);
1489+
if (ret) {
1490+
if (vgpu_is_vm_unhealthy(ret))
1491+
enter_failsafe_mode(vgpu, GVT_FAILSAFE_GUEST_ERR);
14911492
intel_vgpu_destroy_workload(workload);
14921493
return ERR_PTR(ret);
14931494
}

0 commit comments

Comments
 (0)