1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
From 52e447159bc875aade409bd5db15808e6bde7b3d Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Thu, 28 Sep 2017 12:42:01 +1000
Subject: [PATCH 2412/4131] amdgpu/dc: don't check for 0 on register
read/writes always.
This adds ~50k to the driver text segment, and 10k to data segment.
text data bss dec hex filename
2385556 39681 1045 2426282 2505aa drivers/gpu/drm/amd/amdgpu/amdgpu.o
text data bss dec hex filename
2336593 28857 1045 2366495 241c1f drivers/gpu/drm/amd/amdgpu/amdgpu.o
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
---
drivers/gpu/drm/amd/display/dc/dm_services.h | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dm_services.h b/drivers/gpu/drm/amd/display/dc/dm_services.h
index e43f9b2..53fd300 100644
--- a/drivers/gpu/drm/amd/display/dc/dm_services.h
+++ b/drivers/gpu/drm/amd/display/dc/dm_services.h
@@ -92,6 +92,9 @@ irq_handler_idx dm_register_interrupt(
*
*/
+/* enable for debugging new code, this adds 50k to the driver size. */
+/* #define DM_CHECK_ADDR_0 */
+
#define dm_read_reg(ctx, address) \
dm_read_reg_func(ctx, address, __func__)
@@ -101,12 +104,12 @@ static inline uint32_t dm_read_reg_func(
const char *func_name)
{
uint32_t value;
-
+#ifdef DM_CHECK_ADDR_0
if (address == 0) {
DC_ERR("invalid register read; address = 0\n");
return 0;
}
-
+#endif
value = cgs_read_register(ctx->cgs_device, address);
return value;
@@ -121,10 +124,12 @@ static inline void dm_write_reg_func(
uint32_t value,
const char *func_name)
{
+#ifdef DM_CHECK_ADDR_0
if (address == 0) {
DC_ERR("invalid register write. address = 0");
return;
}
+#endif
cgs_write_register(ctx->cgs_device, address, value);
}
--
2.7.4
|