glcd driver: Add direct support for framebuffer with paged memory layout.

'struct glcd_framebuf' now contains a layout type which can either be
FB_TYPE_LINEAR (this is the default) or FB_TYPE_VPAGED. This actually affects
the drawing function and the frame-buffer memory calculation. A new 'size'
field is added to store the pre-calculated length.

Adopt existing driver to make use of the new feature (currently only glcd2usb
driver).
This commit is contained in:
mmdolze
2013-01-17 21:44:30 +00:00
parent 2f8df7fb35
commit 37563b5fd7
7 changed files with 91 additions and 77 deletions
+4 -2
View File
@@ -125,12 +125,14 @@ glcd_serdisp_init(Driver *drvthis)
ct_data->bsbuf.px_width = p->framebuf.px_width;
ct_data->bsbuf.px_height = p->framebuf.px_height;
ct_data->bsbuf.bytesPerLine = p->framebuf.bytesPerLine;
ct_data->bsbuf.data = malloc(ct_data->bsbuf.px_height * ct_data->bsbuf.bytesPerLine);
ct_data->bsbuf.size = p->framebuf.size;
ct_data->bsbuf.data = malloc(ct_data->bsbuf.size);
if (ct_data->bsbuf.data == NULL) {
report(RPT_ERR, "%s: error allocating backing store",
drvthis->name);
goto err_out;
}
memset(ct_data->bsbuf.data, 0x00, ct_data->bsbuf.px_height * ct_data->bsbuf.bytesPerLine);
memset(ct_data->bsbuf.data, 0x00, ct_data->bsbuf.size);
serdisp_clearbuffer(ct_data->disp);