dri-devel Archive on lore.kernel.org
 help / color / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: dri-devel@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH 6/7] radeon: kill r100_io_(r|w)reg
Date: Sun, 28 Nov 2010 19:06:14 +0100
Message-ID: <1290967575-22705-7-git-send-email-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <1290967575-22705-1-git-send-email-daniel.vetter@ffwll.ch>

Used in a macro with only a single call-site for each.
IHMO that's a bit too much indirection. Fold them in.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/radeon/radeon.h        |   22 ----------------------
 drivers/gpu/drm/radeon/radeon_device.c |   16 ++++++++++++----
 2 files changed, 12 insertions(+), 26 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 942f5f2..7afb08e 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -1202,26 +1202,6 @@ static inline void r100_mm_wreg(struct radeon_device *rdev, uint32_t reg, uint32
 	}
 }
 
-static inline u32 r100_io_rreg(struct radeon_device *rdev, u32 reg)
-{
-	if (reg < rdev->rio_mem_size)
-		return ioread32(rdev->rio_mem + reg);
-	else {
-		iowrite32(reg, rdev->rio_mem + RADEON_MM_INDEX);
-		return ioread32(rdev->rio_mem + RADEON_MM_DATA);
-	}
-}
-
-static inline void r100_io_wreg(struct radeon_device *rdev, u32 reg, u32 v)
-{
-	if (reg < rdev->rio_mem_size)
-		iowrite32(v, rdev->rio_mem + reg);
-	else {
-		iowrite32(reg, rdev->rio_mem + RADEON_MM_INDEX);
-		iowrite32(v, rdev->rio_mem + RADEON_MM_DATA);
-	}
-}
-
 /*
  * Cast helper
  */
@@ -1260,8 +1240,6 @@ static inline void r100_io_wreg(struct radeon_device *rdev, u32 reg, u32 v)
 		WREG32_PLL(reg, tmp_);				\
 	} while (0)
 #define DREG32_SYS(sqf, rdev, reg) seq_printf((sqf), #reg " : 0x%08X\n", r100_mm_rreg((rdev), (reg)))
-#define RREG32_IO(reg) r100_io_rreg(rdev, (reg))
-#define WREG32_IO(reg, v) r100_io_wreg(rdev, (reg), (v))
 
 /*
  * Indirect registers accessor
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 1f752ef..14c935c 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -496,16 +496,24 @@ static void cail_ioreg_write(struct card_info *info, uint32_t reg, uint32_t val)
 {
 	struct radeon_device *rdev = info->dev->dev_private;
 
-	WREG32_IO(reg*4, val);
+	if (reg < rdev->rio_mem_size)
+		iowrite32(val, rdev->rio_mem + reg);
+	else {
+		iowrite32(reg, rdev->rio_mem + RADEON_MM_INDEX);
+		iowrite32(val, rdev->rio_mem + RADEON_MM_DATA);
+	}
 }
 
 static uint32_t cail_ioreg_read(struct card_info *info, uint32_t reg)
 {
 	struct radeon_device *rdev = info->dev->dev_private;
-	uint32_t r;
 
-	r = RREG32_IO(reg*4);
-	return r;
+	if (reg < rdev->rio_mem_size)
+		return ioread32(rdev->rio_mem + reg);
+	else {
+		iowrite32(reg, rdev->rio_mem + RADEON_MM_INDEX);
+		return ioread32(rdev->rio_mem + RADEON_MM_DATA);
+	}
 }
 
 int radeon_atombios_init(struct radeon_device *rdev)
-- 
1.7.1

  parent reply index

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-28 18:06 [PATCH 0/7] radeon_asic header cleanup, part 2 Daniel Vetter
2010-11-28 18:06 ` [PATCH 1/7] radeon: consolidate asic-specific function decls for pre-r600 Daniel Vetter
2010-11-29 15:29   ` Alex Deucher
2010-11-28 18:06 ` [PATCH 2/7] radeon: consolidate asic-specific function decls for r600 & later Daniel Vetter
2010-11-29 15:34   ` Alex Deucher
2010-11-28 18:06 ` [PATCH 3/7] radeon: drop extern from function decls Daniel Vetter
2010-11-29 15:36   ` Alex Deucher
2010-11-28 18:06 ` [PATCH 4/7] radeon: kill decls for inline functions Daniel Vetter
2010-11-29 15:37   ` Alex Deucher
2010-11-28 18:06 ` [PATCH 5/7] radeon: move blit functions to radeon_asic.h Daniel Vetter
2010-11-29 15:37   ` Alex Deucher
2010-11-28 18:06 ` Daniel Vetter [this message]
2010-11-29 15:40   ` [PATCH 6/7] radeon: kill r100_io_(r|w)reg Alex Deucher
2010-11-28 18:06 ` [PATCH 7/7] radeon: kill rdev->pciep_(r|w)reg Daniel Vetter
2010-11-29 15:43   ` Alex Deucher

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=1290967575-22705-7-git-send-email-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.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

dri-devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dri-devel/0 dri-devel/git/0.git
	git clone --mirror https://lore.kernel.org/dri-devel/1 dri-devel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dri-devel dri-devel/ https://lore.kernel.org/dri-devel \
		dri-devel@lists.freedesktop.org
	public-inbox-index dri-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.freedesktop.lists.dri-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git