Blob Blame History Raw
From: Thomas Hellstrom <thellstrom@vmware.com>
Date: Thu, 24 Aug 2017 08:06:31 +0200
Subject: drm/vmwgfx: Fix incorrect command header offset at restart
Git-commit: 1f1a36cc4d4986a800018f1d3eed94a4e92a576f
Patch-mainline: v4.14-rc1
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166

Sometimes it appears like the device modifies the command header offset
member. So explicitly clear it when restarting after an error.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c
@@ -563,6 +563,7 @@ static void vmw_cmdbuf_work_func(struct
 		entry->cmd += new_start_offset;
 		cb_hdr->length -= new_start_offset;
 		cb_hdr->errorOffset = 0;
+		cb_hdr->offset = 0;
 		list_add_tail(&entry->list, &restart_head[entry->cb_context]);
 		man->ctx[entry->cb_context].block_submission = true;
 	}