This chapter describes how to update an existing graphics driver to the new QNX Graphics Framework.
If you've written a driver using previous versions of the QNX Graphics DDK, you can update it to work with the current version using the instructions and tips in this chapter.
These are the general changes you'll need to make in your driver:
- The driver context is now split into two pieces, one to be shared across all clients, and one per client. The disp_adapter_t->shmem member points to the shared context.
- Memory is handled differently. You can no longer fall back on system RAM inside the graphics driver driver. You can't allocate video memory directly in draw functions. Instead, use disp_vm_alloc_surface_external().
- There's now two wait_idle() functions. The new wait_idle() in disp_draw_miscfuncs_t is called from io-display. The wait_idle() in disp_draw_corefuncs_t is called by external clients only.
- Make sure you supply disp_draw_miscfuncs_t.get_corefuncs_sw() and
disp_draw_miscfuncs_t.get_contextfuncs_sw().
- Make sure that disp_draw_corefuncs_t.wait_idle() is filled in regardless of the pixel format.
- Video synchronization: the driver sets the adapter->vsync_counter member to point to an array, with one element per display. The driver must increase this value open receipt of an interrupt, at least once per call to wait_vsync().
These are the changes to the Graphics Framework API from the previous version. You'll need to update your driver to include the new functions. Deprecated functions and structures will still compile, but are not used by the Framework.
- disp_adapter_t
- Deprecated:
- vid_ctx
- disp_modefuncs
- disp_memfuncs
- disp_draw_context_t
- Several changes, including:
Deprecated:
- alpha_map_width
- alpha_map_height
Changed:
alpha_map is a pointer to a disp_surface_t, not unsigned char
New:
unsigned plane_mask;
int clip_left;
int clip_top;
int clip_right;
int clip_bottom;
unsigned char *palette_lut;
disp_color_t *dest_palette;
int dest_palette_size;
disp_fx_t xform_matrix[4];
int xlate_x;
int xlate_y;
unsigned line_flags;
int line_join;
uint32_t line_pat;
int line_repeat;
int line_initial_offset;
int cap_style;
int poly_fill;
- disp_draw_contextfuncs_t
- New members:
void (*scaled_blit) (…);
void (*update_planemask) (…);
void (*draw_line) (…);
int (*fill_poly) (…);
int (*draw_polyline) (…);
void (*update_line) (…);
void (*blend_pixels) (…);
- disp_draw_miscfuncs_t
- These new functions are defined:
- disp_layer_query_t
- Has a new member, order_mask.
- disp_memfuncs_t
- New members:
int (*query_apertures) (…);
int (*query_surface) (…);
int (*get_alloc_info) (…);
int (*get_alloc_layer_info) (…);
- disp_modefuncs_t
-
Deprecated:
- set_scroll_position
- layer_select_format
Changed:
New:
int (*layer_set_order) (…);
int (*set_hw_cursor) (…);
void (*enable_hw_cursor) (…);
void (*disable_hw_cursor) (…);
void (*set_hw_cursor_pos) (…);
int (*i2c_read) (…);
int (*i2c_write) (…);
int (*i2c_writeread) (…);
- disp_vcapfuncs_t
- Deprecated:
- get_channel_caps
- get_channel_status
- set_channel_props
- close_channel
New:
int (*set_props)) (…);
int (*set_adjustments) (…);
int (*bind_layer) (…);
int (*set_enabled) (…);
void (*wait_vsync) (…);
- These video capture structures are deprecated:
-
- disp_vcap_channel_caps_t
- disp_vcap_channel_props_t (use disp_vcap_props_t instead)
- disp_vcap_channel_status_t
- These video scaler structures are deprecated:
-
- disp_vid_channel_caps_t
- disp_vid_channel_props_t
- dis_vidfuncs_t