summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaptor Engineering Development Team <support@raptorengineering.com>2019-05-03 05:38:25 +0000
committerRaptor Engineering Development Team <support@raptorengineering.com>2019-05-03 08:00:05 +0000
commit7df0ed3374938345d55a8d4c72b20dc57f1080b9 (patch)
treee5fe0be0fe198aed5465d5e69fd6fa5f73a1503a
parentd32565cb60fbf6a13801dca1373b5c46dcb631b6 (diff)
downloadblackbird-obmc-linux-dev-5.0-raptor-04-16-2019-dev.tar.gz
blackbird-obmc-linux-dev-5.0-raptor-04-16-2019-dev.zip
drm/aspeed: Allow higher screen resolutions to be setdev-5.0-raptor-04-16-2019-dev
Most AST2500 hardware uses the 40MHz pixel clock option for the GFX block, yielding a maximum resolution of 800x600@60Hz. However, the GFX block is normally used to display relatively slowly changing information, and the increased resolution obtained at 30Hz may be useful for some applications. The utility of 30Hz refresh rate with standard VGA / CRT applications is relatively low, but 30Hz refresh over DVO with modern flat panels should be workable. Relax the maximum resolution limits accordingly for DVO outputs. Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
-rw-r--r--drivers/gpu/drm/aspeed/aspeed_gfx_drv.c12
-rw-r--r--drivers/gpu/drm/aspeed/aspeed_gfx_out.c38
2 files changed, 47 insertions, 3 deletions
diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
index 17a22dd0922a..595530614c8d 100644
--- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
+++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
@@ -66,12 +66,20 @@ static const struct drm_mode_config_funcs aspeed_gfx_mode_config_funcs = {
static void aspeed_gfx_setup_mode_config(struct drm_device *drm)
{
+ struct aspeed_gfx *priv = drm->dev_private;
+
drm_mode_config_init(drm);
drm->mode_config.min_width = 0;
drm->mode_config.min_height = 0;
- drm->mode_config.max_width = 800;
- drm->mode_config.max_height = 600;
+ if (priv->output_mode & OUTPUT_DVO) {
+ drm->mode_config.max_width = 1280;
+ drm->mode_config.max_height = 720;
+ }
+ else {
+ drm->mode_config.max_width = 800;
+ drm->mode_config.max_height = 600;
+ }
drm->mode_config.funcs = &aspeed_gfx_mode_config_funcs;
}
diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_out.c b/drivers/gpu/drm/aspeed/aspeed_gfx_out.c
index 2f3115106baa..7ffb4303289e 100644
--- a/drivers/gpu/drm/aspeed/aspeed_gfx_out.c
+++ b/drivers/gpu/drm/aspeed/aspeed_gfx_out.c
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0+
// Copyright 2018 IBM Corporation
+// Copyright 2019 Raptor Engineering, LLC
#include <drm/drm_atomic_helper.h>
#include <drm/drm_connector.h>
@@ -7,9 +8,44 @@
#include "aspeed_gfx.h"
+/*
+ * Set of extra DVO modes.
+ */
+static const struct drm_display_mode dvo_extra_modes[] = {
+ /* 1280x720@30Hz */
+ { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 29606, 1280, 1288,
+ 1408, 1536, 0, 720, 721, 724, 733, 0,
+ DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
+};
+
static int aspeed_gfx_get_modes(struct drm_connector *connector)
{
- return drm_add_modes_noedid(connector, 800, 600);
+ int i, count;
+
+ struct aspeed_gfx *priv = connector->dev->dev_private;
+
+ /* Add basic VGA mode */
+ count = drm_add_modes_noedid(connector, 800, 600);
+
+ /* Add extra DVO modes */
+ for (i = 0; i < ARRAY_SIZE(dvo_extra_modes); i++) {
+ struct drm_display_mode *nmode;
+ nmode = drm_mode_duplicate(connector->dev,
+ &dvo_extra_modes[i]);
+ if (nmode)
+ drm_mode_probed_add(connector, nmode);
+ }
+
+ if (priv->output_mode & OUTPUT_DVO) {
+ /* Use 1280x720@30Hz unless otherwise configured */
+ drm_set_preferred_mode(connector, 1280, 720);
+ }
+ else {
+ /* Use 800x600@60Hz unless otherwise configured */
+ drm_set_preferred_mode(connector, 800, 600);
+ }
+
+ return count;
}
static const struct
OpenPOWER on IntegriCloud