summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeung-Woo Kim <sw0312.kim@samsung.com>2021-10-19 15:22:49 +0900
committerSeung-Woo Kim <sw0312.kim@samsung.com>2021-10-19 15:42:26 +0900
commit9f09597d88d92ddc9b79f0df6575a5cbee9f6d5e (patch)
tree450230675feb30d58afe3e13da8dce292c437262
parent3bf0516212bf3f8c4775de50e37526acca489a3c (diff)
downloademulator-kernel-9f09597d88d92ddc9b79f0df6575a5cbee9f6d5e.tar.gz
emulator-kernel-9f09597d88d92ddc9b79f0df6575a5cbee9f6d5e.tar.bz2
emulator-kernel-9f09597d88d92ddc9b79f0df6575a5cbee9f6d5e.zip
drm/vigs: fix dpi allow range
Fix dpi allow range with 1 to 1000. Also, set min or max value for value in out of the range. Change-Id: I89837120b1d0128f1194c86d323d35ca269ef71e Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
-rw-r--r--drivers/gpu/drm/vigs/vigs_output.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpu/drm/vigs/vigs_output.c b/drivers/gpu/drm/vigs/vigs_output.c
index 47603cbbdd8c..3684759e56cf 100644
--- a/drivers/gpu/drm/vigs/vigs_output.c
+++ b/drivers/gpu/drm/vigs/vigs_output.c
@@ -4,8 +4,8 @@
#include <linux/init.h>
#define DPI_DEF_VALUE 316
-#define DPI_MIN_VALUE 100
-#define DPI_MAX_VALUE 600
+#define DPI_MIN_VALUE 1
+#define DPI_MAX_VALUE 1000
#ifndef MODULE
static int vigs_atoi(const char *str)
@@ -280,9 +280,10 @@ int vigs_output_get_dpi(void)
if (str != NULL) {
str += 4;
dpi = vigs_atoi(str);
- if ((dpi < DPI_MIN_VALUE) || (dpi > DPI_MAX_VALUE)) {
- dpi = DPI_DEF_VALUE;
- }
+ if (dpi < DPI_MIN_VALUE)
+ dpi = DPI_MIN_VALUE;
+ else if (dpi > DPI_MAX_VALUE)
+ dpi = DPI_MAX_VALUE;
}
#endif
return dpi;