intel: add sprite ioctl defines and struct for i915 sprite code
intel: Add a regression test for 2D decode, which I'm about to refactor.
intel: Track the current packet location in the decode context.

This is the start of plumbing the context through the decode
callchain instead of the current 4 arguments.
intel: Drop the code for counting parsing failures.

Nothing was consuming it.  If something wants this in the future,
would be done using the decode context anyway.
intel: Plumb the context through the decode callchain.

We still deref the context at the start of every call, but that will
change next.
intel: Use the context to simplify BR00 decode.

The count (actually index) was always 0, because BR00 is dword 0.
intel: Use the context to simplify BR01 decode.

Similar to BR00, count was always 1 and was always an index, not a count.
intel: Make instr_out take the decode context.

This reduces some of the extra derefs of the pointers.
intel: Avoid the need for most overflow checks by using a scratch page.

The overflow checks were all thoroughly untested, and a bunch of the
ones I'm deleting were pretty broken.  Now, in the case of overflow,
you just decode data of 0xd0d0d0d0, and instr_out prints the warning
message instead.  Note that this still has the same issue of being
under-tested, but at least it's one place instead of per-packet.

A couple of BUFFER_FAIL uses are left where the length to be decoded
could be (significantly) larger than a page, and the decode didn't
just call instr_out (which doesn't dereference data itself unless it's
safe).
intel: Put the "gen" shorthand chipset identifier in the context.

It's a lot nicer than using IS_WHATEVER(devid) all over the place, and
we have this in our other projects too.
intel: Parse the correct length for gen7 3DSTATE_MULTISAMPLE.
intel: Add support for parsing 965 3d packets using helper functions.

I want to add packets, without contributing to the switch statement of
doom.
intel: Move the logic for getting 965 3d packet length to the packet table.

While I'm touching every line of the table, sort it by opcode.
intel: Make most of the logic for 965 3d packet length checks table-driven.

This puts the error message in a consistent location relative to the
packet, and while I'm here I made the error message a bit more
informative.

Now, most static length packets need to just declare their length in
the table and not worry.
intel: Add support for parsing gen7 URB packets.
intel: Add decode for gen7 state pointers.

Since CC_STATE_POINTERS for gen6 and 7 are quite different but use the
same opcode, move gen6 out to a helper function too, so we can use a
helper function for gen7.
intel: Add decode for gen7 constant buffer packets.
intel: Add minimal decode for remaining gen7 packets in use.

This just gets packet name and length in place, with the remainder
unfinished.  I've long since finished the work that got me started
fixing up the decode.
intel: Fix bufmgr_gem->gen for gen > 4

If the pci_device's actual gen was > 4, then we stupidly set
bufmgr_gem->gen = 6. Luckily this caused no bugs, and this fix shouldn't
change any behavior, because all checks against the gen currently have one
of the forms below:
    gen == 2
    gen == 3
    gen >= 4

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Don't build Intel DRM if $CHOST is not i?86-* or x86_64-*

This fixes a failure in 'make check' found by the tinderbox when trying to
build this code on Linux/ppc.  This code is only designed to run on
Intel platforms, so don't even bother building it if we're not in that set.

Found-by: Tinderbox
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>