dri2,dumb: add dirty flag to omap bo and propagate it to mali-driver

Add a dirty flag to omap dumb buffers, set when host writes to a buffer.
The flag is conveyed to mali-driver via bit 0 in flags field of DRI2 buffer
structure and reset when rendered buffer arrives from mali-driver via
SwapBuffers. The flag is used by mali-driver to invalidate CRC surface
attached to the buffer, otherwise GPU would not write over what host has
written for the tiles that it thinks are identical to previous frame
(because they have the same CRC). Additionally the flag is also set on
newly created buffers to make sure CRC is not used for them as well.

While we are here, also move update of acquire_cnt and acquire_exclusive
to after ioctl succeeds.

TEST=connect 1080 monitor to PeachPi, switch to mirror mode, disconnect\
monitor, powerd_dbus_suspend, connect monitor, resume

Change-Id: Ief69351a43c5d0a353801d4eea09905c248e9ed4
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/203533
Reviewed-by: St├ęphane Marchesin <marcheu@chromium.org>
4 files changed