RTEMS  5.1
Data Structures | Macros | Enumerations | Functions | Variables
fb_vesa_rm.c File Reference

FB driver for graphic hardware compatible with VESA Bios Extension Real mode interface utilized Tested on real HW. More...

#include <inttypes.h>
#include <bsp.h>
#include <bsp/fb_default_mode.h>
#include <bsp/fb_vesa.h>
#include <bsp/realmode_int.h>
#include <pthread.h>
#include <rtems/libio.h>
#include <rtems/fb.h>
#include <rtems/framebuffer.h>
#include <rtems/score/atomic.h>
#include <stdlib.h>

Data Structures

struct  Mode_params
 Basic graphic's mode parameters. More...
 

Macros

#define FB_VESA_NAME   "FB_VESA_RM"
 
#define MAX_NO_OF_SORTED_MODES   100
 

Enumerations

enum  mode_err_ret_val {
  NO_SUITABLE_MODE = -1, BAD_FORMAT = -2, AUTO_SELECT = -3, DONT_INIT = -4,
  NO_MODE_REQ = -5, NO_SUITABLE_MODE = -1, BAD_FORMAT = -2, AUTO_SELECT = -3,
  DONT_INIT = -4, NO_MODE_REQ = -5
}
 

Functions

void vesa_realmode_bootup_init (void)
 Initializes VBE framebuffer during bootup. More...
 
uint32_t VBE_controller_information (VBE_vbe_info_block *info_block, uint16_t queried_VBE_Version)
 Returns information about graphic's controller in the info_block structure. More...
 
uint32_t VBE_mode_information (VBE_mode_info_block *info_block, uint16_t mode_number)
 Fills structure info_block with informations about selected mode in mode_number variable. More...
 
uint32_t VBE_set_mode (uint16_t mode_number, VBE_CRTC_info_block *info_block)
 Sets graphics mode selected. If mode has refreshRateCtrl bit set, than the info_block must be filled accordingly. More...
 
uint32_t VBE_current_mode (uint16_t *mode_number)
 Get currently set mode number. More...
 
uint32_t VBE_report_DDC_capabilities (uint16_t controller_unit_number, uint8_t *seconds_to_transfer_EDID_block, uint8_t *DDC_level_supported)
 Gets information about display data channel implemented in the graphic's controller. More...
 
uint32_t VBE_read_EDID (uint16_t controller_unit_number, uint16_t EDID_block_number, EDID_edid1 *buffer)
 Reads selected EDID block from display attached to controller's interface. More...
 
rtems_device_driver frame_buffer_initialize (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
 Frame Buffer Initialization Entry Point. More...
 
rtems_device_driver frame_buffer_open (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
 Frame Buffer Open Entry Point. More...
 
rtems_device_driver frame_buffer_close (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
 Frame Buffer Close Entry Point. More...
 
rtems_device_driver frame_buffer_read (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
 Frame Buffer Read Entry Point. More...
 
rtems_device_driver frame_buffer_write (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
 Frame Buffer Write Entry Point. More...
 
rtems_device_driver frame_buffer_control (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
 Frame Buffer IO Control Entry Point. More...
 

Variables

const char *const rtems_fb_default_mode
 Allows to enable initialization of VESA real mode driver from an application by setting the value of this variable to non null value in user's module. The value of this variable will be then updated when linked with application's object. More...
 

Detailed Description

FB driver for graphic hardware compatible with VESA Bios Extension Real mode interface utilized Tested on real HW.

Public sources related:

Hardware is completely initialized upon boot of the system. Therefore there is no way to change graphics mode later.

Interrupt 0x10 is used for entering graphics BIOS.

Driver reads parameter from multiboot command line to setup video: "--video=<resX>x<resY>[-<bpp>]" "--video=auto" - try EDID to find mode that fits the display attached best "--video=none" / "--video=off" - do not initialize the driver If cmdline parameter is not specified the rtems_fb_default_mode variable content is tested (see doc below). Command line option has higher priority. rtems_fb_default_mode is probed only if cmdline "--video=" is not specified at all.

If neither of the above options is specified the driver is not initialized.

Function Documentation

◆ frame_buffer_close()

rtems_device_driver frame_buffer_close ( rtems_device_major_number  major,
rtems_device_minor_number  minor,
void *  arg 
)

Frame Buffer Close Entry Point.

This method closes a specific device supported by the frame buffer device driver.

Parameters
[in]majoris the device driver major number
[in]minoris the device driver minor number
[in]argis the parameters to this call
Returns
This method returns RTEMS_SUCCESSFUL when the device is successfully closed.

◆ frame_buffer_control()

rtems_device_driver frame_buffer_control ( rtems_device_major_number  major,
rtems_device_minor_number  minor,
void *  arg 
)

Frame Buffer IO Control Entry Point.

This method performs an IO Control operation on a specific device supported by the frame buffer device driver.

Parameters
[in]majoris the device driver major number
[in]minoris the device driver minor number
[in]argis the parameters to this call
Returns
This method returns RTEMS_SUCCESSFUL when the device driver IO control operation is successfully performed.

◆ frame_buffer_initialize()

rtems_device_driver frame_buffer_initialize ( rtems_device_major_number  major,
rtems_device_minor_number  minor,
void *  arg 
)

Frame Buffer Initialization Entry Point.

This method initializes the frame buffer device driver.

Parameters
[in]majoris the device driver major number
[in]minoris the device driver minor number
[in]argis the parameters to this call
Returns
This method returns RTEMS_SUCCESSFUL when the device driver is successfully initialized.

◆ frame_buffer_open()

rtems_device_driver frame_buffer_open ( rtems_device_major_number  major,
rtems_device_minor_number  minor,
void *  arg 
)

Frame Buffer Open Entry Point.

This method opens a specific device supported by the frame buffer device driver.

Parameters
[in]majoris the device driver major number
[in]minoris the device driver minor number
[in]argis the parameters to this call
Returns
This method returns RTEMS_SUCCESSFUL when the device driver is successfully opened.

◆ frame_buffer_read()

rtems_device_driver frame_buffer_read ( rtems_device_major_number  major,
rtems_device_minor_number  minor,
void *  arg 
)

Frame Buffer Read Entry Point.

This method reads from a specific device supported by the frame buffer device driver.

Parameters
[in]majoris the device driver major number
[in]minoris the device driver minor number
[in]argis the parameters to this call
Returns
This method returns RTEMS_SUCCESSFUL when the device is successfully read from.

◆ frame_buffer_write()

rtems_device_driver frame_buffer_write ( rtems_device_major_number  major,
rtems_device_minor_number  minor,
void *  arg 
)

Frame Buffer Write Entry Point.

This method writes to a specific device supported by the frame buffer device driver.

Parameters
[in]majoris the device driver major number
[in]minoris the device driver minor number
[in]argis the parameters to this call
Returns
This method returns RTEMS_SUCCESSFUL when the device is successfully written.

◆ VBE_controller_information()

uint32_t VBE_controller_information ( VBE_vbe_info_block *  info_block,
uint16_t  queried_VBE_Version 
)

Returns information about graphic's controller in the info_block structure.

Parameters
[out]info_blockpointer to the struct to be filled with controller information
[in]queried_VBE_Versionif >0x200 then video bios is asked to fill in parameters which appeared with second version of VBE.
Return values
axregister content as defined in VBE RETURN STATUS paragraph
-1error calling graphical bios

◆ VBE_current_mode()

uint32_t VBE_current_mode ( uint16_t *  mode_number)

Get currently set mode number.

Parameters
[out]mode_numbervariable to be filled with current mode number
Return values
axregister content as defined in VBE RETURN STATUS paragraph
-1error calling graphical bios

◆ VBE_mode_information()

uint32_t VBE_mode_information ( VBE_mode_info_block *  info_block,
uint16_t  mode_number 
)

Fills structure info_block with informations about selected mode in mode_number variable.

Parameters
[out]info_blockpointer to the struct to be filled with mode information
[in]mode_numberdetailes of this mode to be filled
Return values
axregister content as defined in VBE RETURN STATUS paragraph
-1error calling graphical bios

◆ VBE_read_EDID()

uint32_t VBE_read_EDID ( uint16_t  controller_unit_number,
uint16_t  EDID_block_number,
EDID_edid1 *  buffer 
)

Reads selected EDID block from display attached to controller's interface.

Parameters
[in]controller_unit_number
[in]EDID_block_numberblock no. to be read from the display
[out]bufferplace to store block fetched from the display
Return values
axregister content as defined in VBE RETURN STATUS paragraph
-1error calling graphical bios

◆ VBE_report_DDC_capabilities()

uint32_t VBE_report_DDC_capabilities ( uint16_t  controller_unit_number,
uint8_t *  seconds_to_transfer_EDID_block,
uint8_t *  DDC_level_supported 
)

Gets information about display data channel implemented in the graphic's controller.

Parameters
[in]controller_unit_number
[out]seconds_to_transfer_EDID_blockapproximate time to transfer one EDID block rounded up to seconds
[out]DDC_level_supportedcontains DDC version supported and screen blanking state during transfer
Return values
axregister content as defined in VBE RETURN STATUS paragraph
-1error calling graphical bios

◆ VBE_set_mode()

uint32_t VBE_set_mode ( uint16_t  mode_number,
VBE_CRTC_info_block *  info_block 
)

Sets graphics mode selected. If mode has refreshRateCtrl bit set, than the info_block must be filled accordingly.

Parameters
[in]mode_numbernumber of mode to be set
[in]info_blockpointer to struct containing refresh rate control info
Return values
axregister content as defined in VBE RETURN STATUS paragraph
-1error calling graphical bios

◆ vesa_realmode_bootup_init()

void vesa_realmode_bootup_init ( void  )

Initializes VBE framebuffer during bootup.

utilizes switches to real mode interrupts and therefore must be called during bootup before tick is set up and real-time interrupt vectors utilized

Variable Documentation

◆ rtems_fb_default_mode

const char* const rtems_fb_default_mode

Allows to enable initialization of VESA real mode driver from an application by setting the value of this variable to non null value in user's module. The value of this variable will be then updated when linked with application's object.

Further the value should point to string in the following format: "<resX>x<resY>[-<bpp>]" - e.g. "1024x768-32" "auto" - try EDID to find mode that fits the display attached best "none" / "off" - do not initialize the driver the given parameters are used if applicable.

Command line argument "--video=" has priority over this string.