aboutsummaryrefslogtreecommitdiffstats
path: root/android
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
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')
-rw-r--r--android/avd/hardware-properties.ini17
-rw-r--r--android/avd/hw-config-defs.h21
-rw-r--r--android/main-common.c48
-rw-r--r--android/main-common.h2
-rw-r--r--android/main-ui.c2
-rw-r--r--android/main.c2
6 files changed, 90 insertions, 2 deletions
diff --git a/android/avd/hardware-properties.ini b/android/avd/hardware-properties.ini
index 8e5cc41..79263a1 100644
--- a/android/avd/hardware-properties.ini
+++ b/android/avd/hardware-properties.ini
@@ -136,6 +136,23 @@ type = diskSize
abstract = Cache partition size
default = 66MB
+# LCD width
+name = hw.lcd.width
+type = integer
+default = 320
+abstract = LCD pixel width
+
+name = hw.lcd.height
+type = integer
+default = 640
+abstract = LCD pixel height
+
+name = hw.lcd.depth
+type = integer
+default = 16
+abstract = LCD color depth
+description = Must be 16 or 32. Color bit depth of emulated framebuffer.
+
# LCD density
name = hw.lcd.density
type = integer
diff --git a/android/avd/hw-config-defs.h b/android/avd/hw-config-defs.h
index 9602a4a..8d58478 100644
--- a/android/avd/hw-config-defs.h
+++ b/android/avd/hw-config-defs.h
@@ -137,6 +137,27 @@ HWCFG_DISKSIZE(
"")
HWCFG_INT(
+ hw_lcd_width,
+ "hw.lcd.width",
+ 320,
+ "LCD pixel width",
+ "")
+
+HWCFG_INT(
+ hw_lcd_height,
+ "hw.lcd.height",
+ 640,
+ "LCD pixel height",
+ "")
+
+HWCFG_INT(
+ hw_lcd_depth,
+ "hw.lcd.depth",
+ 16,
+ "LCD color depth",
+ "Must be 16 or 32. Color bit depth of emulated framebuffer.")
+
+HWCFG_INT(
hw_lcd_density,
"hw.lcd.density",
160,
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;
diff --git a/android/main-common.h b/android/main-common.h
index c5131df..88ebb70 100644
--- a/android/main-common.h
+++ b/android/main-common.h
@@ -16,6 +16,7 @@
#include "android/cmdline-option.h"
#include "android/skin/keyset.h"
#include "android/config.h"
+#include "android/avd/hw-config.h"
/* Common routines used by both android/main.c and android/main-ui.c */
@@ -45,6 +46,7 @@ extern const char* skin_network_delay;
void parse_skin_files(const char* skinDirPath,
const char* skinName,
AndroidOptions* opts,
+ AndroidHwConfig* hwConfig,
AConfig* *skinConfig,
char* *skinPath);
diff --git a/android/main-ui.c b/android/main-ui.c
index e422d9a..373f13d 100644
--- a/android/main-ui.c
+++ b/android/main-ui.c
@@ -876,7 +876,7 @@ int main(int argc, char **argv)
user_config_init();
- parse_skin_files(opts->skindir, opts->skin, opts,
+ parse_skin_files(opts->skindir, opts->skin, opts, hw,
&skinConfig, &skinPath);
if (!opts->netspeed) {
diff --git a/android/main.c b/android/main.c
index 14e1ced..4e2bc42 100644
--- a/android/main.c
+++ b/android/main.c
@@ -667,7 +667,7 @@ int main(int argc, char **argv)
user_config_init();
- parse_skin_files(opts->skindir, opts->skin, opts,
+ parse_skin_files(opts->skindir, opts->skin, opts, hw,
&skinConfig, &skinPath);
if (!opts->netspeed) {