Chromium Code Reviews| Index: dev/virtio/gpu/virtio-gpu.c |
| diff --git a/dev/virtio/gpu/virtio-gpu.c b/dev/virtio/gpu/virtio-gpu.c |
| index b5dff6ffea324e79344449c64aecec2623730fde..d85d40941b119dbb9146d995851e21a1c1209842 100644 |
| --- a/dev/virtio/gpu/virtio-gpu.c |
| +++ b/dev/virtio/gpu/virtio-gpu.c |
| @@ -33,7 +33,6 @@ |
| #include <kernel/event.h> |
| #include <kernel/mutex.h> |
| #include <kernel/vm.h> |
| -#include <lib/gfx.h> |
| #include <dev/display.h> |
| #include "virtio_gpu.h" |
| @@ -557,6 +556,24 @@ void virtio_gpu_gfx_flush(uint starty, uint endy) |
| event_signal(&the_gdev->flush_event, !arch_ints_disabled()); |
| } |
| +status_t display_get_framebuffer(struct display_framebuffer *fb) |
| +{ |
|
gkalsi
2016/03/09 21:13:37
nit: DEBUG_ASSERT(fb);
cdotstout
2016/03/09 22:48:00
Done.
|
| + memset(fb, 0, sizeof(*fb)); |
| + |
| + if (!the_gdev) |
| + return ERR_NOT_FOUND; |
| + |
| + fb->image.pixels = the_gdev->fb; |
| + fb->image.format = IMAGE_FORMAT_RGB_x888; |
| + fb->image.width = the_gdev->pmode.r.width; |
| + fb->image.height = the_gdev->pmode.r.height; |
| + fb->image.rowbytes = fb->image.width; |
| + fb->flush = virtio_gpu_gfx_flush; |
| + fb->format = DISPLAY_FORMAT_RGB_x888; |
| + |
| + return NO_ERROR; |
| +} |
| + |
| status_t display_get_info(struct display_info *info) |
|
gkalsi
2016/03/09 21:13:37
nit: DEBUG_ASSERT(info);
cdotstout
2016/03/09 22:47:59
Done.
|
| { |
| memset(info, 0, sizeof(*info)); |
| @@ -564,14 +581,9 @@ status_t display_get_info(struct display_info *info) |
| if (!the_gdev) |
| return ERR_NOT_FOUND; |
| - info->framebuffer = the_gdev->fb; |
| - info->format = GFX_FORMAT_RGB_x888; |
| + info->format = DISPLAY_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; |
| } |
| - |
| - |