OSDN Git Service

i965: Factor out code for setting Message Descriptors.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 8 Oct 2011 04:09:08 +0000 (21:09 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 18 Oct 2011 22:57:55 +0000 (15:57 -0700)
commitfa0aa3796d3483cf8924fa127085d075d34019e8
treee596e487ffdd9ac6ef7cb9e3934338695a89b68d
parent43ccd3200c394dd4d89ed96f039ca7d6cfff972f
i965: Factor out code for setting Message Descriptors.

Every brw_set_???_message function had duplicated code, per-generation,
to set the Message Descriptor and Extended Message Descriptor bits
(SFID, message length, response length, header present, end of thread).

However, these fields are actually specified as part of the SEND
instruction itself; individual types of messages don't even specify
them (except for header present, but that's in the same bit location).

Since these are exactly the same regardless of the message type, just
create a function to set them, using the generic message structs.  This
not only shortens the code, but hides a lot of the per-generation
complexity (like the SFID being in destreg__conditionalmod) in one spot.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_eu_emit.c