Archive for the ‘Graphics’ Category


EGL is an interface between Khronos rendering APIs such as OpenGL ES or OpenVG and the underlying native platform window system.

It mainly handles the following tasks in Graphics System:

  • Graphics context management
  • surface/buffer binding
  • rendering synchronization
  • enabling “high performance, accelerated, mixed-mode 2D and 3D rendering using Khronos APIs”

EGL replaces GLX/AGL/WGL with a platform independent implementation.

Procedures to use EGL to render:

  1. Get EGLDisplay Object
  2. Initialize the connection with EGLDisplay Object
  3. Get EGLConfig Object
  4. Create EGLContext instance
  5. Create EGLSurface instance
  6. Connect EGLContext and EGLSurface
  7. Use GL command to render
  8. Disconnect and release EGLSurface connected with EGLContext
  9. Delete EGLSurface
  10. Delete EGLContext
  11. Disconnect EGLDisplay

Read Full Post »

Double Buffering

Computer Graphics Double Buffering

In Computer Graphics, double buffering is a technique for drawing graphics that shows no flicker/tearing, etc.

To update a page of text, it is much easier to clear the entire page and then draw the letter than to somehow erase all the pixels that are not in both the old and new letters. However, this intermediate image is seen by the user as flickering. In addition, computer monitor redraw the visible video page, so even a perfect update should be visible momentarily as a horizontal divider between the new image and the old image, known as tearing.

A software implementation of double buffering has all drawing operations store their results in some region of system RAM.and such region is called a back buffer.

When all drawing operations are considered complete, the whole region is copied into the video RAM(called front buffer).

This copying is usually synchronized with the monitor’s raster beam in order to avoid tearing. Double buffering necessarily requires more video memory and CPU times

for the date copying.

Page Flipping

Instead of copying the data, both buffers are capable of being displayed(both allocated in Video RAM). At any one time, one buffer is being displayed and the other is being drawn.

When drawing is completed, the roles of the two buffer are switched.

Page flipping is much faster than copying the data and can guarantee that tearing will not be seen as long as the pages flipping during the monitor’s vertical blank period when no video data

is being drawn. The currently active buffer is called front buffer and the background page is called the back buffer.

Read Full Post »


ProcCreateWindow() extracts the fields of the xCreateWindowReq request sent by the client to use them as arguments for a CreateWindow() call:

pWin = CreateWindow(stuff->wid, pParent, stuff->x, stuff->y, stuff->width, stuff->height, …, (XID *)&stuff[1], …) (more…)

Read Full Post »


GART — From DRI wiki

PCIe&AGP graphics hardware is dedicated high-speed bus that allow the graphics controller to fetch large amount of data directly from system memory. It uses a Graphics Address Re-mapping Table to provide a physical-contiguous view of scattered pages in system memory for DMA transfers.

Main memory is specifically used for advanced three-dimensional features, such as textures, alpha buffers …

There are two primary usage models for PCIe&AGP:

  • DMA ::: In the DMA model, the primary graphics memory is the local memory associated with the accelerator, referred to as the local frame buffer. 3D structures are stored in system memory, but are not used (or executed) directly from this memory; rather they are copied to primary (local) memory (the DMA operation) to which the rendering engine’s address generator makes its references. This implies that the traffic on the AGP tends to be long, sequential transfers, serving the purpose of bulk data transport from system memory to primary graphics (local) memory. This sort of access model is amenable to a linked list of physical addresses provided by software (similar to the operation of a disk or network I/O device), and is generally not sensitive to a non-contiguous view of the memory space.
  • execute ::: In the execute model, the accelerator uses both the local memory and the system memory as primary graphics memory. From the accelerator’s perspective, the two memory systems are logically equivalent; any data structure may be allocated in either memory, with performance optimization as the only criterion for selection. In general, structures in system memory space are not copied into the local memory prior to use by the accelerator, but are executed in place. This implies that the traffic on the AGP tends to be short, random accesses, which are not amenable to an access model based on software resolved lists of physical addresses. Because the accelerator generates direct references into system memory, a contiguous view of that space is essential; however, since system memory is dynamically allocated in random 4K pages, it is necessary in the execute model to provide an address mapping mechanism that maps random 4K pages into a single contiguous, physical address space


Read Full Post »

  • Verify with ATI tools


$ fglrxinfo display: :0.0 screen: 0 OpenGL vendor string: ATI Technologies Inc. OpenGL renderer string: Radeon X1600 Series OpenGL version string: 2.1.7415 Release

if the vendor string is mesa, the driver wouldn’t configure properly the /etc/X11/xorg.conf

  • Verify with Linux Tools


This command line option should report “direct” rendering


X server log file also contains useful info about driver installation.

  • Configuring


aticonfig –initial (creates device section using fglrx)

aticonfig –overlay-type=Xv (Enable Video acceleration Xv Overlay)



Read Full Post »