diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2017-02-16 21:57:30 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-02-27 22:14:22 -0500 |
commit | 6475a7cce61967fca4dd793b60acf5a7dc70bc9a (patch) | |
tree | bb37714e4493a0757c5b97de3631a29eded9edf6 /drivers/gpu/drm/ast/ast_main.c | |
parent | cf2f6bd402470caed4e4d75b783d2d48277a3568 (diff) |
drm/ast: Fix calculation of MCLK
Some braces were missing causing an incorrect calculation.
Y.C. Chen from Aspeed provided me with the right formula
which I tested on AST2400 and 2500.
The MCLK isn't currently used by the driver (it will eventually
to filter modes) so the issue isn't catastrophic.
Also make the printed value a bit more meaningful
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Joel Stanley <joel@jms.id.au>
Tested-by: Y.C. Chen <yc_chen@aspeedtech.com>
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.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c index 29ab2c11db41..fd167008be31 100644 --- a/drivers/gpu/drm/ast/ast_main.c +++ b/drivers/gpu/drm/ast/ast_main.c | |||
@@ -354,7 +354,7 @@ static int ast_get_dram_info(struct drm_device *dev) | |||
354 | div = 0x1; | 354 | div = 0x1; |
355 | break; | 355 | break; |
356 | } | 356 | } |
357 | ast->mclk = ref_pll * (num + 2) / (denum + 2) * (div * 1000); | 357 | ast->mclk = ref_pll * (num + 2) / ((denum + 2) * (div * 1000)); |
358 | return 0; | 358 | return 0; |
359 | } | 359 | } |
360 | 360 | ||
@@ -498,7 +498,9 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags) | |||
498 | if (ret) | 498 | if (ret) |
499 | goto out_free; | 499 | goto out_free; |
500 | ast->vram_size = ast_get_vram_info(dev); | 500 | ast->vram_size = ast_get_vram_info(dev); |
501 | DRM_INFO("dram %d %d %d %08x\n", ast->mclk, ast->dram_type, ast->dram_bus_width, ast->vram_size); | 501 | DRM_INFO("dram MCLK=%u Mhz type=%d bus_width=%d size=%08x\n", |
502 | ast->mclk, ast->dram_type, | ||
503 | ast->dram_bus_width, ast->vram_size); | ||
502 | } | 504 | } |
503 | 505 | ||
504 | if (need_post) | 506 | if (need_post) |