public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel•crashing.org>
To: dri-devel@lists•freedesktop.org
Cc: "Y . C . 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
Date: Fri, 24 Feb 2017 09:53:52 +1100	[thread overview]
Message-ID: <20170223225357.9572-7-benh@kernel.crashing.org> (raw)
In-Reply-To: <20170223225357.9572-1-benh@kernel.crashing.org>

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>
---
 drivers/gpu/drm/ast/ast_main.c | 6 +++---
 drivers/gpu/drm/ast/ast_post.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

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) {
-- 
2.9.3

  parent reply	other threads:[~2017-02-23 23:43 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-23 22:53 [PATCH 01/12] drm/ast: Fix AST2400 POST failure without BMC FW or VBIOS Benjamin Herrenschmidt
2017-02-23 22:53 ` [PATCH 02/12] drm/ast: Handle configuration without P2A bridge Benjamin Herrenschmidt
2017-02-24  2:21   ` Joel Stanley
2017-02-24  2:26     ` Benjamin Herrenschmidt
2017-02-24  2:32     ` Benjamin Herrenschmidt
2017-02-24  2:41     ` [PATCH v5 2/12] " Benjamin Herrenschmidt
2017-02-24  2:43       ` Joel Stanley
2017-02-24  7:06   ` [PATCH 02/12] " YC Chen
2017-02-23 22:53 ` [PATCH 03/12] drm/ast: const'ify mode setting tables Benjamin Herrenschmidt
2017-02-24  2:21   ` Joel Stanley
2017-02-23 22:53 ` [PATCH 04/12] drm/ast: Remove spurrious include Benjamin Herrenschmidt
2017-02-24  2:24   ` Joel Stanley
2017-02-23 22:53 ` [PATCH 05/12] drm/ast: Fix calculation of MCLK Benjamin Herrenschmidt
2017-02-24  2:24   ` Joel Stanley
2017-02-24  2:38     ` Benjamin Herrenschmidt
2017-02-24  3:12       ` Joel Stanley
2017-02-24  7:06   ` YC Chen
2017-02-23 22:53 ` [PATCH 06/12] drm/ast: Base support for AST2500 Benjamin Herrenschmidt
2017-02-24  2:22   ` Joel Stanley
2017-02-23 22:53 ` Benjamin Herrenschmidt [this message]
2017-02-24  2:24   ` [PATCH 07/12] drm/ast: Fixed vram size incorrect issue on POWER Joel Stanley
2017-02-24  7:07   ` YC Chen
2017-02-23 22:53 ` [PATCH 08/12] drm/ast: Factor mmc_test code in POST code Benjamin Herrenschmidt
2017-02-24  2:21   ` Joel Stanley
2017-02-24  7:07   ` YC Chen
2017-02-23 22:53 ` [PATCH 09/12] drm/ast: Rename ast_init_dram_2300 to ast_post_chip_2300 Benjamin Herrenschmidt
2017-02-24  2:21   ` Joel Stanley
2017-02-24  7:08   ` YC Chen
2017-02-23 22:53 ` [PATCH 10/12] drm/ast: POST code for the new AST2500 Benjamin Herrenschmidt
2017-02-24  2:21   ` Joel Stanley
2017-02-23 22:53 ` [PATCH 11/12] drm/ast: Fix test for VGA enabled Benjamin Herrenschmidt
2017-02-23 23:24   ` Benjamin Herrenschmidt
2017-02-24  7:09   ` YC Chen
2017-02-23 22:53 ` [PATCH 12/12] drm/ast: Call open_key before enable_mmio in POST code Benjamin Herrenschmidt
2017-02-24  2:21   ` Joel Stanley
2017-02-24  7:09   ` YC Chen
2017-02-23 23:07 ` [PATCH 01/12] drm/ast: Fix AST2400 POST failure without BMC FW or VBIOS Benjamin Herrenschmidt
2017-02-24  2:23 ` Joel Stanley
2017-02-24  7:04 ` YC Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170223225357.9572-7-benh@kernel.crashing.org \
    --to=benh@kernel$(echo .)crashing.org \
    --cc=airlied@redhat$(echo .)com \
    --cc=dri-devel@lists$(echo .)freedesktop.org \
    --cc=eich@suse$(echo .)come \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=yc_chen@aspeedtech$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox