RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

GraphicsV

Programmer's Reference Manuals
» Vectors
» Software Vector Numbers
» GraphicsV

Graphics Vector (42)

Entry  
R4 Bits 0-23: Reason Code
Bits 24-31: Driver number
Other registers dependant on call

Use

This vector is used by the RISC OS 5 kernel to communicate with the video driver.

User software should always aim to use the appropriate OS SWI instead of calling GraphicsV directly. The information presented here is mainly of use to OS maintainers and video driver developers.

R4 is used by all GraphicsV calls to store both the reason code and to indicate whether the call has been claimed (i.e. acted upon by a driver). When a driver claims a call it will set R4 to zero. By checking R4 after calling GraphicsV it is possible to determine whether the driver supports that call or not.

Reason Codes

#   Context1
0 Null reason code for when vector has been claimed
1 VSync interrupt occurred BG SVC/IRQ
2 Set mode FG2 SVC
3 Set interlace3 FG SVC
4 Set blank FG/BG SVC
5 Update pointer FG/BG SVC/IRQ
6 Set DAG FG/BG SVC/IRQ
7 Vet mode FG SVC
8 Features FG SVC
9 Framestore information FG SVC
10 Write palette entry FG/BG SVC/IRQ
11 Write palette entries FG/BG SVC/IRQ
12 Read palette entry FG SVC
13 Render FG SVC
14 IIC op FG SVC
15 Select head FG SVC
16 Select startup mode FG SVC
17 List pixel formats FG SVC
18 Read info FG SVC
19 Vet mode 2 FG SVC

Notes

Driver registration and deregistration

GraphicsV based video drivers should perform the following sequence of events on startup:

  1. Call OS_ScreenMode 64 to request a driver number
  2. Store the number, for use by their GraphicsV handler
  3. Call OS_Claim to install their GraphicsV handler
  4. Start generating VSync calls if possible
  5. Perform any other initialisation that’s required to prepare the driver/hardware
  6. Call OS_ScreenMode 65 to let the OS know that the driver is ready for use

Once OS_ScreenMode 65 is called the driver should expect to start receiving GraphicsV calls from the OS and from other software. Before that point no calls should be received, and if they are then it’s a bug in someone else’s code and not yours.

On shutdown drivers should use the following sequence:

  1. Call OS_ScreenMode 66 to indicate that the driver is stopping. Once this call returns the driver should no longer receive GraphicsV calls.
  2. Halt generation of VSync calls
  3. Call OS_Release to release the GraphicsV handler
  4. Call OS_ScreenMode 67 to release the driver number and allow it to be allocated for use by other drivers.

Note that OS_ScreenMode reasons 64-67 must only be called from the foreground.

See also HAL Video API for details on how the OS translates GraphicsV calls to HAL calls for systems which contain a video driver in their HAL.

1 Calling contexts

GraphicsV drivers can be called under a variety of different situations. Consult the table above, and the list below, to determine the situations in which each entry point may be called and how the implementation is allowed to behave.

  • FG – These calls must only made from the foreground, with interrupts enabled. Calls marked “BG” or “FG/BG” may be called while a foreground call is in progress, but no other foreground calls should occur. Foreground calls are allowed to block for long periods of time, and are allowed to enable/disable interrupts at will.
  • BG – These calls must only be made from the background, i.e. from within an interrupt handler. The implementation must execute quickly and in a non-blocking manner. On entry, interrupt state is undefined. Drivers may disable interrupts as required, but should not enable them if they were disabled on entry. The implementation must also be fully re-entrant, as the same (or a different) background call may be made while the first is in progress.
  • FG/BG – These calls may be made from the foreground or the background. The same execution rules as background calls apply – the implementation must be fast, non-blocking, must not enable interrupts if they were disabled on entry, and must be re-entrant with other driver calls.
  • SVC – These calls are only made from supervisor mode.
  • SVC/IRQ – The kernel may call these entries from SVC or IRQ mode. Therefore care must be taken to preserve R14_svc around any SWI calls.

2 GraphicsV 2

As an addition to the above rules, drivers are free to ignore any background calls they receive while they are in the middle of processing a mode change.

3 GraphicsV 3

This call is obsolete. Interlace settings should be specified via the VIDC list given to GraphicsV 2/7.

See also

  • Software Vector Numbers
  • OS_ScreenMode
  • HAL Video API
Other languages documentation

Français

Revised on May 6, 2019 14:28:13 by Sprow (202)? (82.153.112.232)
Edit | Back in time (13 revisions) | See changes | History | Views: Print | Source | Linked from: HAL_VideoBufferAlignment, HAL_VideoFeatures, HAL_VideoReadPaletteEntry, HAL_VideoUpdatePointer, HAL_VideoFlybackDevice, HAL_VideoSetMode, HAL_VideoSetPowerSave, HAL_VideoWritePaletteEntry, HAL_VideoVetMode, HAL_VideoSetBlank, HAL_VideoSetDAG, HAL_VideoIICOp, HAL_VideoRender, Software Vector Numbers, Software Vectors, HAL Video API, HAL_VideoOutputFormat, HAL_VideoSetInterlace, HAL_VideoPixelFormats, HAL_VideoWritePaletteEntries, GraphicsV 1, GraphicsV 2, GraphicsV 3, GraphicsV 7, GraphicsV 6, GraphicsV 4, GraphicsV 10, GraphicsV 11, GraphicsV 12, GraphicsV 14, GraphicsV 13 0, GraphicsV 13 1, GraphicsV 5, GraphicsV 15, GraphicsV 13, HAL_VideoFramestoreAddress, GraphicsV 9, GraphicsV 8, GraphicsV palette colours, GraphicsV 13 2, Proposed GraphicsV enhancements, OS_ScreenMode 11, HAL_VideoStartupMode, GraphicsV 17, GraphicsV 16, OS_ScreenMode 66, OS_ScreenMode 64, OS_ScreenMode 68, Service_DisplayStatus, Service_DisplayChanged, OS_ScreenMode 65, GraphicsV 18, HAL_VideoPixelFormatList, VDU Variables, GraphicsV 19, NVidia, ScreenModes_Features, OS_ScreenMode 67, OS_ScreenMode 68 (français), OS_ScreenMode 67 (français), OS_ScreenMode 66 (français), OS_ScreenMode 65 (français), GraphicsV (français), OS_ScreenMode 64 (français)

Search the Wiki

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys