Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Unified Diff: dev/virtio/gpu/virtio-gpu.c

Issue 1777783003: [display] Refactor to avoid implicit framebuffer allocation. (Closed) Base URL: https://github.com/littlekernel/lk.git@master
Patch Set: update other targets Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/dev/display.h » ('j') | include/dev/display.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
-
-
« no previous file with comments | « no previous file | include/dev/display.h » ('j') | include/dev/display.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698