ARM: riscpc: parse video information from tagged list
authorRussell King <rmk+kernel@armlinux.org.uk>
Sat, 27 Apr 2019 22:06:03 +0000 (23:06 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Tue, 11 Jun 2019 16:40:50 +0000 (17:40 +0100)
Correctly parse the video information from the tagged list, so that we
end up with the right bytes-per-char values.  When booting with a
tagged list rather than a param block, this allows the decompressor to
display its messages during boot on the screen.

(Boot loaders normally pass a param block on this platform, but the
latest boot loader version recently released does not.)

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/mach-rpc/include/mach/uncompress.h

index 654a6f3f2547d25bebeb628ab603c3d1cec4de68..edc1961e8d1e6de58b7c0046d23eb4c1d90472c6 100644 (file)
@@ -118,29 +118,22 @@ static void arch_decomp_setup(void)
        struct tag *t = (struct tag *)params;
        unsigned int nr_pages = 0, page_size = PAGE_SIZE;
 
-       if (t->hdr.tag == ATAG_CORE)
-       {
-               for (; t->hdr.size; t = tag_next(t))
-               {
-                       if (t->hdr.tag == ATAG_VIDEOTEXT)
-                       {
+       if (t->hdr.tag == ATAG_CORE) {
+               for (; t->hdr.size; t = tag_next(t)) {
+                       if (t->hdr.tag == ATAG_VIDEOTEXT) {
                                video_num_rows = t->u.videotext.video_lines;
                                video_num_cols = t->u.videotext.video_cols;
-                               bytes_per_char_h = t->u.videotext.video_points;
-                               bytes_per_char_v = t->u.videotext.video_points;
                                video_x = t->u.videotext.x;
                                video_y = t->u.videotext.y;
-                       }
-
-                       if (t->hdr.tag == ATAG_MEM)
-                       {
+                       } else if (t->hdr.tag == ATAG_VIDEOLFB) {
+                               bytes_per_char_h = t->u.videolfb.lfb_depth;
+                               bytes_per_char_v = 8;
+                       } else if (t->hdr.tag == ATAG_MEM) {
                                page_size = PAGE_SIZE;
                                nr_pages += (t->u.mem.size / PAGE_SIZE);
                        }
                }
-       }
-       else
-       {
+       } else {
                nr_pages = params->nr_pages;
                page_size = params->page_size;
                video_num_rows = params->video_num_rows;