[lib][display] update display_get_info to return success/failure

Update all the users to check for error.
This commit is contained in:
Travis Geiselbrecht
2015-10-08 15:54:40 -07:00
parent 9f72a0470e
commit c7ce0b9361
9 changed files with 39 additions and 21 deletions

View File

@@ -550,18 +550,21 @@ void virtio_gpu_gfx_flush(uint starty, uint endy)
event_signal(&the_gdev->flush_event, !arch_ints_disabled());
}
void display_get_info(struct display_info *info)
status_t display_get_info(struct display_info *info)
{
memset(info, 0, sizeof(*info));
if (the_gdev) {
info->framebuffer = the_gdev->fb;
info->format = GFX_FORMAT_RGB_x888;
info->width = the_gdev->pmode.r.width;
info->height = the_gdev->pmode.r.height;
info->stride = info->width;
info->flush = virtio_gpu_gfx_flush;
}
if (!the_gdev)
return ERR_NOT_FOUND;
info->framebuffer = the_gdev->fb;
info->format = GFX_FORMAT_RGB_x888;
info->width = the_gdev->pmode.r.width;
info->height = the_gdev->pmode.r.height;
info->stride = info->width;
info->flush = virtio_gpu_gfx_flush;
return NO_ERROR;
}