~gma500/+junk/emgd152-natty

« back to all changes in this revision

Viewing changes to emgd-dkms-1.5.15.3082/emgd/include/debug.h

  • Committer: Luca Forina
  • Date: 2011-02-06 15:11:54 UTC
  • Revision ID: luca.forina@gmail.com-20110206151154-9dzn5ugxjub9qenb
Upload Emgd 1.5.2 for Natty (override Maverick)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- pse-c -*-
 
2
 *-----------------------------------------------------------------------------
 
3
 * Filename: debug.h
 
4
 * $Revision: 1.5 $
 
5
 *-----------------------------------------------------------------------------
 
6
 * Copyright © 2002-2010, Intel Corporation.
 
7
 *
 
8
 * This program is free software; you can redistribute it and/or modify it
 
9
 * under the terms and conditions of the GNU General Public License,
 
10
 * version 2, as published by the Free Software Foundation.
 
11
 *
 
12
 * This program is distributed in the hope it will be useful, but WITHOUT
 
13
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
14
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 
15
 * more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License along with
 
18
 * this program; if not, write to the Free Software Foundation, Inc.,
 
19
 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
 
20
 *
 
21
 *-----------------------------------------------------------------------------
 
22
 * Description:
 
23
 *  Contains debug macros
 
24
 *-----------------------------------------------------------------------------
 
25
 */
 
26
#ifndef __DEBUG_H
 
27
#define __DEBUG_H
 
28
 
 
29
 
 
30
 
 
31
#define IGD_PRINTK_PALETTE(p) \
 
32
{ \
 
33
        EMGD_DEBUG("Palette Struct:"); \
 
34
        EMGD_DEBUG_S("    [%4d].id",    (unsigned int) p->palette_id); \
 
35
        EMGD_DEBUG_S("    [%4d].type",  (unsigned int) p->palette_type); \
 
36
        EMGD_DEBUG_S("    [%4d].size",  (unsigned int) p->size); \
 
37
}
 
38
 
 
39
#define IGD_PRINTK_3DSTRETCH(p, s, d, f) \
 
40
{ \
 
41
        EMGD_DEBUG("Ring Buffer Struct:"); \
 
42
        EMGD_DEBUG_S("    Priority = [%8d]",       (unsigned int) p); \
 
43
        EMGD_DEBUG_S("    Flags    = [%08x]",      (unsigned int) f); \
 
44
        EMGD_DEBUG_S("    --------------"); \
 
45
        EMGD_DEBUG_S("    Source surface"); \
 
46
        EMGD_DEBUG_S("    --------------"); \
 
47
        EMGD_DEBUG_S("    [%08x].addr",            (unsigned int) s->addr); \
 
48
        EMGD_DEBUG_S("    [%8d].height",           (unsigned int) s->height); \
 
49
        EMGD_DEBUG_S("    [%8d].width",            (unsigned int) s->width); \
 
50
        EMGD_DEBUG_S("    [%8d].pitch",            (unsigned int) s->pitch); \
 
51
        EMGD_DEBUG_S("    [%08x].pixel_format",    (unsigned int) s->pixel_format); \
 
52
        EMGD_DEBUG_S("    -------------------"); \
 
53
        EMGD_DEBUG_S("    Destination surface"); \
 
54
        EMGD_DEBUG_S("    -------------------"); \
 
55
        EMGD_DEBUG_S("    [%8d].offset",           (unsigned int) d->offset); \
 
56
        EMGD_DEBUG_S("    [%8d].pitch",            (unsigned int) d->pitch); \
 
57
        EMGD_DEBUG_S("    [%8d].x1",               (unsigned int) d->x1); \
 
58
        EMGD_DEBUG_S("    [%8d].y1",               (unsigned int) d->y1); \
 
59
        EMGD_DEBUG_S("    [%8d].x2",               (unsigned int) d->x2); \
 
60
        EMGD_DEBUG_S("    [%8d].y2",               (unsigned int) d->y2); \
 
61
        EMGD_DEBUG_S("    [%08x].pixel_format",    (unsigned int) d->pixel_format); \
 
62
        EMGD_DEBUG_S("    [%08x].byte_mask",       (unsigned int) d->byte_mask); \
 
63
}
 
64
 
 
65
#define IGD_PRINT_RB_BUFFER(a) \
 
66
{ \
 
67
        EMGD_DEBUG("Ring Buffer Struct:"); \
 
68
        EMGD_DEBUG_S("    [%08x].id",              (unsigned int) a->id); \
 
69
        EMGD_DEBUG_S("    [%08x].size",            (unsigned int) a->size); \
 
70
        EMGD_DEBUG_S("    [%08x].addr",            (unsigned int) a->addr); \
 
71
        EMGD_DEBUG_S("    [%p].virt",             a->virt); \
 
72
        EMGD_DEBUG_S("    [%p].start  = [%08x]",  a->start, (unsigned int) EMGD_READ32(a->start)); \
 
73
        EMGD_DEBUG_S("    [%p].head   = [%08x]",  a->head,  (0x001ffffc & ((unsigned int) EMGD_READ32(a->head)))); \
 
74
        EMGD_DEBUG_S("    [%p].tail   = [%08x]",  a->tail,  (0x001ffff8 & (unsigned int) EMGD_READ32(a->tail))); \
 
75
        EMGD_DEBUG_S("    [%p].ctrl   = [%08x]",  a->ctrl,  (unsigned int) EMGD_READ32(a->ctrl)); \
 
76
        EMGD_DEBUG_S("    [%08x].res",             (unsigned int) a->reservation); \
 
77
}
 
78
 
 
79
#define IGD_PRINTK_DISPLAY(display_context) \
 
80
{ \
 
81
        EMGD_DEBUG("Display Context:"); \
 
82
        EMGD_DEBUG_S("    [%8d].plane",  (int) display_context->plane); \
 
83
        EMGD_DEBUG_S("    [%8d].blend",  (int) display_context->blend_operation); \
 
84
        EMGD_DEBUG_S("    [%8d].pipe",   (int) display_context->pipe); \
 
85
        EMGD_DEBUG_S("    [%8d].port",   (int) display_context->port); \
 
86
        EMGD_DEBUG_S("    [%8d].graph",  (int) display_context->alloc_type); \
 
87
        EMGD_DEBUG_S("    [%8d].mode_n", (int) display_context->mode_number); \
 
88
        EMGD_DEBUG_S("    [%8d].ref",    (int) display_context->refresh); \
 
89
        EMGD_DEBUG_S("    [%8d].enable", (int) display_context->enable); \
 
90
        EMGD_DEBUG_S("    [%8d].ulPipe", (int) display_context->ulPipe); \
 
91
        EMGD_DEBUG_S("    [%8d].ulMode", (int) display_context->ulModeNumber); \
 
92
        EMGD_DEBUG_S("    [%8d].ulRef",  (int) display_context->ulRefresh); \
 
93
}
 
94
 
 
95
#define IGD_PRINTK_FBINFO(fb_info) \
 
96
{ \
 
97
        EMGD_DEBUG("FrameBuffer Info:"); \
 
98
        EMGD_DEBUG_S("    [%8d].width",  (int) fb_info->width); \
 
99
        EMGD_DEBUG_S("    [%8d].height",  (int) fb_info->height); \
 
100
        EMGD_DEBUG_S("    [%8d].screen_pitch",  (int) fb_info->screen_pitch); \
 
101
        EMGD_DEBUG_S("    [%8x].fb_base_offset",  (unsigned int) fb_info->fb_base_offset); \
 
102
        EMGD_DEBUG_S("    [%8x].pixel_format",  (unsigned int) fb_info->pixel_format); \
 
103
}
 
104
 
 
105
#define IGD_PRINTK_PTINFO(pt_info) \
 
106
{ \
 
107
        EMGD_DEBUG("Port Info:"); \
 
108
        EMGD_DEBUG_S("    [%8d].width",  (int) pt_info->width); \
 
109
        EMGD_DEBUG_S("    [%8d].height",  (int) pt_info->height); \
 
110
        EMGD_DEBUG_S("    [%8d].x_offset",  (int) pt_info->x_offset); \
 
111
        EMGD_DEBUG_S("    [%8d].y_offset",  (int) pt_info->y_offset); \
 
112
        EMGD_DEBUG_S("    [%8d].refresh",  (int) pt_info->refresh); \
 
113
        EMGD_DEBUG_S("    [%8d].hsync_start",  (unsigned int) pt_info->hsync_start); \
 
114
        EMGD_DEBUG_S("    [%8d].hsync_end",  (unsigned int) pt_info->hsync_end); \
 
115
        EMGD_DEBUG_S("    [%8d].hblank_start",  (unsigned int) pt_info->hblank_start); \
 
116
        EMGD_DEBUG_S("    [%8d].hblank_end",  (unsigned int) pt_info->hblank_end); \
 
117
        EMGD_DEBUG_S("    [%8d].vsync_start",  (unsigned int) pt_info->vsync_start); \
 
118
        EMGD_DEBUG_S("    [%8d].vsync_end",  (unsigned int) pt_info->vsync_end); \
 
119
        EMGD_DEBUG_S("    [%8d].vblank_start",  (unsigned int) pt_info->vblank_start); \
 
120
        EMGD_DEBUG_S("    [%8d].vblank_end",  (unsigned int) pt_info->vblank_end); \
 
121
        EMGD_DEBUG_S("    [%8x].flags",  (unsigned int) pt_info->flags); \
 
122
}
 
123
 
 
124
#define IGD_PRINTK_FBINFO_2(a,b) \
 
125
{ \
 
126
        EMGD_DEBUG("FrameBuffer Info:"); \
 
127
        EMGD_DEBUG_S("    a=[%8d] b=[%8d].width",  (int) (a)->width, (int) (b)->width); \
 
128
        EMGD_DEBUG_S("    a=[%8d] b=[%8d].height",  (int) (a)->height, (int) (b)->height); \
 
129
        EMGD_DEBUG_S("    a=[%8d] b=[%8d].screen_pitch",  (int) (a)->screen_pitch, (int) (b)->screen_pitch); \
 
130
        EMGD_DEBUG_S("    a=[%8x] b=[%8x].fb_base_offset",  (unsigned int) (a)->fb_base_offset, (unsigned int) (b)->fb_base_offset); \
 
131
        EMGD_DEBUG_S("    a=[%8x] b=[%8x].pixel_format",  (unsigned int) (a)->pixel_format, (unsigned int) (b)->pixel_format); \
 
132
}
 
133
 
 
134
#define IGD_PRINTK_PTINFO_2(a,b) \
 
135
{ \
 
136
        EMGD_DEBUG("Port Info:"); \
 
137
        EMGD_DEBUG_S("    a=[%8d] b=[%8d].width",  (int) a->width, (int) b->width); \
 
138
        EMGD_DEBUG_S("    a=[%8d] b=[%8d].height",  (int) a->height, (int) b->height); \
 
139
        EMGD_DEBUG_S("    a=[%8d] b=[%8d].x_offset",  (int) a->x_offset, (int) b->x_offset); \
 
140
        EMGD_DEBUG_S("    a=[%8d] b=[%8d].y_offset",  (int) a->y_offset, (int) b->y_offset); \
 
141
        EMGD_DEBUG_S("    a=[%8d] b=[%8d].refresh",  (int) a->refresh, (int) b->refresh); \
 
142
        EMGD_DEBUG_S("    a=[%8d] b=[%8d].hsync_start",  (unsigned int) a->hsync_start, (unsigned int) b->hsync_start); \
 
143
        EMGD_DEBUG_S("    a=[%8d] b=[%8d].hsync_end",  (unsigned int) a->hsync_end, (unsigned int) b->hsync_end); \
 
144
        EMGD_DEBUG_S("    a=[%8d] b=[%8d].hblank_start",  (unsigned int) a->hblank_start, (unsigned int) b->hblank_start); \
 
145
        EMGD_DEBUG_S("    a=[%8d] b=[%8d].hblank_end",  (unsigned int) a->hblank_end, (unsigned int) b->hblank_end); \
 
146
        EMGD_DEBUG_S("    a=[%8d] b=[%8d].vsync_start",  (unsigned int) a->vsync_start, (unsigned int) b->vsync_start); \
 
147
        EMGD_DEBUG_S("    a=[%8d] b=[%8d].vsync_end",  (unsigned int) a->vsync_end, (unsigned int) b->vsync_end); \
 
148
        EMGD_DEBUG_S("    a=[%8d] b=[%8d].vblank_start",  (unsigned int) a->vblank_start, (unsigned int) b->vblank_start); \
 
149
        EMGD_DEBUG_S("    a=[%8d] b=[%8d].vblank_end",  (unsigned int) a->vblank_end, (unsigned int) b->vblank_end); \
 
150
        EMGD_DEBUG_S("    a=[%8x] b=[%8x].flags",  (unsigned int) a->flags, (unsigned int) b->flags); \
 
151
}
 
152
 
 
153
#define IGD_PRINT_ICH_GPIO(ich_gpio_base) \
 
154
{ \
 
155
        EMGD_DEBUG("GPIO_USE_SEL = 0x%lx", EMGD_READ_PORT32(ich_gpio_base + 0x0)); \
 
156
        EMGD_DEBUG("GPIO_IO_SEL = 0x%lx", EMGD_READ_PORT32(ich_gpio_base + 0x4)); \
 
157
        EMGD_DEBUG("GPIO_LVL = 0x%lx", EMGD_READ_PORT32(ich_gpio_base + 0xc)); \
 
158
        EMGD_DEBUG("GPIO_INV = 0x%lx", EMGD_READ_PORT32(ich_gpio_base + 0x2c)); \
 
159
        EMGD_DEBUG("GPIO_USE_SEL2 = 0x%lx", EMGD_READ_PORT32(ich_gpio_base + 0x30));\
 
160
        EMGD_DEBUG("GPIO_IO_SEL2 = 0x%lx", EMGD_READ_PORT32(ich_gpio_base + 0x34)); \
 
161
        EMGD_DEBUG("GPIO_LVL2 = 0x%lx", EMGD_READ_PORT32(ich_gpio_base + 0x38)); \
 
162
}
 
163
 
 
164
#endif
 
165
 
 
166
/*----------------------------------------------------------------------------
 
167
 * File Revision History
 
168
 * $Id: debug.h,v 1.5 2010/07/23 16:54:50 bpaauwe Exp $
 
169
 * $Source: /nfs/fm/proj/eia/cvsroot/koheo/linux/egd_drm/emgd/include/debug.h,v $
 
170
 *----------------------------------------------------------------------------
 
171
 */