diff options
author | Ilija Hadzic <ihadzic@research.bell-labs.com> | 2012-02-01 11:42:38 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-02-03 04:31:14 -0500 |
commit | 86a4d69c0ad62ced87a74bbd43f2acefc66a97b0 (patch) | |
tree | c27679c0f52b02d07793f7f06f54ef44f31f58e0 /drivers/gpu/drm/radeon | |
parent | a14b1b42477c5ef089fcda88cbaae50d979eb8f9 (diff) |
drm/radeon/kms: common definitions for blit copy code
R600/700 and Evergreen/NI blit code have a few redundant
definitions in respective .c file. Move common definitions
into a separate (new) .h file.
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r-- | drivers/gpu/drm/radeon/evergreen_blit_kms.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600_blit_kms.c | 15 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_blit_common.h | 44 |
3 files changed, 46 insertions, 25 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen_blit_kms.c b/drivers/gpu/drm/radeon/evergreen_blit_kms.c index 2379849515c7..4e83fdcf4bc5 100644 --- a/drivers/gpu/drm/radeon/evergreen_blit_kms.c +++ b/drivers/gpu/drm/radeon/evergreen_blit_kms.c | |||
@@ -32,17 +32,7 @@ | |||
32 | #include "evergreend.h" | 32 | #include "evergreend.h" |
33 | #include "evergreen_blit_shaders.h" | 33 | #include "evergreen_blit_shaders.h" |
34 | #include "cayman_blit_shaders.h" | 34 | #include "cayman_blit_shaders.h" |
35 | 35 | #include "radeon_blit_common.h" | |
36 | #define DI_PT_RECTLIST 0x11 | ||
37 | #define DI_INDEX_SIZE_16_BIT 0x0 | ||
38 | #define DI_SRC_SEL_AUTO_INDEX 0x2 | ||
39 | |||
40 | #define FMT_8 0x1 | ||
41 | #define FMT_5_6_5 0x8 | ||
42 | #define FMT_8_8_8_8 0x1a | ||
43 | #define COLOR_8 0x1 | ||
44 | #define COLOR_5_6_5 0x8 | ||
45 | #define COLOR_8_8_8_8 0x1a | ||
46 | 36 | ||
47 | /* emits 17 */ | 37 | /* emits 17 */ |
48 | static void | 38 | static void |
diff --git a/drivers/gpu/drm/radeon/r600_blit_kms.c b/drivers/gpu/drm/radeon/r600_blit_kms.c index accc032c103f..db38f587f27a 100644 --- a/drivers/gpu/drm/radeon/r600_blit_kms.c +++ b/drivers/gpu/drm/radeon/r600_blit_kms.c | |||
@@ -30,20 +30,7 @@ | |||
30 | 30 | ||
31 | #include "r600d.h" | 31 | #include "r600d.h" |
32 | #include "r600_blit_shaders.h" | 32 | #include "r600_blit_shaders.h" |
33 | 33 | #include "radeon_blit_common.h" | |
34 | #define DI_PT_RECTLIST 0x11 | ||
35 | #define DI_INDEX_SIZE_16_BIT 0x0 | ||
36 | #define DI_SRC_SEL_AUTO_INDEX 0x2 | ||
37 | |||
38 | #define FMT_8 0x1 | ||
39 | #define FMT_5_6_5 0x8 | ||
40 | #define FMT_8_8_8_8 0x1a | ||
41 | #define COLOR_8 0x1 | ||
42 | #define COLOR_5_6_5 0x8 | ||
43 | #define COLOR_8_8_8_8 0x1a | ||
44 | |||
45 | #define RECT_UNIT_H 32 | ||
46 | #define RECT_UNIT_W (RADEON_GPU_PAGE_SIZE / 4 / RECT_UNIT_H) | ||
47 | 34 | ||
48 | /* emits 21 on rv770+, 23 on r600 */ | 35 | /* emits 21 on rv770+, 23 on r600 */ |
49 | static void | 36 | static void |
diff --git a/drivers/gpu/drm/radeon/radeon_blit_common.h b/drivers/gpu/drm/radeon/radeon_blit_common.h new file mode 100644 index 000000000000..4ecbe72c9d2d --- /dev/null +++ b/drivers/gpu/drm/radeon/radeon_blit_common.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * Copyright 2009 Advanced Micro Devices, Inc. | ||
3 | * Copyright 2009 Red Hat Inc. | ||
4 | * Copyright 2012 Alcatel-Lucent, Inc. | ||
5 | * | ||
6 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
7 | * copy of this software and associated documentation files (the "Software"), | ||
8 | * to deal in the Software without restriction, including without limitation | ||
9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
10 | * and/or sell copies of the Software, and to permit persons to whom the | ||
11 | * Software is furnished to do so, subject to the following conditions: | ||
12 | * | ||
13 | * The above copyright notice and this permission notice (including the next | ||
14 | * paragraph) shall be included in all copies or substantial portions of the | ||
15 | * Software. | ||
16 | * | ||
17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
20 | * THE COPYRIGHT HOLDER(S) AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
21 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
22 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
23 | * DEALINGS IN THE SOFTWARE. | ||
24 | * | ||
25 | */ | ||
26 | |||
27 | #ifndef __RADEON_BLIT_COMMON_H__ | ||
28 | |||
29 | #define DI_PT_RECTLIST 0x11 | ||
30 | #define DI_INDEX_SIZE_16_BIT 0x0 | ||
31 | #define DI_SRC_SEL_AUTO_INDEX 0x2 | ||
32 | |||
33 | #define FMT_8 0x1 | ||
34 | #define FMT_5_6_5 0x8 | ||
35 | #define FMT_8_8_8_8 0x1a | ||
36 | #define COLOR_8 0x1 | ||
37 | #define COLOR_5_6_5 0x8 | ||
38 | #define COLOR_8_8_8_8 0x1a | ||
39 | |||
40 | #define RECT_UNIT_H 32 | ||
41 | #define RECT_UNIT_W (RADEON_GPU_PAGE_SIZE / 4 / RECT_UNIT_H) | ||
42 | |||
43 | #define __RADEON_BLIT_COMMON_H__ | ||
44 | #endif | ||