diff options
author | Thierry Reding <treding@nvidia.com> | 2013-10-07 03:55:57 -0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2013-10-31 04:55:44 -0400 |
commit | 497c56a5817f1610ca189e1dc546934c7ce8eb7d (patch) | |
tree | c9a6e76e2d466c9dd77722333b217cb4fa5fab94 | |
parent | f8c3325584220fd7fb559f9867a926668ae5630c (diff) |
drm/tegra: Use symbolic names for gr2d registers
Instead of using magic numbers for the registers which contain memory
addresses in the firewall table, using symbolic names.
Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r-- | drivers/gpu/drm/tegra/gr2d.c | 18 | ||||
-rw-r--r-- | drivers/gpu/drm/tegra/gr2d.h | 28 |
2 files changed, 42 insertions, 4 deletions
diff --git a/drivers/gpu/drm/tegra/gr2d.c b/drivers/gpu/drm/tegra/gr2d.c index 4e407e30da1c..bbeedc24d004 100644 --- a/drivers/gpu/drm/tegra/gr2d.c +++ b/drivers/gpu/drm/tegra/gr2d.c | |||
@@ -18,8 +18,7 @@ | |||
18 | 18 | ||
19 | #include "drm.h" | 19 | #include "drm.h" |
20 | #include "gem.h" | 20 | #include "gem.h" |
21 | 21 | #include "gr2d.h" | |
22 | #define GR2D_NUM_REGS 0x4d | ||
23 | 22 | ||
24 | struct gr2d { | 23 | struct gr2d { |
25 | struct tegra_drm_client client; | 24 | struct tegra_drm_client client; |
@@ -259,8 +258,19 @@ static const struct of_device_id gr2d_match[] = { | |||
259 | }; | 258 | }; |
260 | 259 | ||
261 | static const u32 gr2d_addr_regs[] = { | 260 | static const u32 gr2d_addr_regs[] = { |
262 | 0x1a, 0x1b, 0x26, 0x2b, 0x2c, 0x2d, 0x31, 0x32, | 261 | GR2D_UA_BASE_ADDR, |
263 | 0x48, 0x49, 0x4a, 0x4b, 0x4c | 262 | GR2D_VA_BASE_ADDR, |
263 | GR2D_PAT_BASE_ADDR, | ||
264 | GR2D_DSTA_BASE_ADDR, | ||
265 | GR2D_DSTB_BASE_ADDR, | ||
266 | GR2D_DSTC_BASE_ADDR, | ||
267 | GR2D_SRCA_BASE_ADDR, | ||
268 | GR2D_SRCB_BASE_ADDR, | ||
269 | GR2D_SRC_BASE_ADDR_SB, | ||
270 | GR2D_DSTA_BASE_ADDR_SB, | ||
271 | GR2D_DSTB_BASE_ADDR_SB, | ||
272 | GR2D_UA_BASE_ADDR_SB, | ||
273 | GR2D_VA_BASE_ADDR_SB, | ||
264 | }; | 274 | }; |
265 | 275 | ||
266 | static int gr2d_probe(struct platform_device *pdev) | 276 | static int gr2d_probe(struct platform_device *pdev) |
diff --git a/drivers/gpu/drm/tegra/gr2d.h b/drivers/gpu/drm/tegra/gr2d.h new file mode 100644 index 000000000000..4d7304fb015e --- /dev/null +++ b/drivers/gpu/drm/tegra/gr2d.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2013 NVIDIA Corporation | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #ifndef TEGRA_GR2D_H | ||
10 | #define TEGRA_GR2D_H | ||
11 | |||
12 | #define GR2D_UA_BASE_ADDR 0x1a | ||
13 | #define GR2D_VA_BASE_ADDR 0x1b | ||
14 | #define GR2D_PAT_BASE_ADDR 0x26 | ||
15 | #define GR2D_DSTA_BASE_ADDR 0x2b | ||
16 | #define GR2D_DSTB_BASE_ADDR 0x2c | ||
17 | #define GR2D_DSTC_BASE_ADDR 0x2d | ||
18 | #define GR2D_SRCA_BASE_ADDR 0x31 | ||
19 | #define GR2D_SRCB_BASE_ADDR 0x32 | ||
20 | #define GR2D_SRC_BASE_ADDR_SB 0x48 | ||
21 | #define GR2D_DSTA_BASE_ADDR_SB 0x49 | ||
22 | #define GR2D_DSTB_BASE_ADDR_SB 0x4a | ||
23 | #define GR2D_UA_BASE_ADDR_SB 0x4b | ||
24 | #define GR2D_VA_BASE_ADDR_SB 0x4c | ||
25 | |||
26 | #define GR2D_NUM_REGS 0x4d | ||
27 | |||
28 | #endif | ||