summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2017-08-19 20:12:23 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2017-08-19 20:12:23 +0000
commit31193c014e16aa80b9aa1e63dedd08e8ad5dc1ec (patch)
tree0d63d669dca6ac43773bc2b4c8eac3af79050aee /sys/dev
parent442aab002e5bd93bcfb4dabf59a6b99cc5966433 (diff)
Rotate framebuffer (counter-clockwise) when width < height.
ok mpi@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/drm/files.drm4
-rw-r--r--sys/dev/pci/drm/i915/i915_drv.c9
2 files changed, 11 insertions, 2 deletions
diff --git a/sys/dev/pci/drm/files.drm b/sys/dev/pci/drm/files.drm
index 0e3acacb8ae..2d2355adede 100644
--- a/sys/dev/pci/drm/files.drm
+++ b/sys/dev/pci/drm/files.drm
@@ -1,5 +1,5 @@
# $NetBSD: files.drm,v 1.2 2007/03/28 11:29:37 jmcneill Exp $
-# $OpenBSD: files.drm,v 1.37 2017/07/02 20:58:55 kettenis Exp $
+# $OpenBSD: files.drm,v 1.38 2017/08/19 20:12:22 kettenis Exp $
# direct rendering modules
define drmbase {[console = -1]}
@@ -48,7 +48,7 @@ file dev/pci/drm/ttm/ttm_object.c ttm
file dev/pci/drm/ttm/ttm_page_alloc.c ttm
file dev/pci/drm/ttm/ttm_tt.c ttm
-device inteldrm: agpint, drmbase, wsemuldisplaydev, rasops32, i2cbus, i2c_bitbang
+device inteldrm: agpint, drmbase, wsemuldisplaydev, rasops32, rasops_rotation, i2cbus, i2c_bitbang
attach inteldrm at pci
file dev/pci/drm/i915/i915_cmd_parser.c inteldrm
file dev/pci/drm/i915/i915_dma.c inteldrm
diff --git a/sys/dev/pci/drm/i915/i915_drv.c b/sys/dev/pci/drm/i915/i915_drv.c
index cb6a43c6b6e..b1d20030b2f 100644
--- a/sys/dev/pci/drm/i915/i915_drv.c
+++ b/sys/dev/pci/drm/i915/i915_drv.c
@@ -2287,6 +2287,8 @@ inteldrm_attach(struct device *parent, struct device *self, void *aux)
inteldrm_init_backlight(dev_priv);
ri->ri_flg = RI_CENTER | RI_WRONLY | RI_VCONS | RI_CLEAR;
+ if (ri->ri_width < ri->ri_height)
+ ri->ri_flg |= RI_ROTATE_CCW;
ri->ri_hw = dev_priv;
rasops_init(ri, 160, 160);
@@ -2309,6 +2311,13 @@ inteldrm_attach(struct device *parent, struct device *self, void *aux)
if (console) {
long defattr;
+ /*
+ * Clear the entire screen if we're doing rotation to
+ * make sure no unrotated content survives.
+ */
+ if (ri->ri_flg & RI_ROTATE_CCW)
+ memset(ri->ri_bits, 0, ri->ri_height * ri->ri_stride);
+
ri->ri_ops.alloc_attr(ri->ri_active, 0, 0, 0, &defattr);
wsdisplay_cnattach(&inteldrm_stdscreen, ri->ri_active,
0, 0, defattr);