ui: Deduplicate rotation types

Introduce ui::Rotation, replacing ISurfaceComposer::Rotation as well as
DISPLAY_ORIENTATION_* and DisplayState::eOrientation* constants.

libinput has widespread use of int32_t for orientation, so move
DISPLAY_ORIENTATION_* to input/DisplayViewport.h for now.

Bug: 144601064
Test: go/wm-smoke
Test: screencap
Change-Id: Ic4b8494e37c9d79c00d5b4be5eb88585f09efebf
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index e033f93..a7c4f46 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -203,7 +203,6 @@
 DisplayState::DisplayState() :
     what(0),
     layerStack(0),
-    orientation(eOrientationDefault),
     viewport(Rect::EMPTY_RECT),
     frame(Rect::EMPTY_RECT),
     width(0),
@@ -215,7 +214,7 @@
     output.writeStrongBinder(IInterface::asBinder(surface));
     output.writeUint32(what);
     output.writeUint32(layerStack);
-    output.writeUint32(orientation);
+    output.writeUint32(toRotationInt(orientation));
     output.write(viewport);
     output.write(frame);
     output.writeUint32(width);
@@ -228,7 +227,7 @@
     surface = interface_cast<IGraphicBufferProducer>(input.readStrongBinder());
     what = input.readUint32();
     layerStack = input.readUint32();
-    orientation = input.readUint32();
+    orientation = ui::toRotation(input.readUint32());
     input.read(viewport);
     input.read(frame);
     width = input.readUint32();