[Mesa-dev] [PATCH 09/10] i965: Clean up misleading defines for DWORD 2 of URB_WRITE header.

Paul Berry stereotype441 at gmail.com
Wed Dec 7 10:19:07 PST 2011


On 6 December 2011 23:31, Kenneth Graunke <kenneth at whitecape.org> wrote:

> On 12/05/2011 09:40 AM, Paul Berry wrote:
> > R02_PRIM_END and R02_PRIM_START don't actually refer to bits in DWORD
> > 2 of R0 (as the name, and comments in the code, would seem to
> > indicate).  Actually they refer to bits in DWORD 2 of the header for
> > URB_WRITE messages.
> >
> > This patch renames the defines to reflect what they actually mean.  It
> > also addes a define URB_WRITE_M02_PRIM_TYPE_SHIFT, which previously
> > was just hardcoded in .c files.
>
> I'm all for renaming these.  But I might drop the "_M02_" altogether,
> and simply go with:
>   URB_WRITE_PRIM_START
>   URB_WRITE_PRIM_END
>   URB_WRITE_PRIM_TYPE_SHIFT
> Those names seem clear enough, and are a bit more concise.  We don't
> usually put the DWord number in most of our #defines.  Also, I
> personally find both "R02" and "M02" confusing...usually "R<n>" means
> GRF n and "M<n>" means MRF n.  Yes, the leading 0 suggests it probably
> means something else...but will people figure out what? :)
>
> I might instead expand the comment in brw_defines.h slightly to mention
> that these bits go in DW2 of the URB_WRITE message header.
>

Yeah, I can go along with that.  I wasn't thrilled with the "M02" business
either.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20111207/5aa27953/attachment.htm>


More information about the mesa-dev mailing list