aboutsummaryrefslogtreecommitdiffstats
path: root/android/hw-lcd.c
diff options
context:
space:
mode:
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);