diff options
author | David 'Digit' Turner <digit@android.com> | 2011-02-02 12:12:53 -0800 |
---|---|---|
committer | Android Code Review <code-review@android.com> | 2011-02-02 12:12:53 -0800 |
commit | d6eda1d7b357746ad8d9a4c80dc0235ef56c40e0 (patch) | |
tree | b669e7b99c01bd8aafd2079321c8cb80302454e0 /android/console.c | |
parent | ce747472342237e882369e486254684ab7708362 (diff) | |
parent | 07db34976ba1dd045a51c4ab2c7f52479cddcc57 (diff) | |
download | external_qemu-d6eda1d7b357746ad8d9a4c80dc0235ef56c40e0.zip external_qemu-d6eda1d7b357746ad8d9a4c80dc0235ef56c40e0.tar.gz external_qemu-d6eda1d7b357746ad8d9a4c80dc0235ef56c40e0.tar.bz2 |
Merge changes Icd076267,I6d5ad6ec
* changes:
Simplify UI-only sources.
Simplify core framebuffer management.
Diffstat (limited to 'android/console.c')
-rw-r--r-- | android/console.c | 46 |
1 files changed, 7 insertions, 39 deletions
diff --git a/android/console.c b/android/console.c index d776a5c..d883002 100644 --- a/android/console.c +++ b/android/console.c @@ -121,9 +121,6 @@ typedef struct ControlGlobalRec_ /* UI client currently attached to the core. */ ControlClient attached_ui_client = NULL; -/* Core framebuffer service client. */ -ControlClient framebuffer_client = NULL; - /* User events service client. */ ControlClient user_events_client = NULL; @@ -245,15 +242,6 @@ control_client_destroy( ControlClient client ) attached_ui_client = NULL; } - if (client == framebuffer_client) { - ProxyFramebuffer* core_fb = coredisplay_detach_fb_service(); - if (core_fb != NULL) { - proxyFb_destroy(core_fb); - AFREE(core_fb); - } - framebuffer_client = NULL; - } - if (client == user_events_client) { userEventsImpl_destroy(); user_events_client = NULL; @@ -2525,14 +2513,12 @@ destroy_attach_ui_client(void) } } -/* Core display instance. */ -extern CoreDisplay core_display; - static int do_create_framebuffer_service( ControlClient client, char* args ) { ProxyFramebuffer* core_fb; const char* protocol = "-raw"; // Default framebuffer exchange protocol. + char reply_buf[64]; // Protocol type is defined by the arguments passed with the stream switch // command. @@ -2555,38 +2541,20 @@ do_create_framebuffer_service( ControlClient client, char* args ) } } - // Make sure that there are no framebuffer client already existing. - if (framebuffer_client != NULL) { - control_write( client, "KO: Another framebuffer service is already existing!\r\n" ); - control_client_destroy(client); - return -1; - } - - core_fb = proxyFb_create(client->sock, protocol, coredisplay_get_framebuffer()); - if (!coredisplay_attach_fb_service(core_fb)) { - char reply_buf[4096]; - framebuffer_client = client; - // Reply "OK" with the framebuffer's bits per pixel - snprintf(reply_buf, sizeof(reply_buf), "OK: -bitsperpixel=%d\r\n", - proxyFb_get_bits_per_pixel(core_fb)); - control_write( client, reply_buf); - } else { + core_fb = proxyFb_create(client->sock, protocol); + if (core_fb == NULL) { control_write( client, "KO\r\n" ); control_client_destroy(client); return -1; } + // Reply "OK" with the framebuffer's bits per pixel + snprintf(reply_buf, sizeof(reply_buf), "OK: -bitsperpixel=%d\r\n", + proxyFb_get_bits_per_pixel(core_fb)); + control_write( client, reply_buf); return 0; } -void -destroy_control_fb_client(void) -{ - if (framebuffer_client != NULL) { - control_client_destroy(framebuffer_client); - } -} - static int do_create_user_events_service( ControlClient client, char* args ) { |