aboutsummaryrefslogtreecommitdiffstats
path: root/android/main-common.c
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-02-10 16:29:17 +0100
committerDavid 'Digit' Turner <digit@android.com>2011-02-10 17:41:07 +0100
commit2507cab8a78fb609461a2b9cc4708bab60fc53a4 (patch)
tree3deeee5792eb4cf2b148a224177bed8ed5f7e9cc /android/main-common.c
parent42074e5e184aed78dee0efb14d7376325516c070 (diff)
downloadexternal_qemu-2507cab8a78fb609461a2b9cc4708bab60fc53a4.zip
external_qemu-2507cab8a78fb609461a2b9cc4708bab60fc53a4.tar.gz
external_qemu-2507cab8a78fb609461a2b9cc4708bab60fc53a4.tar.bz2
Get rid of -android-gui core option.
Instead, pass all LCD configuration in qemu-hardware.ini. + Make the latter file mandatory to launch a core. You can easily generate one by launching "emulator <options>" though. Change-Id: I81a1938217562517e4c2bbb828aef934033c29a5
Diffstat (limited to 'android/main-common.c')
-rw-r--r--android/main-common.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/android/main-common.c b/android/main-common.c
index bb07943..e11662c 100644
--- a/android/main-common.c
+++ b/android/main-common.c
@@ -341,6 +341,7 @@ void
parse_skin_files(const char* skinDirPath,
const char* skinName,
AndroidOptions* opts,
+ AndroidHwConfig* hwConfig,
AConfig* *skinConfig,
char* *skinPath)
{
@@ -433,6 +434,53 @@ FOUND_SKIN:
skin_network_delay = aconfig_str(n, "delay", 0);
}
+ /* extract framebuffer information from the skin.
+ *
+ * for version 1 of the skin format, they are in the top-level
+ * 'display' element.
+ *
+ * for version 2 of the skin format, they are under parts.device.display
+ */
+ n = aconfig_find(root, "display");
+ if (n == NULL) {
+ n = aconfig_find(root, "parts");
+ if (n != NULL) {
+ n = aconfig_find(root, "device");
+ if (n != NULL) {
+ n = aconfig_find(root, "display");
+ }
+ }
+ }
+
+ if (n != NULL) {
+ int width = aconfig_int(n, "width", hwConfig->hw_lcd_width);
+ int height = aconfig_int(n, "height", hwConfig->hw_lcd_height);
+ int depth = aconfig_int(n, "bpp", hwConfig->hw_lcd_depth);
+
+ if (width > 0 && height > 0) {
+ /* The emulated framebuffer wants sizes that are multiples of 4 */
+ if (((width|height) & 3) != 0) {
+ width = (width+3) & ~3;
+ height = (height+3) & ~3;
+ D("adjusting LCD dimensions to (%dx%dx)", width, height);
+ }
+
+ /* only depth values of 16 and 32 are correct. 16 is the default. */
+ if (depth != 32 && depth != 16) {
+ depth = 16;
+ D("adjusting LCD bit depth to %d", depth);
+ }
+
+ hwConfig->hw_lcd_width = width;
+ hwConfig->hw_lcd_height = height;
+ hwConfig->hw_lcd_depth = depth;
+ }
+ else {
+ D("ignoring invalid skin LCD dimensions (%dx%dx%d)",
+ width, height, depth);
+ }
+ }
+
*skinConfig = root;
*skinPath = strdup(path);
return;