host1x: Rename NVHOST_* -> HOST1X_*

The NVHOST_ prefix is a left-over from nvhost test code. For consistency
use only the new HOST1X_ prefix in libhost1x.

Signed-off-by: Thierry Reding <thierry@gilfi.de>
grate: Add quad test program

This new test program draws a quad composed of two triangles. Eventually
it would be a good idea to have a single test program to render several
different primitives to show the capabilities.

Signed-off-by: Thierry Reding <thierry@gilfi.de>
Add translation and perspective matrices

These matrices are useful to position and project objects in test
programs to verify that uniform passing works properly.

Signed-off-by: Thierry Reding <thierry@gilfi.de>
gles: Request 8-bit depth buffers

Require a depth buffer for GLES test programs in order to allow 3D
objects to be rendered properly.

Signed-off-by: Thierry Reding <thierry@gilfi.de>
gles: Add cube test program

This test program renders a cube transformed via a simple modelview
projection matrix.

Signed-off-by: Thierry Reding <thierry@gilfi.de>
drm: Add vblank test program

This program calls drmWaitVBlank() in a loop in order to test whether
sync'ing to VBLANK events is supported and working.

Signed-off-by: Thierry Reding <thierry@gilfi.de>
host1x: Implement VBLANK sync'ing

When displaying a new framebuffer, allow the operation to optionally
sync to VBLANK events in order to avoid tearing. For fullscreen display
this can easily be done using drmModePageFlip(), but for overlays there
isn't a good way to achieve the same. The best we can currently do is
call drmWaitVBlank() and flip as soon as possible after that. Usually it
is already too late and some tearing can't be avoided.

Signed-off-by: Thierry Reding <thierry@gilfi.de>
host1x: Implement helper to set viewport

The required computations are a bit more involved than initially
anticipated, so split the code off into a separate function.

Originally-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Thierry Reding <thierry@gilfi.de>
grate: Add profiler support

Add some small utility functions to profile test programs. Currently
only keeps track of the runtime and number of frames displayed and shows
the number of frames per second when profiling is finished.

Signed-off-by: Thierry Reding <thierry@gilfi.de>
grate: Implement grate_draw_elements() and more

This is a bit of a code dump because it contains a lot of work done over
the last few weeks squashed into a single commit. Trying to separate
commits cleanly turned out to be too much work and error prone, so I
gave in and just committed everything in one go.

In a nutshell, this provides an implementation of grate_draw_elements()
which should be able to draw arbitrary geometry using shaders produced
by the compiler in libcgdrv. It has basic functionality to obtain the
location of attributes and uniforms so they can be properly hooked up
and allows geometry to be specified in a way similar to how vertex
buffer objects are handled by OpenGL.

Furthermore some code is added to libgrate that allows a scene to be
presented on-screen with double-buffering and synchronizing to VBLANK
events.

Signed-off-by: Thierry Reding <thierry@gilfi.de>
Update .gitignore files

Signed-off-by: Thierry Reding <thierry@gilfi.de>