Mesa (master): r600g: alternative command stream building from context

Jerome Glisse glisse at kemper.freedesktop.org
Fri Sep 17 14:53:57 UTC 2010


Module: Mesa
Branch: master
Commit: fd266ec62ca772a8551d2d7922d718d9d84bdf07
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fd266ec62ca772a8551d2d7922d718d9d84bdf07

Author: Jerome Glisse <jglisse at redhat.com>
Date:   Fri Sep 17 10:41:50 2010 -0400

r600g: alternative command stream building from context

Winsys context build a list of register block a register block is
a set of consecutive register that will be emited together in the
same pm4 packet (the various r600_block* are there to provide basic
grouping that try to take advantage of states that are linked together)
Some consecutive register are emited each in a different block,
for instance the various cb[0-7]_base. At winsys context creation,
the list of block is created & an index into the list of block. So
to find into which block a register is in you simply use the register
offset and lookup the block index. Block are grouped together into
group which are the various pkt3 group of config, context, resource,

Pipe state build a list of register each state want to modify,
beside register value it also give a register mask so only subpart
of a register can be updated by a given pipe state (the oring is
in the winsys) There is no prebuild register list or define for
each pipe state. Once pipe state are built they are bound to
the winsys context.

Each of this functions will go through the list of register and
will find into which block each reg falls and will update the
value of the block with proper masking (vs/ps resource/constant
are specialized variant with somewhat limited capabilities).

Each block modified by r600_context_pipe_state_set* is marked as
dirty and we update a count of dwords needed to emit all dirty
state so far.

r600_context_pipe_state_set* should be call only when pipe context
change some of the state (thus when pipe bind state or set state)

Then to draw primitive you make a call to r600_context_draw
void r600_context_draw(struct r600_context *ctx, struct r600_draw *draw)
It will check if there is enough dwords in current cs buffer and
if not will flush. Once there is enough room it will copy packet
from dirty block and then add the draw packet3 to initiate the draw.

The flush will send the current cs, reset the count of dwords to
0 and remark all states that are enabled as dirty and recompute
the number of dwords needed to send the current context.

Signed-off-by: Jerome Glisse <jglisse at redhat.com>

---

 src/gallium/drivers/r600/Makefile         |    1 +
 src/gallium/drivers/r600/r600.h           |  244 ++++
 src/gallium/drivers/r600/r600_resource.c  |   12 +-
 src/gallium/drivers/r600/r600_resource.h  |    2 +-
 src/gallium/drivers/r600/r600_screen.c    |    2 +-
 src/gallium/drivers/r600/r600_state2.c    | 2227 +++++++++++++++++++++++++++++
 src/gallium/drivers/r600/r600_texture.c   |    2 +-
 src/gallium/drivers/r600/r600d.h          | 2106 +++++++++++++++++++++++++++-
 src/gallium/targets/dri-r600/target.c     |   23 +
 src/gallium/winsys/r600/drm/Makefile      |    2 +
 src/gallium/winsys/r600/drm/r600.c        |  129 ++
 src/gallium/winsys/r600/drm/r600_priv.h   |   56 +
 src/gallium/winsys/r600/drm/r600_state2.c | 1055 ++++++++++++++
 src/gallium/winsys/r600/drm/r600d.h       |   77 +-
 14 files changed, 5913 insertions(+), 25 deletions(-)

Diff:   http://cgit.freedesktop.org/mesa/mesa/diff/?id=fd266ec62ca772a8551d2d7922d718d9d84bdf07



More information about the mesa-commit mailing list