aboutsummaryrefslogtreecommitdiffstats
path: root/android/hw-lcd.c
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2011-06-03 11:24:32 -0700
committerXavier Ducrohet <xav@android.com>2011-06-03 11:24:32 -0700
commit049c72f0ffd9381b88bf9477fc41df5fc8c9a2a1 (patch)
tree75c7d108b4b870fd588f9f7970e2671add7a3c50 /android/hw-lcd.c
parent57d4bd5c264e056bd4a4fe2aff19e46f8f3059f1 (diff)
downloadexternal_qemu-049c72f0ffd9381b88bf9477fc41df5fc8c9a2a1.zip
external_qemu-049c72f0ffd9381b88bf9477fc41df5fc8c9a2a1.tar.gz
external_qemu-049c72f0ffd9381b88bf9477fc41df5fc8c9a2a1.tar.bz2
Add support for the TV DPI.
This is the dpi for the 720p resolution used by Google TV. It's a special dpi, not a bucket dpi like the other one so the handling is a bit different. Change-Id: Id9a245422855c2dba82c267beca203006f6fd864
Diffstat (limited to 'android/hw-lcd.c')
-rw-r--r--android/hw-lcd.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/android/hw-lcd.c b/android/hw-lcd.c
index f84f661..27a50dc 100644
--- a/android/hw-lcd.c
+++ b/android/hw-lcd.c
@@ -18,15 +18,20 @@ hwLcd_setBootProperty(int density)
{
char temp[8];
- /* map density to one of our three values for now */
- if (density < (LCD_DENSITY_LDPI + LCD_DENSITY_MDPI)/2)
- density = LCD_DENSITY_LDPI;
- else if (density < (LCD_DENSITY_MDPI + LCD_DENSITY_HDPI)/2)
- density = LCD_DENSITY_MDPI;
- else if (density < (LCD_DENSITY_HDPI + LCD_DENSITY_XHDPI)/2)
- density = LCD_DENSITY_HDPI;
- else
- density = LCD_DENSITY_XHDPI;
+ /* Map density to one of our five bucket values.
+ The TV density is a bit particular (and not actually a bucket
+ value) so we do only exact match on it.
+ */
+ if (density != LCD_DENSITY_TVDPI) {
+ if (density < (LCD_DENSITY_LDPI + LCD_DENSITY_MDPI)/2)
+ density = LCD_DENSITY_LDPI;
+ else if (density < (LCD_DENSITY_MDPI + LCD_DENSITY_HDPI)/2)
+ density = LCD_DENSITY_MDPI;
+ else if (density < (LCD_DENSITY_HDPI + LCD_DENSITY_XHDPI)/2)
+ density = LCD_DENSITY_HDPI;
+ else
+ density = LCD_DENSITY_XHDPI;
+ }
snprintf(temp, sizeof temp, "%d", density);
boot_property_add("qemu.sf.lcd_density", temp);