[PATCH 05/39] video: lcd: Drop console rotation

Simon Glass sjg at chromium.org
Wed Oct 19 13:23:22 CEST 2022


This option is not used in U-Boot anymore. Drop it option and the
associated implementation.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 README                        |  21 ----
 common/Makefile               |   1 -
 common/lcd_console_rotation.c | 194 ----------------------------------
 3 files changed, 216 deletions(-)
 delete mode 100644 common/lcd_console_rotation.c

diff --git a/README b/README
index 186f1f9a5ff..ec492f9926c 100644
--- a/README
+++ b/README
@@ -823,27 +823,6 @@ The following options need to be configured:
 		here, since it is cheaper to change data cache settings on
 		a per-section basis.
 
-
-		CONFIG_LCD_ROTATION
-
-		Sometimes, for example if the display is mounted in portrait
-		mode or even if it's mounted landscape but rotated by 180degree,
-		we need to rotate our content of the display relative to the
-		framebuffer, so that user can read the messages which are
-		printed out.
-		Once CONFIG_LCD_ROTATION is defined, the lcd_console will be
-		initialized with a given rotation from "vl_rot" out of
-		"vidinfo_t" which is provided by the board specific code.
-		The value for vl_rot is coded as following (matching to
-		fbcon=rotate:<n> linux-kernel commandline):
-		0 = no rotation respectively 0 degree
-		1 = 90 degree rotation
-		2 = 180 degree rotation
-		3 = 270 degree rotation
-
-		If CONFIG_LCD_ROTATION is not defined, the console will be
-		initialized with 0degree rotation.
-
 - MII/PHY support:
 		CONFIG_PHY_CLOCK_FREQ (ppc4xx)
 
diff --git a/common/Makefile b/common/Makefile
index 1d56c9f2895..d3175b7a854 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -38,7 +38,6 @@ obj-$(CONFIG_SPLASH_SOURCE) += splash_source.o
 ifndef CONFIG_DM_VIDEO
 obj-$(CONFIG_LCD) += lcd.o lcd_console.o
 endif
-obj-$(CONFIG_LCD_ROTATION) += lcd_console_rotation.o
 obj-$(CONFIG_MENU) += menu.o
 obj-$(CONFIG_UPDATE_COMMON) += update.o
 obj-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
diff --git a/common/lcd_console_rotation.c b/common/lcd_console_rotation.c
deleted file mode 100644
index a5f5c6da7be..00000000000
--- a/common/lcd_console_rotation.c
+++ /dev/null
@@ -1,194 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2015
- * Bernecker & Rainer Industrieelektronik GmbH - http://www.br-automation.com
- */
-
-#include <common.h>
-#include <lcd.h>
-#include <video_font.h>		/* Get font data, width and height */
-
-static void lcd_putc_xy90(struct console_t *pcons, ushort x, ushort y, char c)
-{
-	int fg_color = lcd_getfgcolor();
-	int bg_color = lcd_getbgcolor();
-	int col, i;
-
-	fbptr_t *dst = (fbptr_t *)pcons->fbbase +
-				  (x+1) * pcons->lcdsizex -
-				  y;
-
-	uchar msk = 0x80;
-	uchar *pfont = video_fontdata + c * VIDEO_FONT_HEIGHT;
-	for (col = 0; col < VIDEO_FONT_WIDTH; ++col) {
-		for (i = 0; i < VIDEO_FONT_HEIGHT; ++i)
-			*dst-- = (*(pfont + i) & msk) ? fg_color : bg_color;
-		msk >>= 1;
-		dst += (pcons->lcdsizex + VIDEO_FONT_HEIGHT);
-	}
-}
-
-static inline void console_setrow90(struct console_t *pcons, u32 row, int clr)
-{
-	int i, j;
-	fbptr_t *dst = (fbptr_t *)pcons->fbbase +
-				  pcons->lcdsizex -
-				  row*VIDEO_FONT_HEIGHT+1;
-
-	for (j = 0; j < pcons->lcdsizey; j++) {
-		for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
-			*dst-- = clr;
-		dst += (pcons->lcdsizex + VIDEO_FONT_HEIGHT);
-	}
-}
-
-static inline void console_moverow90(struct console_t *pcons,
-				      u32 rowdst, u32 rowsrc)
-{
-	int i, j;
-	fbptr_t *dst = (fbptr_t *)pcons->fbbase +
-				  pcons->lcdsizex -
-				  (rowdst*VIDEO_FONT_HEIGHT+1);
-
-	fbptr_t *src = (fbptr_t *)pcons->fbbase +
-				  pcons->lcdsizex -
-				  (rowsrc*VIDEO_FONT_HEIGHT+1);
-
-	for (j = 0; j < pcons->lcdsizey; j++) {
-		for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
-			*dst-- = *src--;
-		src += (pcons->lcdsizex + VIDEO_FONT_HEIGHT);
-		dst += (pcons->lcdsizex + VIDEO_FONT_HEIGHT);
-	}
-}
-static void lcd_putc_xy180(struct console_t *pcons, ushort x, ushort y, char c)
-{
-	int fg_color = lcd_getfgcolor();
-	int bg_color = lcd_getbgcolor();
-	int i, row;
-	fbptr_t *dst = (fbptr_t *)pcons->fbbase +
-				  pcons->lcdsizex +
-				  pcons->lcdsizey * pcons->lcdsizex -
-				  y * pcons->lcdsizex -
-				  (x+1);
-
-	for (row = 0; row < VIDEO_FONT_HEIGHT; row++) {
-		uchar bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
-
-		for (i = 0; i < VIDEO_FONT_WIDTH; ++i) {
-			*dst-- = (bits & 0x80) ? fg_color : bg_color;
-			bits <<= 1;
-		}
-		dst -= (pcons->lcdsizex - VIDEO_FONT_WIDTH);
-	}
-}
-
-static inline void console_setrow180(struct console_t *pcons, u32 row, int clr)
-{
-	int i;
-	fbptr_t *dst = (fbptr_t *)pcons->fbbase +
-				  (pcons->rows-row-1) * VIDEO_FONT_HEIGHT *
-				  pcons->lcdsizex;
-
-	for (i = 0; i < (VIDEO_FONT_HEIGHT * pcons->lcdsizex); i++)
-		*dst++ = clr;
-}
-
-static inline void console_moverow180(struct console_t *pcons,
-				      u32 rowdst, u32 rowsrc)
-{
-	int i;
-	fbptr_t *dst = (fbptr_t *)pcons->fbbase +
-				  (pcons->rows-rowdst-1) * VIDEO_FONT_HEIGHT *
-				  pcons->lcdsizex;
-
-	fbptr_t *src = (fbptr_t *)pcons->fbbase +
-				  (pcons->rows-rowsrc-1) * VIDEO_FONT_HEIGHT *
-				  pcons->lcdsizex;
-
-	for (i = 0; i < (VIDEO_FONT_HEIGHT * pcons->lcdsizex); i++)
-		*dst++ = *src++;
-}
-
-static void lcd_putc_xy270(struct console_t *pcons, ushort x, ushort y, char c)
-{
-	int fg_color = lcd_getfgcolor();
-	int bg_color = lcd_getbgcolor();
-	int i, col;
-	fbptr_t *dst = (fbptr_t *)pcons->fbbase +
-				  pcons->lcdsizey * pcons->lcdsizex -
-				  (x+1) * pcons->lcdsizex +
-				  y;
-
-	uchar msk = 0x80;
-	uchar *pfont = video_fontdata + c * VIDEO_FONT_HEIGHT;
-	for (col = 0; col < VIDEO_FONT_WIDTH; ++col) {
-		for (i = 0; i < VIDEO_FONT_HEIGHT; ++i)
-			*dst++ = (*(pfont + i) & msk) ? fg_color : bg_color;
-		msk >>= 1;
-		dst -= (pcons->lcdsizex + VIDEO_FONT_HEIGHT);
-	}
-}
-
-static inline void console_setrow270(struct console_t *pcons, u32 row, int clr)
-{
-	int i, j;
-	fbptr_t *dst = (fbptr_t *)pcons->fbbase +
-				  row*VIDEO_FONT_HEIGHT;
-
-	for (j = 0; j < pcons->lcdsizey; j++) {
-		for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
-			*dst++ = clr;
-		dst += (pcons->lcdsizex - VIDEO_FONT_HEIGHT);
-	}
-}
-
-static inline void console_moverow270(struct console_t *pcons,
-				     u32 rowdst, u32 rowsrc)
-{
-	int i, j;
-	fbptr_t *dst = (fbptr_t *)pcons->fbbase +
-				  rowdst*VIDEO_FONT_HEIGHT;
-
-	fbptr_t *src = (fbptr_t *)pcons->fbbase +
-				  rowsrc*VIDEO_FONT_HEIGHT;
-
-	for (j = 0; j < pcons->lcdsizey; j++) {
-		for (i = 0; i < VIDEO_FONT_HEIGHT; i++)
-			*dst++ = *src++;
-		src += (pcons->lcdsizex - VIDEO_FONT_HEIGHT);
-		dst += (pcons->lcdsizex - VIDEO_FONT_HEIGHT);
-	}
-}
-
-static void console_calc_rowcol_rot(struct console_t *pcons)
-{
-	if (pcons->lcdrot == 1 || pcons->lcdrot == 3)
-		console_calc_rowcol(pcons, pcons->lcdsizey, pcons->lcdsizex);
-	else
-		console_calc_rowcol(pcons, pcons->lcdsizex, pcons->lcdsizey);
-}
-
-void lcd_init_console_rot(struct console_t *pcons)
-{
-	if (pcons->lcdrot == 0) {
-		return;
-	} else if (pcons->lcdrot == 1) {
-		pcons->fp_putc_xy = &lcd_putc_xy90;
-		pcons->fp_console_moverow = &console_moverow90;
-		pcons->fp_console_setrow = &console_setrow90;
-	} else if (pcons->lcdrot == 2) {
-		pcons->fp_putc_xy = &lcd_putc_xy180;
-		pcons->fp_console_moverow = &console_moverow180;
-		pcons->fp_console_setrow = &console_setrow180;
-	} else if (pcons->lcdrot == 3) {
-		pcons->fp_putc_xy = &lcd_putc_xy270;
-		pcons->fp_console_moverow = &console_moverow270;
-		pcons->fp_console_setrow = &console_setrow270;
-	} else {
-		printf("%s: invalid framebuffer rotation (%d)!\n",
-		       __func__, pcons->lcdrot);
-		return;
-	}
-	console_calc_rowcol_rot(pcons);
-}
-- 
2.38.0.413.g74048e4d9e-goog



More information about the U-Boot mailing list