RTEMS: bsps/i386/pc386/console/fb_vesa_rm.c File Reference

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions | Variables
fb_vesa_rm.c File Reference
Board Support Packages » i386

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.
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.
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.
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.
uint32_t | VBE_current_mode (uint16_t *mode_number)
| Get currently set mode number.
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.
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.
rtems_device_driver | frame_buffer_initialize (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
| Frame Buffer Initialization Entry Point.
rtems_device_driver | frame_buffer_open (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
| Frame Buffer Open Entry Point.
rtems_device_driver | frame_buffer_close (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
| Frame Buffer Close Entry Point.
rtems_device_driver | frame_buffer_read (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
| Frame Buffer Read Entry Point.
rtems_device_driver | frame_buffer_write (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
| Frame Buffer Write Entry Point.
rtems_device_driver | frame_buffer_control (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
| Frame Buffer IO Control Entry Point.

## 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.

## Detailed Description

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

Public sources related:

- VESA BIOS EXTENSION (VBE) Core Function Standard, Ver: 3.0, Sep 16, 1998
- VESA Enhanced Extended Display Identification Data (E-EDID) Standard Release A, Revision 2, September 25, 2006

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] | major | is the device driver major number
  [in] | minor | is the device driver minor number
  [in] | arg | is 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] | major | is the device driver major number
  [in] | minor | is the device driver minor number
  [in] | arg | is 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] | major | is the device driver major number
  [in] | minor | is the device driver minor number
  [in] | arg | is 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] | major | is the device driver major number
  [in] | minor | is the device driver minor number
  [in] | arg | is 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] | major | is the device driver major number
  [in] | minor | is the device driver minor number
  [in] | arg | is 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] | major | is the device driver major number
  [in] | minor | is the device driver minor number
  [in] | arg | is 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_block | pointer to the struct to be filled with controller information
  [in] | queried_VBE_Version | if >0x200 then video bios is asked to fill in parameters which appeared with second version of VBE.

Return values

  ax | register content as defined in VBE RETURN STATUS paragraph
  -1 | error calling graphical bios

## ◆ VBE_current_mode()

uint32_t VBE_current_mode | ( | uint16_t * | mode_number | ) |

Get currently set mode number.

Parameters

  [out] | mode_number | variable to be filled with current mode number

Return values

  ax | register content as defined in VBE RETURN STATUS paragraph
  -1 | error 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_block | pointer to the struct to be filled with mode information
  [in] | mode_number | detailes of this mode to be filled

Return values

  ax | register content as defined in VBE RETURN STATUS paragraph
  -1 | error 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_number | block no. to be read from the display
  [out] | buffer | place to store block fetched from the display

Return values

  ax | register content as defined in VBE RETURN STATUS paragraph
  -1 | error 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_block | approximate time to transfer one EDID block rounded up to seconds
  [out] | DDC_level_supported | contains DDC version supported and screen blanking state during transfer

Return values

  ax | register content as defined in VBE RETURN STATUS paragraph
  -1 | error 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_number | number of mode to be set
  [in] | info_block | pointer to struct containing refresh rate control info

Return values

  ax | register content as defined in VBE RETURN STATUS paragraph
  -1 | error 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.