if (mode->depth == 8) fb_init_palette_332(mode);
else fb_init_palette_linear(mode);
- INF("%ux%u, bitdepth=%u (%u bits), depth=%u, refresh=%u",
+ INF("%ux%u, bpp=%u (%u bits), depth=%u, refresh=%u",
mode->width, mode->height, mode->bpp,
mode->fb_var.bits_per_pixel, mode->depth, mode->refresh);
return mode;
return -1;
}
- DBG("%ux%u, bitdepth=%u (%u bits), depth=%u, refresh=%u, fb=%d",
+ DBG("%ux%u, bpp=%u (%u bits), depth=%u, refresh=%u, fb=%d",
mode->width, mode->height, mode->bpp,
mode->fb_var.bits_per_pixel, mode->depth, mode->refresh, fb);
fb_cleanup();
return -1;
}
+
+ mode->stride = fb_fix.line_length / mode->bpp;
+ if (mode->stride < mode->width)
+ {
+ CRI("stride=%u < width=%u", mode->stride, mode->width);
+ fb_cleanup();
+ return -1;
+ }
+ if (mode->stride * mode->bpp != fb_fix.line_length)
+ {
+ CRI("FSCREENINFO line_length=%u is not multiple of bpp=%u",
+ fb_fix.line_length, mode->bpp);
+ fb_cleanup();
+ return -1;
+ }
+
/* move viewport to upper left corner */
if ((mode->fb_var.xoffset != 0) || (mode->fb_var.yoffset != 0))
{
#endif
mode->fb_fd = fb;
- INF("%ux%u, bitdepth=%u (%u bits), depth=%u, refresh=%u, fb=%d, mem=%p, "
- "mem_offset=%u, xoffset=%u, yoffset=%u",
+ INF("%ux%u, bpp=%u (%u bits), depth=%u, refresh=%u, fb=%d, mem=%p, "
+ "mem_offset=%u, stride=%u pixels, offset=%u, yoffset=%u",
mode->width, mode->height, mode->bpp,
mode->fb_var.bits_per_pixel, mode->depth, mode->refresh, fb,
- mode->mem, mode->mem_offset,
+ mode->mem, mode->mem_offset, mode->stride,
mode->fb_var.xoffset, mode->fb_var.yoffset);
return fb;
DBG("size=%ux%u rot=%u depth=%u bitdepth=%u fb{"
"width=%u, height=%u, refresh=%u, depth=%u, bpp=%u, fd=%d, "
- "mem=%p, mem_offset=%u} "
+ "mem=%p, mem_offset=%u, stride=%u pixels} "
"mask{r=%#010x, g=%#010x, b=%#010x} conv_func=%p",
buf->w, buf->h, buf->rot, buf->depth,
buf->priv.fb.fb->fb_var.bits_per_pixel,
buf->priv.fb.fb->fb_fd,
buf->priv.fb.fb->mem,
buf->priv.fb.fb->mem_offset,
+ buf->priv.fb.fb->stride,
buf->priv.mask.r, buf->priv.mask.g, buf->priv.mask.b,
conv_func);
return NULL;
}
fb_fd = fb_postinit(buf->priv.fb.fb);
- DBG("fd=%d, mode=%ux%u, refresh=%u, depth=%u, bpp=%u, mem=%p (+%u)",
+ DBG("fd=%d, mode=%ux%u, refresh=%u, depth=%u, bpp=%u, mem=%p, "
+ "mem_offset=%u, stride=%u pixels",
fb_fd, buf->priv.fb.fb->width, buf->priv.fb.fb->height,
buf->priv.fb.fb->refresh, buf->priv.fb.fb->depth,
buf->priv.fb.fb->bpp, buf->priv.fb.fb->mem,
- buf->priv.fb.fb->mem_offset);
+ buf->priv.fb.fb->mem_offset, buf->priv.fb.fb->stride);
if (fb_fd < 1)
{
fb_freemode(buf->priv.fb.fb);
{
data = (DATA8 *)buf->priv.fb.fb->mem + buf->priv.fb.fb->mem_offset +
buf->priv.fb.fb->bpp *
- (x + (y * buf->priv.fb.fb->width));
+ (x + (y * buf->priv.fb.fb->stride));
conv_func = evas_common_convert_func_get(data, w, h, buf->priv.fb.fb->fb_var.bits_per_pixel,
buf->priv.mask.r, buf->priv.mask.g,
buf->priv.mask.b, PAL_MODE_NONE,
{
data = (DATA8 *)buf->priv.fb.fb->mem + buf->priv.fb.fb->mem_offset +
buf->priv.fb.fb->bpp *
- (buf->w - x - w + ((buf->h - y - h) * buf->priv.fb.fb->width));
+ (buf->w - x - w + ((buf->h - y - h) * buf->priv.fb.fb->stride));
conv_func = evas_common_convert_func_get(data, w, h, buf->priv.fb.fb->fb_var.bits_per_pixel,
buf->priv.mask.r, buf->priv.mask.g,
buf->priv.mask.b, PAL_MODE_NONE,
{
data = (DATA8 *)buf->priv.fb.fb->mem + buf->priv.fb.fb->mem_offset +
buf->priv.fb.fb->bpp *
- (buf->h - y - h + (x * buf->priv.fb.fb->width));
+ (buf->h - y - h + (x * buf->priv.fb.fb->stride));
conv_func = evas_common_convert_func_get(data, h, w, buf->priv.fb.fb->fb_var.bits_per_pixel,
buf->priv.mask.r, buf->priv.mask.g,
buf->priv.mask.b, PAL_MODE_NONE,
{
data = (DATA8 *)buf->priv.fb.fb->mem + buf->priv.fb.fb->mem_offset +
buf->priv.fb.fb->bpp *
- (y + ((buf->w - x - w) * buf->priv.fb.fb->width));
+ (y + ((buf->w - x - w) * buf->priv.fb.fb->stride));
conv_func = evas_common_convert_func_get(data, h, w, buf->priv.fb.fb->fb_var.bits_per_pixel,
buf->priv.mask.r, buf->priv.mask.g,
buf->priv.mask.b, PAL_MODE_NONE,
{
conv_func(src_data, data,
buf->w - w,
- buf->priv.fb.fb->width - w,
+ buf->priv.fb.fb->stride - w,
w, h,
x, y, NULL);
}
{
conv_func(src_data, data,
buf->w - w,
- buf->priv.fb.fb->width - h,
+ buf->priv.fb.fb->stride - h,
h, w,
x, y, NULL);
}
data = (DATA8 *)buf->priv.fb.fb->mem +
buf->priv.fb.fb->mem_offset +
buf->priv.fb.fb->bpp *
- (x + (y * buf->priv.fb.fb->width));
+ (x + (y * buf->priv.fb.fb->stride));
conv_func = evas_common_convert_func_get(data, w, h,
buf->priv.fb.fb->fb_var.bits_per_pixel,
buf->priv.mask.r, buf->priv.mask.g,
data = (DATA8 *)buf->priv.fb.fb->mem +
buf->priv.fb.fb->mem_offset +
buf->priv.fb.fb->bpp *
- (buf->w - x - w + ((buf->h - y - h) * buf->priv.fb.fb->width));
+ (buf->w - x - w + ((buf->h - y - h) * buf->priv.fb.fb->stride));
conv_func = evas_common_convert_func_get(data, w, h,
buf->priv.fb.fb->fb_var.bits_per_pixel,
buf->priv.mask.r, buf->priv.mask.g,
data = (DATA8 *)buf->priv.fb.fb->mem +
buf->priv.fb.fb->mem_offset +
buf->priv.fb.fb->bpp *
- (buf->h - y - h + (x * buf->priv.fb.fb->width));
+ (buf->h - y - h + (x * buf->priv.fb.fb->stride));
conv_func = evas_common_convert_func_get(data, h, w,
buf->priv.fb.fb->fb_var.bits_per_pixel,
buf->priv.mask.r, buf->priv.mask.g,
data = (DATA8 *)buf->priv.fb.fb->mem +
buf->priv.fb.fb->mem_offset +
buf->priv.fb.fb->bpp *
- (y + ((buf->w - x - w) * buf->priv.fb.fb->width));
+ (y + ((buf->w - x - w) * buf->priv.fb.fb->stride));
conv_func = evas_common_convert_func_get(data, h, w,
buf->priv.fb.fb->fb_var.bits_per_pixel,
buf->priv.mask.r, buf->priv.mask.g,
{
conv_func(src_data, data,
0,
- buf->priv.fb.fb->width - w,
+ buf->priv.fb.fb->stride - w,
w, h,
x, y, NULL);
}
{
conv_func(src_data, data,
0,
- buf->priv.fb.fb->width - h,
+ buf->priv.fb.fb->stride - h,
h, w,
x, y, NULL);
}