Commit 7df0ed33 authored by Raptor Engineering Development Team's avatar Raptor Engineering Development Team
Browse files

drm/aspeed: Allow higher screen resolutions to be set


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's avatarTimothy Pearson <tpearson@raptorengineering.com>
parent d32565cb
......@@ -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;
}
......
// 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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment