dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: airlied@redhat.com, daniel@ffwll.ch, emil.velikov@collabora.com,
	sam@ravnborg.org, kraxel@redhat.com, rong.a.chen@intel.com
Cc: "John Donnelly" <john.p.donnelly@Oracle.com>,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	"Emil Velikov" <emil.l.velikov@gmail.com>,
	"José Roberto de Souza" <jose.souza@intel.com>,
	"Andrzej Pietrasiewicz" <andrzej.p@collabora.com>,
	dri-devel@lists.freedesktop.org,
	"Thomas Zimmermann" <tzimmermann@suse.de>
Subject: [PATCH] drm/mgag200: Don't set <rammapen> in MISC
Date: Tue, 16 Jun 2020 16:26:30 +0200	[thread overview]
Message-ID: <20200616142630.20129-1-tzimmermann@suse.de> (raw)

The original modesetting code set MISC to 0x2d, which is <hpgoddev>,
<clksel> and <ioaddsel>

With the conversion to atomic modesetting, <rammapen> accidentally
got enabled as well. Revert this change and initialize MISC with a
constant value of <hgoddev> and <ioaddsel>. The <clksel> bits are set
in mga_crtc_set_plls(), sync flags are set in mgag200_set_mode_regs().

While at it, also rename the flag constant to match the nameing in
the MGA Programming Manual.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reported-by: kernel test robot <rong.a.chen@intel.com>
Suggested-by: Emil Velikov <emil.l.velikov@gmail.com>
Fixes: db05f8d3dc87 ("drm/mgag200: Split MISC register update into PLL selection, SYNC and I/O")
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Emil Velikov <emil.velikov@collabora.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: "José Roberto de Souza" <jose.souza@intel.com>
Cc: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Cc: Rong Chen <rong.a.chen@intel.com>
Cc: John Donnelly <john.p.donnelly@Oracle.com>
---
 drivers/gpu/drm/mgag200/mgag200_mode.c | 6 ++----
 drivers/gpu/drm/mgag200/mgag200_reg.h  | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index f16bd278ab7e4..3b7235bd0bcba 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -1018,10 +1018,8 @@ static void mgag200_init_regs(struct mga_device *mdev)
 	if (mdev->type == G200_EW3)
 		WREG_ECRT(0x34, 0x5);
 
-	misc = RREG8(MGA_MISC_IN);
-	misc |= MGAREG_MISC_IOADSEL |
-		MGAREG_MISC_RAMMAPEN |
-		MGAREG_MISC_HIGH_PG_SEL;
+	misc = MGAREG_MISC_HPGODDEV |
+	       MGAREG_MISC_IOADSEL;
 	WREG8(MGA_MISC_OUT, misc);
 }
 
diff --git a/drivers/gpu/drm/mgag200/mgag200_reg.h b/drivers/gpu/drm/mgag200/mgag200_reg.h
index 29f7194faadc0..f6629e0d4bdf2 100644
--- a/drivers/gpu/drm/mgag200/mgag200_reg.h
+++ b/drivers/gpu/drm/mgag200/mgag200_reg.h
@@ -228,7 +228,7 @@
 #define MGAREG_MISC_CLK_SEL_MGA_PIX	(0x2 << 2)
 #define MGAREG_MISC_CLK_SEL_MGA_MSK	(0x3 << 2)
 #define MGAREG_MISC_VIDEO_DIS	(0x1 << 4)
-#define MGAREG_MISC_HIGH_PG_SEL	(0x1 << 5)
+#define MGAREG_MISC_HPGODDEV		BIT(5)
 #define MGAREG_MISC_HSYNCPOL		BIT(6)
 #define MGAREG_MISC_VSYNCPOL		BIT(7)
 
-- 
2.27.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2020-06-16 14:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16 14:26 Thomas Zimmermann [this message]
2020-06-16 15:14 ` [PATCH] drm/mgag200: Don't set <rammapen> in MISC Emil Velikov
2020-06-17  6:28   ` Thomas Zimmermann
2020-06-17  9:22     ` Rong Chen
2020-06-17 12:29       ` Thomas Zimmermann
2020-06-18  1:40         ` Rong Chen
2020-06-18 13:36           ` Thomas Zimmermann
2020-06-17 19:09     ` Emil Velikov

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=20200616142630.20129-1-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@redhat.com \
    --cc=andrzej.p@collabora.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=emil.velikov@collabora.com \
    --cc=john.p.donnelly@Oracle.com \
    --cc=jose.souza@intel.com \
    --cc=kraxel@redhat.com \
    --cc=rong.a.chen@intel.com \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).