From 5f26f21ab2bb4ecc09f983798e4641ac335f98d6 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Mon, 1 Jul 2024 09:40:11 -0400 Subject: samsungypr0/1: Minor improvements to framebuffer driver. * Distinct error codes for all failures * Corrected some comments and error messages The ypr0/r1 target should be switched over to the generic lcd-linuxfb driver, but that will come later. Change-Id: Idc3867a96db7e431847473708712f88dd2725a96 --- firmware/target/hosted/samsungypr/lcd-ypr.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/firmware/target/hosted/samsungypr/lcd-ypr.c b/firmware/target/hosted/samsungypr/lcd-ypr.c index b8db2eedd1..035abaeba7 100644 --- a/firmware/target/hosted/samsungypr/lcd-ypr.c +++ b/firmware/target/hosted/samsungypr/lcd-ypr.c @@ -66,17 +66,17 @@ void lcd_init_device(void) exit(2); } - /* Now we get the settable settings, and we set 16 bit bpp */ + /* Now we get the settable settings */ if (ioctl(dev_fd, FBIOGET_VSCREENINFO, &vinfo) == -1) { perror("Error reading variable information"); exit(3); } - vinfo.bits_per_pixel = LCD_DEPTH; + vinfo.bits_per_pixel = LCD_DEPTH; /* Explicitly set our desired depth */ if (ioctl(dev_fd, FBIOPUT_VSCREENINFO, &vinfo)) { - perror("fbset(ioctl)"); - exit(4); + perror("fbset(ioctl)"); + exit(4); } printf("%dx%d, %dbpp\n", vinfo.xres, vinfo.yres, vinfo.bits_per_pixel); @@ -84,17 +84,17 @@ void lcd_init_device(void) /* Figure out the size of the screen in bytes */ screensize = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel / 8; if (screensize != FRAMEBUFFER_SIZE) { - exit(4); perror("Display and framebuffer mismatch!\n"); + exit(5); } /* Map the device to memory */ dev_fb = mmap(0, screensize, PROT_READ | PROT_WRITE, MAP_SHARED, dev_fd, 0); if ((int)dev_fb == -1) { perror("Error: failed to map framebuffer device to memory"); - exit(4); + exit(6); } - printf("The framebuffer device was mapped to memory successfully.\n"); + printf("Framebuffer device successfully mapped into memory.\n"); /* Be sure to turn on display at startup */ ioctl(dev_fd, FBIOBLANK, VESA_NO_BLANKING); -- cgit v1.2.3