aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2016-03-31 17:51:59 +0000
committerAndroid Partner Code Review <android-gerrit-partner@google.com>2016-03-31 17:51:59 +0000
commit193ff16215fbb59a2d0a6e861a17b7ca34da55f4 (patch)
tree831d3af55b8d2bcd39e32ab1ca88e852626adb62
parent218e08f4997ed845b8e860753c3f88851ebbe680 (diff)
parent149d37051e0b5672d21128128fde4a08402c931e (diff)
downloadhikey-clang-android-hikey-linaro-4.4.tar.gz
Merge "HACK: hdmi: Restrict HDMI output modes to known good hikey mode clocks" into android-hikey-linaro-4.4android-hikey-linaro-4.4
-rw-r--r--drivers/gpu/drm/i2c/adv7511.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i2c/adv7511.c b/drivers/gpu/drm/i2c/adv7511.c
index 0b134d764adc..6b80bfc266fa 100644
--- a/drivers/gpu/drm/i2c/adv7511.c
+++ b/drivers/gpu/drm/i2c/adv7511.c
@@ -733,12 +733,28 @@ adv7511_detect(struct adv7511 *adv7511,
}
static int adv7511_mode_valid(struct adv7511 *adv7511,
- const struct drm_display_mode *mode)
+ struct drm_display_mode *mode)
{
if (mode->clock > 165000)
return MODE_CLOCK_HIGH;
-
- return MODE_OK;
+ /*
+ * some work well modes which want to put in the front of the mode list.
+ */
+ DRM_DEBUG("Checking mode %ix%i@%i clock: %i...",
+ mode->hdisplay, mode->vdisplay, drm_mode_vrefresh(mode), mode->clock);
+ if ((mode->hdisplay == 1920 && mode->vdisplay == 1080 && mode->clock == 148500) ||
+ (mode->hdisplay == 1280 && mode->vdisplay == 800 && mode->clock == 83496) ||
+ (mode->hdisplay == 1280 && mode->vdisplay == 720 && mode->clock == 74440) ||
+ (mode->hdisplay == 1280 && mode->vdisplay == 720 && mode->clock == 74250) ||
+ (mode->hdisplay == 1024 && mode->vdisplay == 768 && mode->clock == 75000) ||
+ (mode->hdisplay == 1024 && mode->vdisplay == 768 && mode->clock == 81833) ||
+ (mode->hdisplay == 800 && mode->vdisplay == 600 && mode->clock == 40000)) {
+ mode->type |= DRM_MODE_TYPE_PREFERRED;
+ DRM_DEBUG("OK\n");
+ return MODE_OK;
+ }
+ DRM_DEBUG("BAD\n");
+ return MODE_BAD;
}
static void adv7511_mode_set(struct adv7511 *adv7511,