summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/ast/ast_main.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-03-28 09:18:45 +1000
committerDave Airlie <airlied@redhat.com>2014-05-19 11:13:55 +1000
commit1453bf4c48952c249071c965c61932ac9c5450f6 (patch)
tree3ab9eddccccdf2bab1d465dab880eeb2a2f2bf4b /drivers/gpu/drm/ast/ast_main.c
parentf1f62f2ccba0967c493ac9ad31c9b04d29688aaa (diff)
drm/ast: add AST 2400 support.
This is ported from the userspace driver. Untested on any ast2400 hw so far. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/ast/ast_main.c')
-rw-r--r--drivers/gpu/drm/ast/ast_main.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c
index cd0a791e76c5..01ea4b6d4bf3 100644
--- a/drivers/gpu/drm/ast/ast_main.c
+++ b/drivers/gpu/drm/ast/ast_main.c
@@ -72,7 +72,10 @@ static int ast_detect_chip(struct drm_device *dev)
ast->chip = AST1100;
DRM_INFO("AST 1180 detected\n");
} else {
- if (dev->pdev->revision >= 0x20) {
+ if (dev->pdev->revision >= 0x30) {
+ ast->chip = AST2400;
+ DRM_INFO("AST 2400 detected\n");
+ } else if (dev->pdev->revision >= 0x20) {
ast->chip = AST2300;
DRM_INFO("AST 2300 detected\n");
} else if (dev->pdev->revision >= 0x10) {
@@ -121,13 +124,14 @@ static int ast_detect_chip(struct drm_device *dev)
ast->support_wide_screen = true;
else {
ast->support_wide_screen = false;
- if (ast->chip == AST2300) {
- ast_write32(ast, 0xf004, 0x1e6e0000);
- ast_write32(ast, 0xf000, 0x1);
- data = ast_read32(ast, 0x1207c);
- if ((data & 0x300) == 0) /* ast1300 */
- ast->support_wide_screen = true;
- }
+ ast_write32(ast, 0xf004, 0x1e6e0000);
+ ast_write32(ast, 0xf000, 0x1);
+ data = ast_read32(ast, 0x1207c);
+ data &= 0x300;
+ if (ast->chip == AST2300 && data == 0x0) /* ast1300 */
+ ast->support_wide_screen = true;
+ if (ast->chip == AST2400 && data == 0x100) /* ast1400 */
+ ast->support_wide_screen = true;
}
break;
}
@@ -157,7 +161,7 @@ static int ast_get_dram_info(struct drm_device *dev)
else
ast->dram_bus_width = 32;
- if (ast->chip == AST2300) {
+ if (ast->chip == AST2300 || ast->chip == AST2400) {
switch (data & 0x03) {
case 0:
ast->dram_type = AST_DRAM_512Mx16;
@@ -344,6 +348,7 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags)
if (ast->chip == AST2100 ||
ast->chip == AST2200 ||
ast->chip == AST2300 ||
+ ast->chip == AST2400 ||
ast->chip == AST1180) {
dev->mode_config.max_width = 1920;
dev->mode_config.max_height = 2048;