From bc31cd49d009a64af97921c09210603bee593b9c Mon Sep 17 00:00:00 2001 From: bentley Date: Wed, 26 Apr 2023 09:19:47 +0000 Subject: [PATCH] Rotate the console in amdgpu when there is an orientation quirk. ok jsg@ --- sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c index a35f16c07d4..d54444f921e 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c @@ -2906,6 +2906,7 @@ MODULE_LICENSE("GPL and additional rights"); #endif /* __linux__ */ #include +#include #include "vga.h" @@ -3564,6 +3565,7 @@ amdgpu_attachhook(struct device *self) } { struct wsemuldisplaydev_attach_args aa; + int orientation_quirk; task_set(&adev->switchtask, amdgpu_doswitch, ri); task_set(&adev->burner_task, amdgpu_burner_cb, adev); @@ -3572,6 +3574,14 @@ amdgpu_attachhook(struct device *self) return; ri->ri_flg = RI_CENTER | RI_VCONS | RI_WRONLY; + + orientation_quirk = drm_get_panel_orientation_quirk(ri->ri_width, + ri->ri_height); + if (orientation_quirk == DRM_MODE_PANEL_ORIENTATION_LEFT_UP) + ri->ri_flg |= RI_ROTATE_CCW; + else if (orientation_quirk == DRM_MODE_PANEL_ORIENTATION_RIGHT_UP) + ri->ri_flg |= RI_ROTATE_CW; + rasops_init(ri, 160, 160); ri->ri_hw = adev; -- 2.20.1