[WiP] gallium: Work in progress on OpenFIMG driver

Changes:
 - fixed emission of 3 source shader instrucitons,
 - moved to freedreno libdrm helpers to reduce code duplication,
 - ported resource management improvements from freedreno,
 - various fixes.