gma pipe_setup: Use a plane as cursor in case of y-tiling
Y-tiling allows us to rotate the framebuffer in 90° steps. However,
we'd also want to rotate the cursor. We can use a second (framebuffer)
plane but that has some pitfalls:
* The plane has to be completely within the visible picture, hence we
can't move the cursor partially out of the picture and have to clip
it manually.
* Calculating the offsets for the clipping is not easy considering
the rotation involved. We translate the cursor's position on the
framebuffer to the final position on the visible picture first,
then we calculate the offsets. This makes it harder to compare to
the documented offset calculations.
Because of this, we have to re-write most of the plane registers when
the cursor is clipped. Only when the cursor was and is fully visible,
we can simply "move" its position.
Change-Id: Ibd6258304ef7d9555b279b5e243a8c1aeadbbb93
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.sourcearcade.org/c/libgfxinit/+/546
Reviewed-by: Thomas Heijligen <src@posteo.de>
Tested-by: Nico Huber <nico.h@gmx.de>
diff --git a/common/hw-gfx-gma-pipe_setup.ads b/common/hw-gfx-gma-pipe_setup.ads
index 892d218..3ba0ec4 100644
--- a/common/hw-gfx-gma-pipe_setup.ads
+++ b/common/hw-gfx-gma-pipe_setup.ads
@@ -52,7 +52,8 @@
(Pipe : Pipe_Index;
FB : Framebuffer_Type;
Cursor : Cursor_Type;
- Center : Cursor_Coord);
+ Center : Cursor_Coord;
+ Update : Boolean := False);
type Scaler_Reservation is private;
Null_Scaler_Reservation : constant Scaler_Reservation;