mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2025-07-01 07:15:54 +00:00
parent
a9d6f17d5e
commit
d6c9650a32
@ -195,7 +195,7 @@ static void help() {
|
||||
printf("\t-4k\t\t\tUse 3840x2160 resolution\n");
|
||||
printf("\t-width <width>\t\tHorizontal resolution (default 1280)\n");
|
||||
printf("\t-height <height>\tVertical resolution (default 720)\n");
|
||||
#if defined(HAVE_PI) | defined(HAVE_MMAL)
|
||||
#ifdef HAVE_EMBEDDED
|
||||
printf("\t-rotate <angle>\tRotate display: 0/90/180/270 (default 0)\n");
|
||||
#endif
|
||||
printf("\t-fps <fps>\t\tSpecify the fps to use (default 60)\n");
|
||||
|
@ -502,6 +502,24 @@ int rk_setup(int videoFormat, int width, int height, int redrawRate, void* conte
|
||||
}
|
||||
assert(plane_id);
|
||||
|
||||
// DRM defines rotation in degrees counter-clockwise while we define
|
||||
// rotation in degrees clockwise, so we swap the 90 and 270 cases
|
||||
int displayRotation = drFlags & DISPLAY_ROTATE_MASK;
|
||||
switch (displayRotation) {
|
||||
case DISPLAY_ROTATE_90:
|
||||
set_property(plane_id, DRM_MODE_OBJECT_PLANE, plane_props, "rotation", DRM_MODE_ROTATE_270);
|
||||
break;
|
||||
case DISPLAY_ROTATE_180:
|
||||
set_property(plane_id, DRM_MODE_OBJECT_PLANE, plane_props, "rotation", DRM_MODE_ROTATE_180);
|
||||
break;
|
||||
case DISPLAY_ROTATE_270:
|
||||
set_property(plane_id, DRM_MODE_OBJECT_PLANE, plane_props, "rotation", DRM_MODE_ROTATE_90);
|
||||
break;
|
||||
default:
|
||||
set_property(plane_id, DRM_MODE_OBJECT_PLANE, plane_props, "rotation", DRM_MODE_ROTATE_0);
|
||||
break;
|
||||
}
|
||||
|
||||
// hide cursor by move in left lower corner
|
||||
drmModeMoveCursor(fd, crtc_id, 0, crtc_height);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user