freedreno: add prims-emitted driver query

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno: ctx should hold ref to dev

The ctx should hold ref to dev to avoid problems if screen is destroyed
before ctx.  Doesn't really fix the egl/glx issues, but at least it
prevents things from getting much worse.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/a3xx/compiler: various fixes

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/a3xx/compiler: add CLAMP

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno: add tgsi lowering pass

Currently lowers the following instructions:

   DST, XPD, SCS, LRP, FRC, POW, LIT, EXP, LOG, DP4,
   DP3, DPH, DP2

translating these into equivalent simpler TGSI instructions.

This probably should be moved to util so other drivers can use
it, but just adding under freedreno for now so that I can clear
out a lot of the lowering code in a3xx compiler before beginning
to add new compiler.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/compiler/a3xx: remove lowered instructions

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/a3xx/compiler: compiler cleanups

Drop color/pos/psize_regid, plus a few compiler and IR cleanups.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/a3xx: fix const confusion

Gallium can leave const buffers bound above what is used by the current
shader.  Which can have a couple bad effects:

1) write beyond const space assigned, which can trigger HLSQ lockup
2) double emit of immed consts, first with bound const buffer vals
followed by with actual immed vals.  This seems to be a sort of
undefined condition.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno: resync generated headers

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/a3xx: handle frag z write

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/a3xx: add logicop

Signed-off-by: Rob Clark <robclark@freedesktop.org>