drm/i915/gvt: update vgpu workload head pointer correctly
authorXiaolin Zhang <xiaolin.zhang@intel.com>
Tue, 27 Aug 2019 08:39:23 +0000 (16:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Oct 2019 16:21:03 +0000 (18:21 +0200)
commit873f49d6a4e8176b2f0f6d3b5540d84b712b064e
tree16e86ec0991416d9b5472fd2f019d95382bcb1fb
parent198bc7040c484d4c7be04b4eb64d5c19fbf466ce
drm/i915/gvt: update vgpu workload head pointer correctly

commit 0a3242bdb47713e09cb004a0ba4947d3edf82d8a upstream.

when creating a vGPU workload, the guest context head pointer should
be updated correctly by comparing with the exsiting workload in the
guest worklod queue including the current running context.

in some situation, there is a running context A and then received 2 new
vGPU workload context B and A. in the new workload context A, it's head
pointer should be updated with the running context A's tail.

v2: walk through guest workload list in backward way.

Cc: stable@vger.kernel.org
Signed-off-by: Xiaolin Zhang <xiaolin.zhang@intel.com>
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/i915/gvt/scheduler.c