OSDN Git Service

ilo: replace cp hooks by cp owner and flush callback
authorChia-I Wu <olvaffe@gmail.com>
Mon, 20 May 2013 04:13:34 +0000 (12:13 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Tue, 21 May 2013 03:47:20 +0000 (11:47 +0800)
commit0d42a9e9414a1c015e1ceced4d773a455e5b39d1
tree14557a6a80f12047f813d2e7d610d9e70733a7bc
parenta04d8574c61f286fd9ec51f667648f73e332462f
ilo: replace cp hooks by cp owner and flush callback

The problem with cp hooks is that when we switch from 3D ring to 2D ring, and
when there are active queries, we will emit 3D commands to 2D ring because
the new-batch hook is called.

This commit introduces the idea of cp owner.  When the cp is flushed, or when
another owner takes place, the current owner is notified, giving it a chance
to emit whatever commands there need to be.  With this mechanism, we can
resume queries when the 3D pipeline owns the cp, and pause queries when it
loses the cp.  Ring switch will just work.

As we still need to know when the cp bo is reallocated, a flush callback is
added.
src/gallium/drivers/ilo/ilo_3d.c
src/gallium/drivers/ilo/ilo_3d.h
src/gallium/drivers/ilo/ilo_blit.c
src/gallium/drivers/ilo/ilo_context.c
src/gallium/drivers/ilo/ilo_cp.c
src/gallium/drivers/ilo/ilo_cp.h