[Intel-gfx] [PATCH 3/3] i915/gvt/dmabuf: update_fb_info: convert size correctly

Uri Lublin uril at redhat.com
Sun Apr 14 14:44:13 UTC 2019


Internal (driver) representation is in pages (intel_vgpu_fb_info).
User API is in bytes (vfio_device_gfx_plane_info).

Signed-off-by: Uri Lublin <uril at redhat.com>
Signed-off-by: Snir Sheriber <ssheribe at redhat.com>
---
 drivers/gpu/drm/i915/gvt/dmabuf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gvt/dmabuf.c b/drivers/gpu/drm/i915/gvt/dmabuf.c
index 857e3a02d951..7b66ec2ee167 100644
--- a/drivers/gpu/drm/i915/gvt/dmabuf.c
+++ b/drivers/gpu/drm/i915/gvt/dmabuf.c
@@ -355,7 +355,7 @@ static void update_fb_info(struct vfio_device_gfx_plane_info *gvt_dmabuf,
 	gvt_dmabuf->width = fb_info->width;
 	gvt_dmabuf->height = fb_info->height;
 	gvt_dmabuf->stride = fb_info->stride;
-	gvt_dmabuf->size = fb_info->size;
+	gvt_dmabuf->size = fb_info->size << PAGE_SHIFT;
 	gvt_dmabuf->x_pos = fb_info->x_pos;
 	gvt_dmabuf->y_pos = fb_info->y_pos;
 	gvt_dmabuf->x_hot = fb_info->x_hot;
-- 
2.20.1



More information about the Intel-gfx mailing list