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
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 @@
{
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);