Message ID | 20170223225357.9572-7-benh@kernel.crashing.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Feb 24, 2017 at 9:23 AM, Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote: > From: "Y.C. Chen" <yc_chen@aspeedtech.com> > > The default value of VGA scratch may incorrect. > Should initial h/w before get vram info. > > Signed-off-by: Y.C. Chen <yc_chen@aspeedtech.com> Acked-by: Joel Stanley <joel@jms.id.au> > --- > drivers/gpu/drm/ast/ast_main.c | 6 +++--- > drivers/gpu/drm/ast/ast_post.c | 2 +- > 2 files changed, 4 insertions(+), 4 deletions(-)
Tested-by: Y.C. Chen <yc_chen@aspeedtech.com> -----Original Message----- From: Benjamin Herrenschmidt [mailto:benh@kernel.crashing.org] Sent: Friday, February 24, 2017 6:54 AM To: dri-devel@lists.freedesktop.org Cc: YC Chen <yc_chen@aspeedtech.com>; airlied@redhat.com; eich@suse.come; linuxppc-dev@ozlabs.org Subject: [PATCH 07/12] drm/ast: Fixed vram size incorrect issue on POWER From: "Y.C. Chen" <yc_chen@aspeedtech.com> The default value of VGA scratch may incorrect. Should initial h/w before get vram info. Signed-off-by: Y.C. Chen <yc_chen@aspeedtech.com>
diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c index f19669f..8684f3c 100644 --- a/drivers/gpu/drm/ast/ast_main.c +++ b/drivers/gpu/drm/ast/ast_main.c @@ -516,6 +516,9 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags) ast_detect_chip(dev, &need_post); + if (need_post) + ast_post_gpu(dev); + if (ast->chip != AST1180) { ret = ast_get_dram_info(dev); if (ret) @@ -526,9 +529,6 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags) ast->dram_bus_width, ast->vram_size); } - if (need_post) - ast_post_gpu(dev); - ret = ast_mm_init(ast); if (ret) goto out_free; diff --git a/drivers/gpu/drm/ast/ast_post.c b/drivers/gpu/drm/ast/ast_post.c index 64549ce..e802450 100644 --- a/drivers/gpu/drm/ast/ast_post.c +++ b/drivers/gpu/drm/ast/ast_post.c @@ -79,7 +79,7 @@ ast_set_def_ext_reg(struct drm_device *dev) const u8 *ext_reg_info; /* reset scratch */ - for (i = 0x81; i <= 0x8f; i++) + for (i = 0x81; i <= 0x9f; i++) ast_set_index_reg(ast, AST_IO_CRTC_PORT, i, 0x00); if (ast->chip == AST2300 || ast->chip == AST2400) {