diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2024-07-01 09:40:11 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2024-07-01 09:50:33 -0400 |
commit | 5f26f21ab2bb4ecc09f983798e4641ac335f98d6 (patch) | |
tree | 355dc412dc3c82d35eadf79d4d398707494f1c34 | |
parent | 311f27606cb7de8b25b904b2a910d8c3623d2d79 (diff) | |
download | rockbox-5f26f21ab2.tar.gz rockbox-5f26f21ab2.zip |
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
-rw-r--r-- | firmware/target/hosted/samsungypr/lcd-ypr.c | 14 |
1 files 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); |