diff mbox

Add DPI override option

Message ID 1493766342-25170-1-git-send-email-john.stultz@linaro.org
State Superseded
Headers show

Commit Message

John Stultz May 2, 2017, 11:05 p.m. UTC
This patch adds DPI override option and sets the db410c to 160.
If the value is left at the defualt 0, it will be probed from
the monitor.

Cc: Rob Herring <rob.herring@linaro.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Vishal Bhoj <vishal.bhoj@linaro.org>
Cc: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>

---
 configs/db410c_defconfig | 1 +
 graphics/Kconfig         | 6 ++++++
 graphics/device.mk       | 5 +++++
 3 files changed, 12 insertions(+)

-- 
2.7.4
diff mbox

Patch

diff --git a/configs/db410c_defconfig b/configs/db410c_defconfig
index e13ad04..cc6a209 100644
--- a/configs/db410c_defconfig
+++ b/configs/db410c_defconfig
@@ -8,3 +8,4 @@  CONFIG_KERNEL_PATH="device/linaro/generic-kernels/android-db410c-qcomlt-4.9.gz-d
 CONFIG_BOARD_KERNEL_CMDLINE="androidboot.selinux=permissive firmware_class.path=/system/vendor/firmware/"
 CONFIG_BOARD_KERNEL_BASE=0x80008000
 CONFIG_RAMDISK_OFFSET=0x0
+CONFIG_DPI=160
diff --git a/graphics/Kconfig b/graphics/Kconfig
index 6e76697..6d23079 100644
--- a/graphics/Kconfig
+++ b/graphics/Kconfig
@@ -32,4 +32,10 @@  config BOARD_GPU_DRIVERS
 	default "freedreno virgl"
 
 endif
+config DPI
+	int "DPI setting override"
+	default 0
+	help
+	  Sets the DPI value. If left as zero, the DPI will
+	  be probed via EDID from the monitor/panel.
 endmenu
diff --git a/graphics/device.mk b/graphics/device.mk
index bab2d62..f6bc80d 100644
--- a/graphics/device.mk
+++ b/graphics/device.mk
@@ -3,6 +3,11 @@  PRODUCT_PROPERTY_OVERRIDES := $(if $(CONFIG_SW_GRAPHICS), \
 
 PRODUCT_PACKAGES := libGLES_android
 
+ifneq ($(CONFIG_DPI),0)
+PRODUCT_PROPERTY_OVERRIDES += \
+        ro.sf.lcd_density=$(CONFIG_DPI)
+endif
+
 subdirs-true :=
 subdirs-$(BOARD_USES_DRM_HWCOMPOSER) += drm
 subdirs-$(CONFIG_GRALLOC_MALI) += gralloc