set the preferred mode resolution to 1024 * 768 and maximum
resolution to 1920 * 1200.

Signed-off-by: Tian Tao <tiant...@hisilicon.com>
Signed-off-by: Gong junjie <gongjunj...@huawei.com>
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c 
b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c
index 6d98fdc..82fc7d3 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c
@@ -11,8 +11,10 @@
  *     Jianhua Li <lijian...@huawei.com>
  */
 
+#include <drm/drm_gem_vram_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_probe_helper.h>
+#include <drm/drm_crtc_helper.h>
 #include <drm/drm_print.h>
 
 #include "hibmc_drm_drv.h"
@@ -20,7 +22,13 @@
 
 static int hibmc_connector_get_modes(struct drm_connector *connector)
 {
-       return drm_add_modes_noedid(connector, 800, 600);
+       int count;
+
+       drm_connector_update_edid_property(connector, NULL);
+       count = drm_add_modes_noedid(connector, 1920, 1200);
+       drm_set_preferred_mode(connector, 1024, 768);
+
+       return count;
 }
 
 static enum drm_mode_status hibmc_connector_mode_valid(struct drm_connector 
*connector,
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to