Refine the intel gpgpu delete.
authorYang Rong <rong.r.yang@intel.com>
Mon, 27 Oct 2014 08:16:51 +0000 (16:16 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Tue, 28 Oct 2014 02:15:02 +0000 (10:15 +0800)
commitc454dbdbf6d45cc214dc23c2eeaa38d2530d9f8e
treef8290822e1744847bee1fb4730ab5912a0f0cb86
parent6e451c195917b807988ef8f521b23594eef3e898
Refine the intel gpgpu delete.

The intel gpgpu struct is destroyed when a new gpgpu struct needed. But in that time,
the command batch relative with the destroyed gpgpu may have not finish, and the resource
in gpgpu still used by gpgpu, can't be destroyed.
So, when delete a gpgpu, check the batch status, if have not complete, insert to list in intel driver,
and delete all finished gpgpu in that list.

V2: V1 assume all the gpgpu list would complete in order, but it is not true. The insert order in is the
    gpgpu delete order, not the flush command batch order. So visit and delete all complete gpgpu in the list.

Signed-off-by: Yang Rong <rong.r.yang@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
src/intel/intel_batchbuffer.c
src/intel/intel_driver.c
src/intel/intel_driver.h
src/intel/intel_gpgpu.c
src/intel/intel_gpgpu.h