frame buffer init now reads splash screen data from resources
This commit is contained in:
		
							parent
							
								
									bda9fc6883
								
							
						
					
					
						commit
						c30d15742c
					
				
							
								
								
									
										22
									
								
								src/fbinit.c
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								src/fbinit.c
									
									
									
									
									
								
							@ -29,11 +29,7 @@
 | 
				
			|||||||
#include "log.h"
 | 
					#include "log.h"
 | 
				
			||||||
#include "fbinit.h"
 | 
					#include "fbinit.h"
 | 
				
			||||||
#include "scode.h"
 | 
					#include "scode.h"
 | 
				
			||||||
 | 
					#include "resources.h"
 | 
				
			||||||
/* references to splash screen data in splash.o/splash.bin */
 | 
					 | 
				
			||||||
extern uint8_t _binary_splash_bin_start[];
 | 
					 | 
				
			||||||
extern uint8_t _binary_splash_bin_end;
 | 
					 | 
				
			||||||
extern uint8_t _binary_splash_bin_size;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int fb_fd = -1;   /* framebuffer file descriptor */
 | 
					static int fb_fd = -1;   /* framebuffer file descriptor */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -62,6 +58,8 @@ static void do_cleanup(void)
 | 
				
			|||||||
HRESULT Fb_setup(void)
 | 
					HRESULT Fb_setup(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  HRESULT hr = S_OK;
 | 
					  HRESULT hr = S_OK;
 | 
				
			||||||
 | 
					  HRESULT hr2 = S_OK;
 | 
				
			||||||
 | 
					  HRSRC splash;
 | 
				
			||||||
  struct fb_fix_screeninfo fixed;
 | 
					  struct fb_fix_screeninfo fixed;
 | 
				
			||||||
  struct fb_var_screeninfo var;
 | 
					  struct fb_var_screeninfo var;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -84,7 +82,7 @@ HRESULT Fb_setup(void)
 | 
				
			|||||||
  local_info.linebytes = fixed.line_length;
 | 
					  local_info.linebytes = fixed.line_length;
 | 
				
			||||||
  local_info.screenbytes = fixed.smem_len;
 | 
					  local_info.screenbytes = fixed.smem_len;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /* variable info is used to get scren geometry and color info */
 | 
					  /* variable info is used to get screen geometry and color info */
 | 
				
			||||||
  if (ioctl(fb_fd, FBIOGET_VSCREENINFO, &var))
 | 
					  if (ioctl(fb_fd, FBIOGET_VSCREENINFO, &var))
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    hr = ERRNO_AS_SCODE;
 | 
					    hr = ERRNO_AS_SCODE;
 | 
				
			||||||
@ -118,8 +116,16 @@ HRESULT Fb_setup(void)
 | 
				
			|||||||
    return hr;
 | 
					    return hr;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /* display the splash screen */
 | 
					  /* The splash screen is in the system resources.  Use the resource API to load it straight to the frame buffer. */
 | 
				
			||||||
  memcpy(Fb_Ptr, _binary_splash_bin_start, (size_t)(&_binary_splash_bin_size));
 | 
					  hr2 = Rsrc_find_resource(NULL, "splash.bin", NULL, &splash);
 | 
				
			||||||
 | 
					  if (SUCCEEDED(hr2))
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    ASSERT(Rsrc_sizeof_resource(splash) == fixed.smem_len);
 | 
				
			||||||
 | 
					    hr2 = Rsrc_read_resource_here(splash, Fb_Ptr, fixed.smem_len, NULL);
 | 
				
			||||||
 | 
					    Rsrc_free_resource(splash);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  if (FAILED(hr2))
 | 
				
			||||||
 | 
					    Log(LWARN, "splash screen rendering failed (%08X)", hr2);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  hr = Config_exitfunc(do_cleanup);
 | 
					  hr = Config_exitfunc(do_cleanup);
 | 
				
			||||||
  if (FAILED(hr))
 | 
					  if (FAILED(hr))
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user