Re: [RFC] drm/i915: Introduce documentation for register subfields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 19, 2015 at 10:52:15AM +0100, Chris Wilson wrote:
> An interesting point was raised in some recent patches to document the
> various widths of the register subfields. I disagreed with that patch in
> that it transformed illegal values into some random potentially harmful
> valid value (and not transforming an invalid value would end up writing
> bits in other subfields, so equally bad). Most of our register usage is
> with static values so unlikely to be of concern, but for those we can
> document the register subfields and provide compile time checking.

I've thought about things like this in the past as well, we can even
automatically generate all of that from the specs!

I had other per-register metadata in mind, like:
  - is the register is a masked one or not (and then warn if we're
    trying to write it wihtout the _MASKED_*() macros)
  - is the register part of the render context (and then warn if we try
    to write it with a MMIO write).

#define FOO			0x1234
#define FOO_IS_MASKED		1
#define FOO_IS_IN_RENDER_CTX	1

should be enough for the compile-time warns like you do here.

-- 
Damien
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux