aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.jf.intel.com>2011-03-03 07:38:04 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-03-07 16:28:05 -0500
commit487e873dd3f8d7ede7635896e19376ef78157721 (patch)
tree96cf25cbc305c08ebc0c3a00c9c22506269bd5ae
parent2145cff54f512907a4c4fa906f957fa62406e558 (diff)
staging: gma500: Resync the patch queue with GregKH's space cleanup.
Remove all sorts of bits we can get rid of. We are now a very simple KMS driver relying on the stolen memory for our framebuffer base (which is for the moment hardcoded). To support multiple frame buffers and some accel bits we will need some kind of memory allocator, possibly a minimal use of GEM. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/gma500/psb_bl.c10
-rw-r--r--drivers/staging/gma500/psb_drm.h507
-rw-r--r--drivers/staging/gma500/psb_drv.c55
-rw-r--r--drivers/staging/gma500/psb_drv.h1
-rw-r--r--drivers/staging/gma500/psb_intel_bios.c2
-rw-r--r--drivers/staging/gma500/psb_intel_bios.h2
-rw-r--r--drivers/staging/gma500/psb_intel_reg.h551
-rw-r--r--drivers/staging/gma500/psb_irq.c4
-rw-r--r--drivers/staging/gma500/psb_powermgmt.c5
9 files changed, 365 insertions, 772 deletions
diff --git a/drivers/staging/gma500/psb_bl.c b/drivers/staging/gma500/psb_bl.c
index 52edb43c920..70c17b352f9 100644
--- a/drivers/staging/gma500/psb_bl.c
+++ b/drivers/staging/gma500/psb_bl.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * psb backlight using HAL 2 * psb backlight interface
3 * 3 *
4 * Copyright (c) 2009, Intel Corporation. 4 * Copyright (c) 2009, Intel Corporation.
5 * 5 *
@@ -73,6 +73,8 @@ int psb_get_brightness(struct backlight_device *bd)
73 DRM_DEBUG_DRIVER("brightness = 0x%x\n", psb_brightness); 73 DRM_DEBUG_DRIVER("brightness = 0x%x\n", psb_brightness);
74 74
75 /* return locally cached var instead of HW read (due to DPST etc.) */ 75 /* return locally cached var instead of HW read (due to DPST etc.) */
76 /* FIXME: ideally return actual value in case firmware fiddled with
77 it */
76 return psb_brightness; 78 return psb_brightness;
77} 79}
78 80
@@ -83,7 +85,7 @@ static const struct backlight_ops psb_ops = {
83 85
84static int device_backlight_init(struct drm_device *dev) 86static int device_backlight_init(struct drm_device *dev)
85{ 87{
86 unsigned long CoreClock; 88 unsigned long core_clock;
87 /* u32 bl_max_freq; */ 89 /* u32 bl_max_freq; */
88 /* unsigned long value; */ 90 /* unsigned long value; */
89 u16 bl_max_freq; 91 u16 bl_max_freq;
@@ -102,9 +104,9 @@ static int device_backlight_init(struct drm_device *dev)
102 blc_brightnesscmd = dev_priv->lvds_bl->brightnesscmd; 104 blc_brightnesscmd = dev_priv->lvds_bl->brightnesscmd;
103 blc_type = dev_priv->lvds_bl->type; 105 blc_type = dev_priv->lvds_bl->type;
104 106
105 CoreClock = dev_priv->core_freq; 107 core_clock = dev_priv->core_freq;
106 108
107 value = (CoreClock * MHz) / BLC_PWM_FREQ_CALC_CONSTANT; 109 value = (core_clock * MHz) / BLC_PWM_FREQ_CALC_CONSTANT;
108 value *= blc_pwm_precision_factor; 110 value *= blc_pwm_precision_factor;
109 value /= bl_max_freq; 111 value /= bl_max_freq;
110 value /= blc_pwm_precision_factor; 112 value /= blc_pwm_precision_factor;
diff --git a/drivers/staging/gma500/psb_drm.h b/drivers/staging/gma500/psb_drm.h
index ef5fcd03b34..fb9b4245bad 100644
--- a/drivers/staging/gma500/psb_drm.h
+++ b/drivers/staging/gma500/psb_drm.h
@@ -31,17 +31,6 @@
31#include "psb_ttm_fence_user.h" 31#include "psb_ttm_fence_user.h"
32#include "psb_ttm_placement_user.h" 32#include "psb_ttm_placement_user.h"
33 33
34/*
35 * Menlow/MRST graphics driver package version
36 * a.b.c.xxxx
37 * a - Product Family: 5 - Linux
38 * b - Major Release Version: 0 - non-Gallium (Unbuntu);
39 * 1 - Gallium (Moblin2)
40 * c - Hotfix Release
41 * xxxx - Graphics internal build #
42 */
43#define PSB_PACKAGE_VERSION "5.3.0.32L.0036"
44
45#define DRM_PSB_SAREA_MAJOR 0 34#define DRM_PSB_SAREA_MAJOR 0
46#define DRM_PSB_SAREA_MINOR 2 35#define DRM_PSB_SAREA_MINOR 2
47#define PSB_FIXED_SHIFT 16 36#define PSB_FIXED_SHIFT 16
@@ -52,24 +41,24 @@
52 * Public memory types. 41 * Public memory types.
53 */ 42 */
54 43
55#define DRM_PSB_MEM_MMU TTM_PL_PRIV1 44#define DRM_PSB_MEM_MMU TTM_PL_PRIV1
56#define DRM_PSB_FLAG_MEM_MMU TTM_PL_FLAG_PRIV1 45#define DRM_PSB_FLAG_MEM_MMU TTM_PL_FLAG_PRIV1
57 46
58#define TTM_PL_CI TTM_PL_PRIV0 47#define TTM_PL_CI TTM_PL_PRIV0
59#define TTM_PL_FLAG_CI TTM_PL_FLAG_PRIV0 48#define TTM_PL_FLAG_CI TTM_PL_FLAG_PRIV0
60 49
61#define TTM_PL_RAR TTM_PL_PRIV2 50#define TTM_PL_RAR TTM_PL_PRIV2
62#define TTM_PL_FLAG_RAR TTM_PL_FLAG_PRIV2 51#define TTM_PL_FLAG_RAR TTM_PL_FLAG_PRIV2
63 52
64typedef int32_t psb_fixed; 53typedef s32 psb_fixed;
65typedef uint32_t psb_ufixed; 54typedef u32 psb_ufixed;
66 55
67static inline int32_t psb_int_to_fixed(int a) 56static inline s32 psb_int_to_fixed(int a)
68{ 57{
69 return a * (1 << PSB_FIXED_SHIFT); 58 return a * (1 << PSB_FIXED_SHIFT);
70} 59}
71 60
72static inline uint32_t psb_unsigned_to_ufixed(unsigned int a) 61static inline u32 psb_unsigned_to_ufixed(unsigned int a)
73{ 62{
74 return a << PSB_FIXED_SHIFT; 63 return a << PSB_FIXED_SHIFT;
75} 64}
@@ -82,13 +71,13 @@ typedef enum {
82} drm_cmd_status_t; 71} drm_cmd_status_t;
83 72
84struct drm_psb_scanout { 73struct drm_psb_scanout {
85 uint32_t buffer_id; /* DRM buffer object ID */ 74 u32 buffer_id; /* DRM buffer object ID */
86 uint32_t rotation; /* Rotation as in RR_rotation definitions */ 75 u32 rotation; /* Rotation as in RR_rotation definitions */
87 uint32_t stride; /* Buffer stride in bytes */ 76 u32 stride; /* Buffer stride in bytes */
88 uint32_t depth; /* Buffer depth in bits (NOT) bpp */ 77 u32 depth; /* Buffer depth in bits (NOT) bpp */
89 uint32_t width; /* Buffer width in pixels */ 78 u32 width; /* Buffer width in pixels */
90 uint32_t height; /* Buffer height in lines */ 79 u32 height; /* Buffer height in lines */
91 int32_t transform[3][3]; /* Buffer composite transform */ 80 s32 transform[3][3]; /* Buffer composite transform */
92 /* (scaling, rot, reflect) */ 81 /* (scaling, rot, reflect) */
93}; 82};
94 83
@@ -101,14 +90,14 @@ struct drm_psb_scanout {
101struct drm_psb_sarea { 90struct drm_psb_sarea {
102 /* Track changes of this data structure */ 91 /* Track changes of this data structure */
103 92
104 uint32_t major; 93 u32 major;
105 uint32_t minor; 94 u32 minor;
106 95
107 /* Last context to touch part of hw */ 96 /* Last context to touch part of hw */
108 uint32_t ctx_owners[DRM_PSB_SAREA_OWNERS]; 97 u32 ctx_owners[DRM_PSB_SAREA_OWNERS];
109 98
110 /* Definition of front- and rotated buffers */ 99 /* Definition of front- and rotated buffers */
111 uint32_t num_scanouts; 100 u32 num_scanouts;
112 struct drm_psb_scanout scanouts[DRM_PSB_SAREA_SCANOUTS]; 101 struct drm_psb_scanout scanouts[DRM_PSB_SAREA_SCANOUTS];
113 102
114 int planeA_x; 103 int planeA_x;
@@ -120,7 +109,7 @@ struct drm_psb_sarea {
120 int planeB_w; 109 int planeB_w;
121 int planeB_h; 110 int planeB_h;
122 /* Number of active scanouts */ 111 /* Number of active scanouts */
123 uint32_t num_active_scanouts; 112 u32 num_active_scanouts;
124}; 113};
125 114
126#define PSB_RELOC_MAGIC 0x67676767 115#define PSB_RELOC_MAGIC 0x67676767
@@ -134,16 +123,16 @@ struct drm_psb_sarea {
134 */ 123 */
135 124
136struct drm_psb_reloc { 125struct drm_psb_reloc {
137 uint32_t reloc_op; 126 u32 reloc_op;
138 uint32_t where; /* offset in destination buffer */ 127 u32 where; /* offset in destination buffer */
139 uint32_t buffer; /* Buffer reloc applies to */ 128 u32 buffer; /* Buffer reloc applies to */
140 uint32_t mask; /* Destination format: */ 129 u32 mask; /* Destination format: */
141 uint32_t shift; /* Destination format: */ 130 u32 shift; /* Destination format: */
142 uint32_t pre_add; /* Destination format: */ 131 u32 pre_add; /* Destination format: */
143 uint32_t background; /* Destination add */ 132 u32 background; /* Destination add */
144 uint32_t dst_buffer; /* Destination buffer. Index into buffer_list */ 133 u32 dst_buffer; /* Destination buffer. Index into buffer_list */
145 uint32_t arg0; /* Reloc-op dependant */ 134 u32 arg0; /* Reloc-op dependant */
146 uint32_t arg1; 135 u32 arg1;
147}; 136};
148 137
149 138
@@ -174,12 +163,12 @@ struct drm_psb_reloc {
174#define PSB_FEEDBACK_OP_VISTEST (1 << 0) 163#define PSB_FEEDBACK_OP_VISTEST (1 << 0)
175 164
176struct drm_psb_extension_rep { 165struct drm_psb_extension_rep {
177 int32_t exists; 166 s32 exists;
178 uint32_t driver_ioctl_offset; 167 u32 driver_ioctl_offset;
179 uint32_t sarea_offset; 168 u32 sarea_offset;
180 uint32_t major; 169 u32 major;
181 uint32_t minor; 170 u32 minor;
182 uint32_t pl; 171 u32 pl;
183}; 172};
184 173
185#define DRM_PSB_EXT_NAME_LEN 128 174#define DRM_PSB_EXT_NAME_LEN 128
@@ -190,20 +179,20 @@ union drm_psb_extension_arg {
190}; 179};
191 180
192struct psb_validate_req { 181struct psb_validate_req {
193 uint64_t set_flags; 182 u64 set_flags;
194 uint64_t clear_flags; 183 u64 clear_flags;
195 uint64_t next; 184 u64 next;
196 uint64_t presumed_gpu_offset; 185 u64 presumed_gpu_offset;
197 uint32_t buffer_handle; 186 u32 buffer_handle;
198 uint32_t presumed_flags; 187 u32 presumed_flags;
199 uint32_t group; 188 u32 group;
200 uint32_t pad64; 189 u32 pad64;
201}; 190};
202 191
203struct psb_validate_rep { 192struct psb_validate_rep {
204 uint64_t gpu_offset; 193 u64 gpu_offset;
205 uint32_t placement; 194 u32 placement;
206 uint32_t fence_type_mask; 195 u32 fence_type_mask;
207}; 196};
208 197
209#define PSB_USE_PRESUMED (1 << 0) 198#define PSB_USE_PRESUMED (1 << 0)
@@ -221,102 +210,24 @@ struct psb_validate_arg {
221#define DRM_PSB_FENCE_NO_USER (1 << 0) 210#define DRM_PSB_FENCE_NO_USER (1 << 0)
222 211
223struct psb_ttm_fence_rep { 212struct psb_ttm_fence_rep {
224 uint32_t handle; 213 u32 handle;
225 uint32_t fence_class; 214 u32 fence_class;
226 uint32_t fence_type; 215 u32 fence_type;
227 uint32_t signaled_types; 216 u32 signaled_types;
228 uint32_t error; 217 u32 error;
229}; 218};
230 219
231typedef struct drm_psb_cmdbuf_arg {
232 uint64_t buffer_list; /* List of buffers to validate */
233 uint64_t clip_rects; /* See i915 counterpart */
234 uint64_t scene_arg;
235 uint64_t fence_arg;
236
237 uint32_t ta_flags;
238
239 uint32_t ta_handle; /* TA reg-value pairs */
240 uint32_t ta_offset;
241 uint32_t ta_size;
242
243 uint32_t oom_handle;
244 uint32_t oom_offset;
245 uint32_t oom_size;
246
247 uint32_t cmdbuf_handle; /* 2D Command buffer object or, */
248 uint32_t cmdbuf_offset; /* rasterizer reg-value pairs */
249 uint32_t cmdbuf_size;
250
251 uint32_t reloc_handle; /* Reloc buffer object */
252 uint32_t reloc_offset;
253 uint32_t num_relocs;
254
255 int32_t damage; /* Damage front buffer with cliprects */
256 /* Not implemented yet */
257 uint32_t fence_flags;
258 uint32_t engine;
259
260 /*
261 * Feedback;
262 */
263
264 uint32_t feedback_ops;
265 uint32_t feedback_handle;
266 uint32_t feedback_offset;
267 uint32_t feedback_breakpoints;
268 uint32_t feedback_size;
269} drm_psb_cmdbuf_arg_t;
270
271typedef struct drm_psb_pageflip_arg {
272 uint32_t flip_offset;
273 uint32_t stride;
274} drm_psb_pageflip_arg_t;
275
276typedef enum {
277 LNC_VIDEO_DEVICE_INFO,
278 LNC_VIDEO_GETPARAM_RAR_INFO,
279 LNC_VIDEO_GETPARAM_CI_INFO,
280 LNC_VIDEO_GETPARAM_RAR_HANDLER_OFFSET,
281 LNC_VIDEO_FRAME_SKIP,
282 IMG_VIDEO_DECODE_STATUS,
283 IMG_VIDEO_NEW_CONTEXT,
284 IMG_VIDEO_RM_CONTEXT,
285 IMG_VIDEO_MB_ERROR
286} lnc_getparam_key_t;
287
288struct drm_lnc_video_getparam_arg {
289 lnc_getparam_key_t key;
290 uint64_t arg; /* argument pointer */
291 uint64_t value; /* feed back pointer */
292};
293
294
295/* 220/*
296 * Feedback components: 221 * Feedback components:
297 */ 222 */
298 223
299/*
300 * Vistest component. The number of these in the feedback buffer
301 * equals the number of vistest breakpoints + 1.
302 * This is currently the only feedback component.
303 */
304
305struct drm_psb_vistest {
306 uint32_t vt[8];
307};
308
309struct drm_psb_sizes_arg { 224struct drm_psb_sizes_arg {
310 uint32_t ta_mem_size; 225 u32 ta_mem_size;
311 uint32_t mmu_size; 226 u32 mmu_size;
312 uint32_t pds_size; 227 u32 pds_size;
313 uint32_t rastgeom_size; 228 u32 rastgeom_size;
314 uint32_t tt_size; 229 u32 tt_size;
315 uint32_t vram_size; 230 u32 vram_size;
316};
317
318struct drm_psb_hist_status_arg {
319 uint32_t buf[32];
320}; 231};
321 232
322struct drm_psb_dpst_lut_arg { 233struct drm_psb_dpst_lut_arg {
@@ -324,194 +235,6 @@ struct drm_psb_dpst_lut_arg {
324 int output_id; 235 int output_id;
325}; 236};
326 237
327struct mrst_timing_info {
328 uint16_t pixel_clock;
329 uint8_t hactive_lo;
330 uint8_t hblank_lo;
331 uint8_t hblank_hi:4;
332 uint8_t hactive_hi:4;
333 uint8_t vactive_lo;
334 uint8_t vblank_lo;
335 uint8_t vblank_hi:4;
336 uint8_t vactive_hi:4;
337 uint8_t hsync_offset_lo;
338 uint8_t hsync_pulse_width_lo;
339 uint8_t vsync_pulse_width_lo:4;
340 uint8_t vsync_offset_lo:4;
341 uint8_t vsync_pulse_width_hi:2;
342 uint8_t vsync_offset_hi:2;
343 uint8_t hsync_pulse_width_hi:2;
344 uint8_t hsync_offset_hi:2;
345 uint8_t width_mm_lo;
346 uint8_t height_mm_lo;
347 uint8_t height_mm_hi:4;
348 uint8_t width_mm_hi:4;
349 uint8_t hborder;
350 uint8_t vborder;
351 uint8_t unknown0:1;
352 uint8_t hsync_positive:1;
353 uint8_t vsync_positive:1;
354 uint8_t separate_sync:2;
355 uint8_t stereo:1;
356 uint8_t unknown6:1;
357 uint8_t interlaced:1;
358} __attribute__((packed));
359
360struct gct_r10_timing_info {
361 uint16_t pixel_clock;
362 uint32_t hactive_lo:8;
363 uint32_t hactive_hi:4;
364 uint32_t hblank_lo:8;
365 uint32_t hblank_hi:4;
366 uint32_t hsync_offset_lo:8;
367 uint16_t hsync_offset_hi:2;
368 uint16_t hsync_pulse_width_lo:8;
369 uint16_t hsync_pulse_width_hi:2;
370 uint16_t hsync_positive:1;
371 uint16_t rsvd_1:3;
372 uint8_t vactive_lo:8;
373 uint16_t vactive_hi:4;
374 uint16_t vblank_lo:8;
375 uint16_t vblank_hi:4;
376 uint16_t vsync_offset_lo:4;
377 uint16_t vsync_offset_hi:2;
378 uint16_t vsync_pulse_width_lo:4;
379 uint16_t vsync_pulse_width_hi:2;
380 uint16_t vsync_positive:1;
381 uint16_t rsvd_2:3;
382} __attribute__((packed));
383
384struct mrst_panel_descriptor_v1{
385 uint32_t Panel_Port_Control; /* 1 dword, Register 0x61180 if LVDS */
386 /* 0x61190 if MIPI */
387 uint32_t Panel_Power_On_Sequencing;/*1 dword,Register 0x61208,*/
388 uint32_t Panel_Power_Off_Sequencing;/*1 dword,Register 0x6120C,*/
389 uint32_t Panel_Power_Cycle_Delay_and_Reference_Divisor;/* 1 dword */
390 /* Register 0x61210 */
391 struct mrst_timing_info DTD;/*18 bytes, Standard definition */
392 uint16_t Panel_Backlight_Inverter_Descriptor;/* 16 bits, as follows */
393 /* Bit 0, Frequency, 15 bits,0 - 32767Hz */
394 /* Bit 15, Polarity, 1 bit, 0: Normal, 1: Inverted */
395 uint16_t Panel_MIPI_Display_Descriptor;
396 /*16 bits, Defined as follows: */
397 /* if MIPI, 0x0000 if LVDS */
398 /* Bit 0, Type, 2 bits, */
399 /* 0: Type-1, */
400 /* 1: Type-2, */
401 /* 2: Type-3, */
402 /* 3: Type-4 */
403 /* Bit 2, Pixel Format, 4 bits */
404 /* Bit0: 16bpp (not supported in LNC), */
405 /* Bit1: 18bpp loosely packed, */
406 /* Bit2: 18bpp packed, */
407 /* Bit3: 24bpp */
408 /* Bit 6, Reserved, 2 bits, 00b */
409 /* Bit 8, Minimum Supported Frame Rate, 6 bits, 0 - 63Hz */
410 /* Bit 14, Reserved, 2 bits, 00b */
411} __attribute__ ((packed));
412
413struct mrst_panel_descriptor_v2{
414 uint32_t Panel_Port_Control; /* 1 dword, Register 0x61180 if LVDS */
415 /* 0x61190 if MIPI */
416 uint32_t Panel_Power_On_Sequencing;/*1 dword,Register 0x61208,*/
417 uint32_t Panel_Power_Off_Sequencing;/*1 dword,Register 0x6120C,*/
418 uint8_t Panel_Power_Cycle_Delay_and_Reference_Divisor;/* 1 byte */
419 /* Register 0x61210 */
420 struct mrst_timing_info DTD;/*18 bytes, Standard definition */
421 uint16_t Panel_Backlight_Inverter_Descriptor;/*16 bits, as follows*/
422 /*Bit 0, Frequency, 16 bits, 0 - 32767Hz*/
423 uint8_t Panel_Initial_Brightness;/* [7:0] 0 - 100% */
424 /*Bit 7, Polarity, 1 bit,0: Normal, 1: Inverted*/
425 uint16_t Panel_MIPI_Display_Descriptor;
426 /*16 bits, Defined as follows: */
427 /* if MIPI, 0x0000 if LVDS */
428 /* Bit 0, Type, 2 bits, */
429 /* 0: Type-1, */
430 /* 1: Type-2, */
431 /* 2: Type-3, */
432 /* 3: Type-4 */
433 /* Bit 2, Pixel Format, 4 bits */
434 /* Bit0: 16bpp (not supported in LNC), */
435 /* Bit1: 18bpp loosely packed, */
436 /* Bit2: 18bpp packed, */
437 /* Bit3: 24bpp */
438 /* Bit 6, Reserved, 2 bits, 00b */
439 /* Bit 8, Minimum Supported Frame Rate, 6 bits, 0 - 63Hz */
440 /* Bit 14, Reserved, 2 bits, 00b */
441} __attribute__ ((packed));
442
443union mrst_panel_rx{
444 struct{
445 uint16_t NumberOfLanes:2; /*Num of Lanes, 2 bits,0 = 1 lane,*/
446 /* 1 = 2 lanes, 2 = 3 lanes, 3 = 4 lanes. */
447 uint16_t MaxLaneFreq:3; /* 0: 100MHz, 1: 200MHz, 2: 300MHz, */
448 /*3: 400MHz, 4: 500MHz, 5: 600MHz, 6: 700MHz, 7: 800MHz.*/
449 uint16_t SupportedVideoTransferMode:2; /*0: Non-burst only */
450 /* 1: Burst and non-burst */
451 /* 2/3: Reserved */
452 uint16_t HSClkBehavior:1; /*0: Continuous, 1: Non-continuous*/
453 uint16_t DuoDisplaySupport:1; /*1 bit,0: No, 1: Yes*/
454 uint16_t ECC_ChecksumCapabilities:1;/*1 bit,0: No, 1: Yes*/
455 uint16_t BidirectionalCommunication:1;/*1 bit,0: No, 1: Yes */
456 uint16_t Rsvd:5;/*5 bits,00000b */
457 } panelrx;
458 uint16_t panel_receiver;
459} __attribute__ ((packed));
460
461struct gct_ioctl_arg{
462 uint8_t bpi; /* boot panel index, number of panel used during boot */
463 uint8_t pt; /* panel type, 4 bit field, 0=lvds, 1=mipi */
464 struct mrst_timing_info DTD; /* timing info for the selected panel */
465 uint32_t Panel_Port_Control;
466 uint32_t PP_On_Sequencing;/*1 dword,Register 0x61208,*/
467 uint32_t PP_Off_Sequencing;/*1 dword,Register 0x6120C,*/
468 uint32_t PP_Cycle_Delay;
469 uint16_t Panel_Backlight_Inverter_Descriptor;
470 uint16_t Panel_MIPI_Display_Descriptor;
471} __attribute__ ((packed));
472
473struct mrst_vbt{
474 char Signature[4]; /*4 bytes,"$GCT" */
475 uint8_t Revision; /*1 byte */
476 uint8_t Size; /*1 byte */
477 uint8_t Checksum; /*1 byte,Calculated*/
478 void *mrst_gct;
479} __attribute__ ((packed));
480
481struct mrst_gct_v1{ /* expect this table to change per customer request*/
482 union{ /*8 bits,Defined as follows: */
483 struct{
484 uint8_t PanelType:4; /*4 bits, Bit field for panels*/
485 /* 0 - 3: 0 = LVDS, 1 = MIPI*/
486 /*2 bits,Specifies which of the*/
487 uint8_t BootPanelIndex:2;
488 /* 4 panels to use by default*/
489 uint8_t BootMIPI_DSI_RxIndex:2;/*Specifies which of*/
490 /* the 4 MIPI DSI receivers to use*/
491 } PD;
492 uint8_t PanelDescriptor;
493 };
494 struct mrst_panel_descriptor_v1 panel[4];/*panel descrs,38 bytes each*/
495 union mrst_panel_rx panelrx[4]; /* panel receivers*/
496} __attribute__ ((packed));
497
498struct mrst_gct_v2{ /* expect this table to change per customer request*/
499 union{ /*8 bits,Defined as follows: */
500 struct{
501 uint8_t PanelType:4; /*4 bits, Bit field for panels*/
502 /* 0 - 3: 0 = LVDS, 1 = MIPI*/
503 /*2 bits,Specifies which of the*/
504 uint8_t BootPanelIndex:2;
505 /* 4 panels to use by default*/
506 uint8_t BootMIPI_DSI_RxIndex:2;/*Specifies which of*/
507 /* the 4 MIPI DSI receivers to use*/
508 } PD;
509 uint8_t PanelDescriptor;
510 };
511 struct mrst_panel_descriptor_v2 panel[4];/*panel descrs,38 bytes each*/
512 union mrst_panel_rx panelrx[4]; /* panel receivers*/
513} __attribute__ ((packed));
514
515#define PSB_DC_CRTC_SAVE 0x01 238#define PSB_DC_CRTC_SAVE 0x01
516#define PSB_DC_CRTC_RESTORE 0x02 239#define PSB_DC_CRTC_RESTORE 0x02
517#define PSB_DC_OUTPUT_SAVE 0x04 240#define PSB_DC_OUTPUT_SAVE 0x04
@@ -520,20 +243,20 @@ struct mrst_gct_v2{ /* expect this table to change per customer request*/
520#define PSB_DC_OUTPUT_MASK 0x0C 243#define PSB_DC_OUTPUT_MASK 0x0C
521 244
522struct drm_psb_dc_state_arg { 245struct drm_psb_dc_state_arg {
523 uint32_t flags; 246 u32 flags;
524 uint32_t obj_id; 247 u32 obj_id;
525}; 248};
526 249
527struct drm_psb_mode_operation_arg { 250struct drm_psb_mode_operation_arg {
528 uint32_t obj_id; 251 u32 obj_id;
529 uint16_t operation; 252 u16 operation;
530 struct drm_mode_modeinfo mode; 253 struct drm_mode_modeinfo mode;
531 void *data; 254 void *data;
532}; 255};
533 256
534struct drm_psb_stolen_memory_arg { 257struct drm_psb_stolen_memory_arg {
535 uint32_t base; 258 u32 base;
536 uint32_t size; 259 u32 size;
537}; 260};
538 261
539/*Display Register Bits*/ 262/*Display Register Bits*/
@@ -556,64 +279,64 @@ struct drm_psb_stolen_memory_arg {
556#define OVC_REGRWBITS_OGAM_ALL (1 << 3) 279#define OVC_REGRWBITS_OGAM_ALL (1 << 3)
557 280
558struct drm_psb_register_rw_arg { 281struct drm_psb_register_rw_arg {
559 uint32_t b_force_hw_on; 282 u32 b_force_hw_on;
560 283
561 uint32_t display_read_mask; 284 u32 display_read_mask;
562 uint32_t display_write_mask; 285 u32 display_write_mask;
563 286
564 struct { 287 struct {
565 uint32_t pfit_controls; 288 u32 pfit_controls;
566 uint32_t pfit_autoscale_ratios; 289 u32 pfit_autoscale_ratios;
567 uint32_t pfit_programmed_scale_ratios; 290 u32 pfit_programmed_scale_ratios;
568 uint32_t pipeasrc; 291 u32 pipeasrc;
569 uint32_t pipebsrc; 292 u32 pipebsrc;
570 uint32_t vtotal_a; 293 u32 vtotal_a;
571 uint32_t vtotal_b; 294 u32 vtotal_b;
572 } display; 295 } display;
573 296
574 uint32_t overlay_read_mask; 297 u32 overlay_read_mask;
575 uint32_t overlay_write_mask; 298 u32 overlay_write_mask;
576 299
577 struct { 300 struct {
578 uint32_t OVADD; 301 u32 OVADD;
579 uint32_t OGAMC0; 302 u32 OGAMC0;
580 uint32_t OGAMC1; 303 u32 OGAMC1;
581 uint32_t OGAMC2; 304 u32 OGAMC2;
582 uint32_t OGAMC3; 305 u32 OGAMC3;
583 uint32_t OGAMC4; 306 u32 OGAMC4;
584 uint32_t OGAMC5; 307 u32 OGAMC5;
585 uint32_t IEP_ENABLED; 308 u32 IEP_ENABLED;
586 uint32_t IEP_BLE_MINMAX; 309 u32 IEP_BLE_MINMAX;
587 uint32_t IEP_BSSCC_CONTROL; 310 u32 IEP_BSSCC_CONTROL;
588 uint32_t b_wait_vblank; 311 u32 b_wait_vblank;
589 } overlay; 312 } overlay;
590 313
591 uint32_t sprite_enable_mask; 314 u32 sprite_enable_mask;
592 uint32_t sprite_disable_mask; 315 u32 sprite_disable_mask;
593 316
594 struct { 317 struct {
595 uint32_t dspa_control; 318 u32 dspa_control;
596 uint32_t dspa_key_value; 319 u32 dspa_key_value;
597 uint32_t dspa_key_mask; 320 u32 dspa_key_mask;
598 uint32_t dspc_control; 321 u32 dspc_control;
599 uint32_t dspc_stride; 322 u32 dspc_stride;
600 uint32_t dspc_position; 323 u32 dspc_position;
601 uint32_t dspc_linear_offset; 324 u32 dspc_linear_offset;
602 uint32_t dspc_size; 325 u32 dspc_size;
603 uint32_t dspc_surface; 326 u32 dspc_surface;
604 } sprite; 327 } sprite;
605 328
606 uint32_t subpicture_enable_mask; 329 u32 subpicture_enable_mask;
607 uint32_t subpicture_disable_mask; 330 u32 subpicture_disable_mask;
608}; 331};
609 332
610struct psb_gtt_mapping_arg { 333struct psb_gtt_mapping_arg {
611 void *hKernelMemInfo; 334 void *hKernelMemInfo;
612 uint32_t offset_pages; 335 u32 offset_pages;
613}; 336};
614 337
615struct drm_psb_getpageaddrs_arg { 338struct drm_psb_getpageaddrs_arg {
616 uint32_t handle; 339 u32 handle;
617 unsigned long *page_addrs; 340 unsigned long *page_addrs;
618 unsigned long gtt_offset; 341 unsigned long gtt_offset;
619}; 342};
@@ -659,38 +382,16 @@ struct drm_psb_getpageaddrs_arg {
659#define DRM_PVR_RESERVED6 0x1E 382#define DRM_PVR_RESERVED6 0x1E
660 383
661#define DRM_PSB_GET_PIPE_FROM_CRTC_ID 0x1F 384#define DRM_PSB_GET_PIPE_FROM_CRTC_ID 0x1F
662#define DRM_PSB_DPU_QUERY 0x20
663#define DRM_PSB_DPU_DSR_ON 0x21
664#define DRM_PSB_DPU_DSR_OFF 0x22
665
666#define DRM_PSB_DSR_ENABLE 0xfffffffe
667#define DRM_PSB_DSR_DISABLE 0xffffffff
668
669struct psb_drm_dpu_rect {
670 int x, y;
671 int width, height;
672};
673
674struct drm_psb_drv_dsr_off_arg {
675 int screen;
676 struct psb_drm_dpu_rect damage_rect;
677};
678
679
680struct drm_psb_dev_info_arg {
681 uint32_t num_use_attribute_registers;
682};
683#define DRM_PSB_DEVINFO 0x01
684 385
685#define PSB_MODE_OPERATION_MODE_VALID 0x01 386#define PSB_MODE_OPERATION_MODE_VALID 0x01
686#define PSB_MODE_OPERATION_SET_DC_BASE 0x02 387#define PSB_MODE_OPERATION_SET_DC_BASE 0x02
687 388
688struct drm_psb_get_pipe_from_crtc_id_arg { 389struct drm_psb_get_pipe_from_crtc_id_arg {
689 /** ID of CRTC being requested **/ 390 /** ID of CRTC being requested **/
690 uint32_t crtc_id; 391 u32 crtc_id;
691 392
692 /** pipe of requested CRTC **/ 393 /** pipe of requested CRTC **/
693 uint32_t pipe; 394 u32 pipe;
694}; 395};
695 396
696#endif 397#endif
diff --git a/drivers/staging/gma500/psb_drv.c b/drivers/staging/gma500/psb_drv.c
index 2b410af91df..090d9a2e60b 100644
--- a/drivers/staging/gma500/psb_drv.c
+++ b/drivers/staging/gma500/psb_drv.c
@@ -33,14 +33,13 @@
33#include <linux/notifier.h> 33#include <linux/notifier.h>
34#include <linux/spinlock.h> 34#include <linux/spinlock.h>
35#include <linux/pm_runtime.h> 35#include <linux/pm_runtime.h>
36#include <acpi/video.h>
36 37
37int drm_psb_debug; 38int drm_psb_debug;
38static int drm_psb_trap_pagefaults; 39static int drm_psb_trap_pagefaults;
39 40
40int drm_psb_disable_vsync = 1; 41int drm_psb_disable_vsync = 1;
41int drm_psb_no_fb; 42int drm_psb_no_fb;
42int drm_psb_force_pipeb;
43int drm_idle_check_interval = 5;
44int gfxrtdelay = 2 * 1000; 43int gfxrtdelay = 2 * 1000;
45 44
46static int psb_probe(struct pci_dev *pdev, const struct pci_device_id *ent); 45static int psb_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
@@ -57,7 +56,6 @@ MODULE_PARM_DESC(hdmi_edid, "EDID info for HDMI monitor");
57module_param_named(debug, drm_psb_debug, int, 0600); 56module_param_named(debug, drm_psb_debug, int, 0600);
58module_param_named(no_fb, drm_psb_no_fb, int, 0600); 57module_param_named(no_fb, drm_psb_no_fb, int, 0600);
59module_param_named(trap_pagefaults, drm_psb_trap_pagefaults, int, 0600); 58module_param_named(trap_pagefaults, drm_psb_trap_pagefaults, int, 0600);
60module_param_named(force_pipeb, drm_psb_force_pipeb, int, 0600);
61module_param_named(rtpm, gfxrtdelay, int, 0600); 59module_param_named(rtpm, gfxrtdelay, int, 0600);
62 60
63 61
@@ -108,12 +106,6 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
108#define DRM_IOCTL_PSB_GETPAGEADDRS \ 106#define DRM_IOCTL_PSB_GETPAGEADDRS \
109 DRM_IOWR(DRM_COMMAND_BASE + DRM_PSB_GETPAGEADDRS,\ 107 DRM_IOWR(DRM_COMMAND_BASE + DRM_PSB_GETPAGEADDRS,\
110 struct drm_psb_getpageaddrs_arg) 108 struct drm_psb_getpageaddrs_arg)
111#define DRM_IOCTL_PSB_HIST_ENABLE \
112 DRM_IOWR(DRM_PSB_HIST_ENABLE + DRM_COMMAND_BASE, \
113 uint32_t)
114#define DRM_IOCTL_PSB_HIST_STATUS \
115 DRM_IOWR(DRM_PSB_HIST_STATUS + DRM_COMMAND_BASE, \
116 struct drm_psb_hist_status_arg)
117#define DRM_IOCTL_PSB_UPDATE_GUARD \ 109#define DRM_IOCTL_PSB_UPDATE_GUARD \
118 DRM_IOWR(DRM_PSB_UPDATE_GUARD + DRM_COMMAND_BASE, \ 110 DRM_IOWR(DRM_PSB_UPDATE_GUARD + DRM_COMMAND_BASE, \
119 uint32_t) 111 uint32_t)
@@ -133,15 +125,9 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
133/* 125/*
134 * TTM execbuf extension. 126 * TTM execbuf extension.
135 */ 127 */
136#define DRM_PSB_CMDBUF (DRM_PSB_DPU_DSR_OFF + 1) 128
137 129#define DRM_PSB_CMDBUF 0x23
138#define DRM_PSB_SCENE_UNREF (DRM_PSB_CMDBUF + 1) 130#define DRM_PSB_SCENE_UNREF 0x24
139#define DRM_IOCTL_PSB_CMDBUF \
140 DRM_IOW(DRM_PSB_CMDBUF + DRM_COMMAND_BASE, \
141 struct drm_psb_cmdbuf_arg)
142#define DRM_IOCTL_PSB_SCENE_UNREF \
143 DRM_IOW(DRM_PSB_SCENE_UNREF + DRM_COMMAND_BASE, \
144 struct drm_psb_scene)
145#define DRM_IOCTL_PSB_KMS_OFF DRM_IO(DRM_PSB_KMS_OFF + DRM_COMMAND_BASE) 131#define DRM_IOCTL_PSB_KMS_OFF DRM_IO(DRM_PSB_KMS_OFF + DRM_COMMAND_BASE)
146#define DRM_IOCTL_PSB_KMS_ON DRM_IO(DRM_PSB_KMS_ON + DRM_COMMAND_BASE) 132#define DRM_IOCTL_PSB_KMS_ON DRM_IO(DRM_PSB_KMS_ON + DRM_COMMAND_BASE)
147/* 133/*
@@ -168,8 +154,6 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
168#define DRM_PSB_TTM_FENCE_UNREF (TTM_FENCE_UNREF + DRM_PSB_FENCE_OFFSET) 154#define DRM_PSB_TTM_FENCE_UNREF (TTM_FENCE_UNREF + DRM_PSB_FENCE_OFFSET)
169 155
170#define DRM_PSB_FLIP (DRM_PSB_TTM_FENCE_UNREF + 1) /*20*/ 156#define DRM_PSB_FLIP (DRM_PSB_TTM_FENCE_UNREF + 1) /*20*/
171/* PSB video extension */
172#define DRM_LNC_VIDEO_GETPARAM (DRM_PSB_FLIP + 1)
173 157
174#define DRM_IOCTL_PSB_TTM_PL_CREATE \ 158#define DRM_IOCTL_PSB_TTM_PL_CREATE \
175 DRM_IOWR(DRM_COMMAND_BASE + DRM_PSB_TTM_PL_CREATE,\ 159 DRM_IOWR(DRM_COMMAND_BASE + DRM_PSB_TTM_PL_CREATE,\
@@ -201,12 +185,6 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
201#define DRM_IOCTL_PSB_TTM_FENCE_UNREF \ 185#define DRM_IOCTL_PSB_TTM_FENCE_UNREF \
202 DRM_IOW(DRM_COMMAND_BASE + DRM_PSB_TTM_FENCE_UNREF, \ 186 DRM_IOW(DRM_COMMAND_BASE + DRM_PSB_TTM_FENCE_UNREF, \
203 struct ttm_fence_unref_arg) 187 struct ttm_fence_unref_arg)
204#define DRM_IOCTL_PSB_FLIP \
205 DRM_IOWR(DRM_COMMAND_BASE + DRM_PSB_FLIP, \
206 struct drm_psb_pageflip_arg)
207#define DRM_IOCTL_LNC_VIDEO_GETPARAM \
208 DRM_IOWR(DRM_COMMAND_BASE + DRM_LNC_VIDEO_GETPARAM, \
209 struct drm_lnc_video_getparam_arg)
210 188
211static int psb_vt_leave_ioctl(struct drm_device *dev, void *data, 189static int psb_vt_leave_ioctl(struct drm_device *dev, void *data,
212 struct drm_file *file_priv); 190 struct drm_file *file_priv);
@@ -268,9 +246,6 @@ static struct drm_ioctl_desc psb_ioctls[] = {
268 PSB_IOCTL_DEF(DRM_IOCTL_PSB_DPST_BL, psb_dpst_bl_ioctl, DRM_AUTH), 246 PSB_IOCTL_DEF(DRM_IOCTL_PSB_DPST_BL, psb_dpst_bl_ioctl, DRM_AUTH),
269 PSB_IOCTL_DEF(DRM_IOCTL_PSB_GET_PIPE_FROM_CRTC_ID, 247 PSB_IOCTL_DEF(DRM_IOCTL_PSB_GET_PIPE_FROM_CRTC_ID,
270 psb_intel_get_pipe_from_crtc_id, 0), 248 psb_intel_get_pipe_from_crtc_id, 0),
271 /*to be removed later*/
272 /*PSB_IOCTL_DEF(DRM_IOCTL_PSB_SCENE_UNREF, drm_psb_scene_unref_ioctl,
273 DRM_AUTH),*/
274 249
275 PSB_IOCTL_DEF(DRM_IOCTL_PSB_TTM_PL_CREATE, psb_pl_create_ioctl, 250 PSB_IOCTL_DEF(DRM_IOCTL_PSB_TTM_PL_CREATE, psb_pl_create_ioctl,
276 DRM_AUTH), 251 DRM_AUTH),
@@ -392,15 +367,6 @@ static void psb_get_core_freq(struct drm_device *dev)
392#define FB_SKU_100 0 367#define FB_SKU_100 0
393#define FB_SKU_100L 1 368#define FB_SKU_100L 1
394#define FB_SKU_83 2 369#define FB_SKU_83 2
395#if 1 /* FIXME remove it after PO */
396#define FB_GFX_CLK_DIVIDE_MASK (BIT20|BIT21|BIT22)
397#define FB_GFX_CLK_DIVIDE_SHIFT 20
398#define FB_VED_CLK_DIVIDE_MASK (BIT23|BIT24)
399#define FB_VED_CLK_DIVIDE_SHIFT 23
400#define FB_VEC_CLK_DIVIDE_MASK (BIT25|BIT26)
401#define FB_VEC_CLK_DIVIDE_SHIFT 25
402#endif /* FIXME remove it after PO */
403
404 370
405bool mid_get_pci_revID(struct drm_psb_private *dev_priv) 371bool mid_get_pci_revID(struct drm_psb_private *dev_priv)
406{ 372{
@@ -596,7 +562,7 @@ static int psb_driver_unload(struct drm_device *dev)
596 dev->dev_private = NULL; 562 dev->dev_private = NULL;
597 563
598 /*destory VBT data*/ 564 /*destory VBT data*/
599 psb_intel_destory_bios(dev); 565 psb_intel_destroy_bios(dev);
600 } 566 }
601 567
602 ospm_power_uninit(); 568 ospm_power_uninit();
@@ -615,10 +581,6 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset)
615 int ret = -ENOMEM; 581 int ret = -ENOMEM;
616 uint32_t tt_pages; 582 uint32_t tt_pages;
617 583
618 DRM_INFO("psb - %s\n", PSB_PACKAGE_VERSION);
619
620 DRM_INFO("Run drivers on Poulsbo platform!\n");
621
622 dev_priv = kzalloc(sizeof(*dev_priv), GFP_KERNEL); 584 dev_priv = kzalloc(sizeof(*dev_priv), GFP_KERNEL);
623 if (dev_priv == NULL) 585 if (dev_priv == NULL)
624 return -ENOMEM; 586 return -ENOMEM;
@@ -774,11 +736,8 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset)
774 if (ret) 736 if (ret)
775 return ret; 737 return ret;
776 738
777 /** 739/* igd_opregion_init(&dev_priv->opregion_dev); */
778 * Init lid switch timer. 740 acpi_video_register();
779 * NOTE: must do this after psb_intel_opregion_init
780 * and psb_backlight_init
781 */
782 if (dev_priv->lid_state) 741 if (dev_priv->lid_state)
783 psb_lid_timer_init(dev_priv); 742 psb_lid_timer_init(dev_priv);
784 743
diff --git a/drivers/staging/gma500/psb_drv.h b/drivers/staging/gma500/psb_drv.h
index f7c976299ad..29a36056d66 100644
--- a/drivers/staging/gma500/psb_drv.h
+++ b/drivers/staging/gma500/psb_drv.h
@@ -368,7 +368,6 @@ struct drm_psb_private {
368 368
369 unsigned long chipset; 369 unsigned long chipset;
370 370
371 struct drm_psb_dev_info_arg dev_info;
372 struct drm_psb_uopt uopt; 371 struct drm_psb_uopt uopt;
373 372
374 struct psb_gtt *pg; 373 struct psb_gtt *pg;
diff --git a/drivers/staging/gma500/psb_intel_bios.c b/drivers/staging/gma500/psb_intel_bios.c
index 83d8e9359f2..f5bcd119b87 100644
--- a/drivers/staging/gma500/psb_intel_bios.c
+++ b/drivers/staging/gma500/psb_intel_bios.c
@@ -273,7 +273,7 @@ bool psb_intel_init_bios(struct drm_device *dev)
273/** 273/**
274 * Destory and free VBT data 274 * Destory and free VBT data
275 */ 275 */
276void psb_intel_destory_bios(struct drm_device *dev) 276void psb_intel_destroy_bios(struct drm_device *dev)
277{ 277{
278 struct drm_psb_private *dev_priv = dev->dev_private; 278 struct drm_psb_private *dev_priv = dev->dev_private;
279 struct drm_display_mode *sdvo_lvds_vbt_mode = 279 struct drm_display_mode *sdvo_lvds_vbt_mode =
diff --git a/drivers/staging/gma500/psb_intel_bios.h b/drivers/staging/gma500/psb_intel_bios.h
index ad30a684252..70f1bf01818 100644
--- a/drivers/staging/gma500/psb_intel_bios.h
+++ b/drivers/staging/gma500/psb_intel_bios.h
@@ -304,7 +304,7 @@ struct bdb_sdvo_lvds_options {
304 304
305 305
306extern bool psb_intel_init_bios(struct drm_device *dev); 306extern bool psb_intel_init_bios(struct drm_device *dev);
307extern void psb_intel_destory_bios(struct drm_device *dev); 307extern void psb_intel_destroy_bios(struct drm_device *dev);
308 308
309/* 309/*
310 * Driver<->VBIOS interaction occurs through scratch bits in 310 * Driver<->VBIOS interaction occurs through scratch bits in
diff --git a/drivers/staging/gma500/psb_intel_reg.h b/drivers/staging/gma500/psb_intel_reg.h
index 0c323c026f8..1c283140bcc 100644
--- a/drivers/staging/gma500/psb_intel_reg.h
+++ b/drivers/staging/gma500/psb_intel_reg.h
@@ -22,7 +22,7 @@
22#define BLC_PWM_CTL_C 0x62254 22#define BLC_PWM_CTL_C 0x62254
23#define BLC_PWM_CTL2_C 0x62250 23#define BLC_PWM_CTL2_C 0x62250
24#define BACKLIGHT_MODULATION_FREQ_SHIFT (17) 24#define BACKLIGHT_MODULATION_FREQ_SHIFT (17)
25/** 25/*
26 * This is the most significant 15 bits of the number of backlight cycles in a 26 * This is the most significant 15 bits of the number of backlight cycles in a
27 * complete cycle of the modulated backlight control. 27 * complete cycle of the modulated backlight control.
28 * 28 *
@@ -30,7 +30,7 @@
30 */ 30 */
31#define BACKLIGHT_MODULATION_FREQ_MASK (0x7fff << 17) 31#define BACKLIGHT_MODULATION_FREQ_MASK (0x7fff << 17)
32#define BLM_LEGACY_MODE (1 << 16) 32#define BLM_LEGACY_MODE (1 << 16)
33/** 33/*
34 * This is the number of cycles out of the backlight modulation cycle for which 34 * This is the number of cycles out of the backlight modulation cycle for which
35 * the backlight is on. 35 * the backlight is on.
36 * 36 *
@@ -86,7 +86,7 @@
86 86
87#define PP_STATUS 0x61200 87#define PP_STATUS 0x61200
88# define PP_ON (1 << 31) 88# define PP_ON (1 << 31)
89/** 89/*
90 * Indicates that all dependencies of the panel are on: 90 * Indicates that all dependencies of the panel are on:
91 * 91 *
92 * - PLL enabled 92 * - PLL enabled
@@ -143,12 +143,12 @@
143# define DPLLB_LVDS_P2_CLOCK_DIV_7 (1 << 24) /* i915 */ 143# define DPLLB_LVDS_P2_CLOCK_DIV_7 (1 << 24) /* i915 */
144# define DPLL_P2_CLOCK_DIV_MASK 0x03000000 /* i915 */ 144# define DPLL_P2_CLOCK_DIV_MASK 0x03000000 /* i915 */
145# define DPLL_FPA01_P1_POST_DIV_MASK 0x00ff0000 /* i915 */ 145# define DPLL_FPA01_P1_POST_DIV_MASK 0x00ff0000 /* i915 */
146/** 146/*
147 * The i830 generation, in DAC/serial mode, defines p1 as two plus this 147 * The i830 generation, in DAC/serial mode, defines p1 as two plus this
148 * bitfield, or just 2 if PLL_P1_DIVIDE_BY_TWO is set. 148 * bitfield, or just 2 if PLL_P1_DIVIDE_BY_TWO is set.
149 */ 149 */
150# define DPLL_FPA01_P1_POST_DIV_MASK_I830 0x001f0000 150# define DPLL_FPA01_P1_POST_DIV_MASK_I830 0x001f0000
151/** 151/*
152 * The i830 generation, in LVDS mode, defines P1 as the bit number set within 152 * The i830 generation, in LVDS mode, defines P1 as the bit number set within
153 * this field (only one bit may be set). 153 * this field (only one bit may be set).
154 */ 154 */
@@ -173,33 +173,33 @@
173# define PLL_LOAD_PULSE_PHASE_MASK (0xf << PLL_LOAD_PULSE_PHASE_SHIFT) 173# define PLL_LOAD_PULSE_PHASE_MASK (0xf << PLL_LOAD_PULSE_PHASE_SHIFT)
174# define DISPLAY_RATE_SELECT_FPA1 (1 << 8) 174# define DISPLAY_RATE_SELECT_FPA1 (1 << 8)
175 175
176/** 176/*
177 * SDVO multiplier for 945G/GM. Not used on 965. 177 * SDVO multiplier for 945G/GM. Not used on 965.
178 * 178 *
179 * \sa DPLL_MD_UDI_MULTIPLIER_MASK 179 * DPLL_MD_UDI_MULTIPLIER_MASK
180 */ 180 */
181# define SDVO_MULTIPLIER_MASK 0x000000ff 181# define SDVO_MULTIPLIER_MASK 0x000000ff
182# define SDVO_MULTIPLIER_SHIFT_HIRES 4 182# define SDVO_MULTIPLIER_SHIFT_HIRES 4
183# define SDVO_MULTIPLIER_SHIFT_VGA 0 183# define SDVO_MULTIPLIER_SHIFT_VGA 0
184 184
185/** @defgroup DPLL_MD 185/*
186 * @{ 186 * PLL_MD
187 */ 187 */
188/** Pipe A SDVO/UDI clock multiplier/divider register for G965. */ 188/* Pipe A SDVO/UDI clock multiplier/divider register for G965. */
189#define DPLL_A_MD 0x0601c 189#define DPLL_A_MD 0x0601c
190/** Pipe B SDVO/UDI clock multiplier/divider register for G965. */ 190/* Pipe B SDVO/UDI clock multiplier/divider register for G965. */
191#define DPLL_B_MD 0x06020 191#define DPLL_B_MD 0x06020
192/** 192/*
193 * UDI pixel divider, controlling how many pixels are stuffed into a packet. 193 * UDI pixel divider, controlling how many pixels are stuffed into a packet.
194 * 194 *
195 * Value is pixels minus 1. Must be set to 1 pixel for SDVO. 195 * Value is pixels minus 1. Must be set to 1 pixel for SDVO.
196 */ 196 */
197# define DPLL_MD_UDI_DIVIDER_MASK 0x3f000000 197# define DPLL_MD_UDI_DIVIDER_MASK 0x3f000000
198# define DPLL_MD_UDI_DIVIDER_SHIFT 24 198# define DPLL_MD_UDI_DIVIDER_SHIFT 24
199/** UDI pixel divider for VGA, same as DPLL_MD_UDI_DIVIDER_MASK. */ 199/* UDI pixel divider for VGA, same as DPLL_MD_UDI_DIVIDER_MASK. */
200# define DPLL_MD_VGA_UDI_DIVIDER_MASK 0x003f0000 200# define DPLL_MD_VGA_UDI_DIVIDER_MASK 0x003f0000
201# define DPLL_MD_VGA_UDI_DIVIDER_SHIFT 16 201# define DPLL_MD_VGA_UDI_DIVIDER_SHIFT 16
202/** 202/*
203 * SDVO/UDI pixel multiplier. 203 * SDVO/UDI pixel multiplier.
204 * 204 *
205 * SDVO requires that the bus clock rate be between 1 and 2 Ghz, and the bus 205 * SDVO requires that the bus clock rate be between 1 and 2 Ghz, and the bus
@@ -218,13 +218,13 @@
218 */ 218 */
219# define DPLL_MD_UDI_MULTIPLIER_MASK 0x00003f00 219# define DPLL_MD_UDI_MULTIPLIER_MASK 0x00003f00
220# define DPLL_MD_UDI_MULTIPLIER_SHIFT 8 220# define DPLL_MD_UDI_MULTIPLIER_SHIFT 8
221/** SDVO/UDI pixel multiplier for VGA, same as DPLL_MD_UDI_MULTIPLIER_MASK. 221/*
222 * SDVO/UDI pixel multiplier for VGA, same as DPLL_MD_UDI_MULTIPLIER_MASK.
222 * This best be set to the default value (3) or the CRT won't work. No, 223 * This best be set to the default value (3) or the CRT won't work. No,
223 * I don't entirely understand what this does... 224 * I don't entirely understand what this does...
224 */ 225 */
225# define DPLL_MD_VGA_UDI_MULTIPLIER_MASK 0x0000003f 226# define DPLL_MD_VGA_UDI_MULTIPLIER_MASK 0x0000003f
226# define DPLL_MD_VGA_UDI_MULTIPLIER_SHIFT 0 227# define DPLL_MD_VGA_UDI_MULTIPLIER_SHIFT 0
227/** @} */
228 228
229#define DPLL_TEST 0x606c 229#define DPLL_TEST 0x606c
230# define DPLLB_TEST_SDVO_DIV_1 (0 << 22) 230# define DPLLB_TEST_SDVO_DIV_1 (0 << 22)
@@ -295,7 +295,7 @@
295 * 295 *
296 * Programmed value is multiplier - 1, up to 5x. 296 * Programmed value is multiplier - 1, up to 5x.
297 * 297 *
298 * \sa DPLL_MD_UDI_MULTIPLIER_MASK 298 * DPLL_MD_UDI_MULTIPLIER_MASK
299 */ 299 */
300#define SDVO_PORT_MULTIPLY_MASK (7 << 23) 300#define SDVO_PORT_MULTIPLY_MASK (7 << 23)
301#define SDVO_PORT_MULTIPLY_SHIFT 23 301#define SDVO_PORT_MULTIPLY_SHIFT 23
@@ -310,35 +310,32 @@
310#define SDVOB_PRESERVE_MASK ((1 << 17) | (1 << 16) | (1 << 14)) 310#define SDVOB_PRESERVE_MASK ((1 << 17) | (1 << 16) | (1 << 14))
311#define SDVOC_PRESERVE_MASK (1 << 17) 311#define SDVOC_PRESERVE_MASK (1 << 17)
312 312
313/** @defgroup LVDS 313/*
314 * @{
315 */
316/**
317 * This register controls the LVDS output enable, pipe selection, and data 314 * This register controls the LVDS output enable, pipe selection, and data
318 * format selection. 315 * format selection.
319 * 316 *
320 * All of the clock/data pairs are force powered down by power sequencing. 317 * All of the clock/data pairs are force powered down by power sequencing.
321 */ 318 */
322#define LVDS 0x61180 319#define LVDS 0x61180
323/** 320/*
324 * Enables the LVDS port. This bit must be set before DPLLs are enabled, as 321 * Enables the LVDS port. This bit must be set before DPLLs are enabled, as
325 * the DPLL semantics change when the LVDS is assigned to that pipe. 322 * the DPLL semantics change when the LVDS is assigned to that pipe.
326 */ 323 */
327# define LVDS_PORT_EN (1 << 31) 324# define LVDS_PORT_EN (1 << 31)
328/** Selects pipe B for LVDS data. Must be set on pre-965. */ 325/* Selects pipe B for LVDS data. Must be set on pre-965. */
329# define LVDS_PIPEB_SELECT (1 << 30) 326# define LVDS_PIPEB_SELECT (1 << 30)
330 327
331/** Turns on border drawing to allow centered display. */ 328/* Turns on border drawing to allow centered display. */
332# define LVDS_BORDER_EN (1 << 15) 329# define LVDS_BORDER_EN (1 << 15)
333 330
334/** 331/*
335 * Enables the A0-A2 data pairs and CLKA, containing 18 bits of color data per 332 * Enables the A0-A2 data pairs and CLKA, containing 18 bits of color data per
336 * pixel. 333 * pixel.
337 */ 334 */
338# define LVDS_A0A2_CLKA_POWER_MASK (3 << 8) 335# define LVDS_A0A2_CLKA_POWER_MASK (3 << 8)
339# define LVDS_A0A2_CLKA_POWER_DOWN (0 << 8) 336# define LVDS_A0A2_CLKA_POWER_DOWN (0 << 8)
340# define LVDS_A0A2_CLKA_POWER_UP (3 << 8) 337# define LVDS_A0A2_CLKA_POWER_UP (3 << 8)
341/** 338/*
342 * Controls the A3 data pair, which contains the additional LSBs for 24 bit 339 * Controls the A3 data pair, which contains the additional LSBs for 24 bit
343 * mode. Only enabled if LVDS_A0A2_CLKA_POWER_UP also indicates it should be 340 * mode. Only enabled if LVDS_A0A2_CLKA_POWER_UP also indicates it should be
344 * on. 341 * on.
@@ -346,15 +343,14 @@
346# define LVDS_A3_POWER_MASK (3 << 6) 343# define LVDS_A3_POWER_MASK (3 << 6)
347# define LVDS_A3_POWER_DOWN (0 << 6) 344# define LVDS_A3_POWER_DOWN (0 << 6)
348# define LVDS_A3_POWER_UP (3 << 6) 345# define LVDS_A3_POWER_UP (3 << 6)
349/** 346/*
350 * Controls the CLKB pair. This should only be set when LVDS_B0B3_POWER_UP 347 * Controls the CLKB pair. This should only be set when LVDS_B0B3_POWER_UP
351 * is set. 348 * is set.
352 */ 349 */
353# define LVDS_CLKB_POWER_MASK (3 << 4) 350# define LVDS_CLKB_POWER_MASK (3 << 4)
354# define LVDS_CLKB_POWER_DOWN (0 << 4) 351# define LVDS_CLKB_POWER_DOWN (0 << 4)
355# define LVDS_CLKB_POWER_UP (3 << 4) 352# define LVDS_CLKB_POWER_UP (3 << 4)
356 353/*
357/**
358 * Controls the B0-B3 data pairs. This must be set to match the DPLL p2 354 * Controls the B0-B3 data pairs. This must be set to match the DPLL p2
359 * setting for whether we are in dual-channel mode. The B3 pair will 355 * setting for whether we are in dual-channel mode. The B3 pair will
360 * additionally only be powered up when LVDS_A3_POWER_UP is set. 356 * additionally only be powered up when LVDS_A3_POWER_UP is set.
@@ -419,8 +415,8 @@
419#define PIPE_HDMI_AUDIO_UNDERRUN (1UL<<26) 415#define PIPE_HDMI_AUDIO_UNDERRUN (1UL<<26)
420#define PIPE_HDMI_AUDIO_BUFFER_DONE (1UL<<27) 416#define PIPE_HDMI_AUDIO_BUFFER_DONE (1UL<<27)
421#define PIPE_HDMI_AUDIO_INT_MASK (PIPE_HDMI_AUDIO_UNDERRUN | PIPE_HDMI_AUDIO_BUFFER_DONE) 417#define PIPE_HDMI_AUDIO_INT_MASK (PIPE_HDMI_AUDIO_UNDERRUN | PIPE_HDMI_AUDIO_BUFFER_DONE)
422#define PIPE_EVENT_MASK (BIT29|BIT28|BIT27|BIT26|BIT24|BIT23|BIT22|BIT21|BIT20|BIT16) 418#define PIPE_EVENT_MASK ((1 << 29)|(1 << 28)|(1 << 27)|(1 << 26)|(1 << 24)|(1 << 23)|(1 << 22)|(1 << 21)|(1 << 20)|(1 << 16))
423#define PIPE_VBLANK_MASK (BIT25|BIT24|BIT18|BIT17) 419#define PIPE_VBLANK_MASK ((1 << 25)|(1 << 24)|(1 << 18)|(1 << 17))
424#define HISTOGRAM_INT_CONTROL 0x61268 420#define HISTOGRAM_INT_CONTROL 0x61268
425#define HISTOGRAM_BIN_DATA 0X61264 421#define HISTOGRAM_BIN_DATA 0X61264
426#define HISTOGRAM_LOGIC_CONTROL 0x61260 422#define HISTOGRAM_LOGIC_CONTROL 0x61260
@@ -567,7 +563,7 @@ struct dpst_guardband {
567#define OV_C_OFFSET 0x08000 563#define OV_C_OFFSET 0x08000
568#define OV_OVADD 0x30000 564#define OV_OVADD 0x30000
569#define OV_DOVASTA 0x30008 565#define OV_DOVASTA 0x30008
570# define OV_PIPE_SELECT (BIT6|BIT7) 566# define OV_PIPE_SELECT ((1 << 6)|(1 << 7))
571# define OV_PIPE_SELECT_POS 6 567# define OV_PIPE_SELECT_POS 6
572# define OV_PIPE_A 0 568# define OV_PIPE_A 0
573# define OV_PIPE_C 1 569# define OV_PIPE_C 1
@@ -629,40 +625,6 @@ struct dpst_guardband {
629#define PALETTE_B 0x0a800 625#define PALETTE_B 0x0a800
630#define PALETTE_C 0x0ac00 626#define PALETTE_C 0x0ac00
631 627
632#define IS_I830(dev) ((dev)->pci_device == PCI_DEVICE_ID_INTEL_82830_CGC)
633#define IS_845G(dev) ((dev)->pci_device == PCI_DEVICE_ID_INTEL_82845G_IG)
634#define IS_I85X(dev) ((dev)->pci_device == PCI_DEVICE_ID_INTEL_82855GM_IG)
635#define IS_I855(dev) ((dev)->pci_device == PCI_DEVICE_ID_INTEL_82855GM_IG)
636#define IS_I865G(dev) ((dev)->pci_device == PCI_DEVICE_ID_INTEL_82865_IG)
637
638
639/* || dev->pci_device == PCI_DEVICE_ID_INTELPCI_CHIP_E7221_G) */
640#define IS_I915G(dev) (dev->pci_device == PCI_DEVICE_ID_INTEL_82915G_IG)
641#define IS_I915GM(dev) ((dev)->pci_device == PCI_DEVICE_ID_INTEL_82915GM_IG)
642#define IS_I945G(dev) ((dev)->pci_device == PCI_DEVICE_ID_INTEL_82945G_IG)
643#define IS_I945GM(dev) ((dev)->pci_device == PCI_DEVICE_ID_INTEL_82945GM_IG)
644
645#define IS_I965G(dev) ((dev)->pci_device == 0x2972 || \
646 (dev)->pci_device == 0x2982 || \
647 (dev)->pci_device == 0x2992 || \
648 (dev)->pci_device == 0x29A2 || \
649 (dev)->pci_device == 0x2A02 || \
650 (dev)->pci_device == 0x2A12)
651
652#define IS_I965GM(dev) ((dev)->pci_device == 0x2A02)
653
654#define IS_G33(dev) ((dev)->pci_device == 0x29C2 || \
655 (dev)->pci_device == 0x29B2 || \
656 (dev)->pci_device == 0x29D2)
657
658#define IS_I9XX(dev) (IS_I915G(dev) || IS_I915GM(dev) || IS_I945G(dev) || \
659 IS_I945GM(dev) || IS_I965G(dev) || IS_POULSBO(dev) || \
660 IS_MRST(dev))
661
662#define IS_MOBILE(dev) (IS_I830(dev) || IS_I85X(dev) || IS_I915GM(dev) || \
663 IS_I945GM(dev) || IS_I965GM(dev) || \
664 IS_POULSBO(dev) || IS_MRST(dev))
665
666/* Cursor A & B regs */ 628/* Cursor A & B regs */
667#define CURACNTR 0x70080 629#define CURACNTR 0x70080
668#define CURSOR_MODE_DISABLE 0x00 630#define CURSOR_MODE_DISABLE 0x00
@@ -707,7 +669,9 @@ struct dpst_guardband {
707#define MDFLD_DPLL_DIV1 0x0f04c 669#define MDFLD_DPLL_DIV1 0x0f04c
708#define MRST_PERF_MODE 0x020f4 670#define MRST_PERF_MODE 0x020f4
709 671
710/* MEDFIELD HDMI registers */ 672/*
673 * MEDFIELD HDMI registers
674 */
711#define HDMIPHYMISCCTL 0x61134 675#define HDMIPHYMISCCTL 0x61134
712# define HDMI_PHY_POWER_DOWN 0x7f 676# define HDMI_PHY_POWER_DOWN 0x7f
713#define HDMIB_CONTROL 0x61140 677#define HDMIB_CONTROL 0x61140
@@ -724,7 +688,7 @@ struct dpst_guardband {
724#define MIPI 0x61190 688#define MIPI 0x61190
725#define MIPI_C 0x62190 689#define MIPI_C 0x62190
726# define MIPI_PORT_EN (1 << 31) 690# define MIPI_PORT_EN (1 << 31)
727/** Turns on border drawing to allow centered display. */ 691/* Turns on border drawing to allow centered display. */
728# define SEL_FLOPPED_HSTX (1 << 23) 692# define SEL_FLOPPED_HSTX (1 << 23)
729# define PASS_FROM_SPHY_TO_AFE (1 << 16) 693# define PASS_FROM_SPHY_TO_AFE (1 << 16)
730# define MIPI_BORDER_EN (1 << 15) 694# define MIPI_BORDER_EN (1 << 15)
@@ -756,47 +720,13 @@ struct dpst_guardband {
756/* 720/*
757 * Moorestown registers. 721 * Moorestown registers.
758 */ 722 */
759/*=========================================================================== 723
760; General Constants 724/*
761;--------------------------------------------------------------------------*/ 725 * MIPI IP registers
762#define BIT0 0x00000001 726 */
763#define BIT1 0x00000002
764#define BIT2 0x00000004
765#define BIT3 0x00000008
766#define BIT4 0x00000010
767#define BIT5 0x00000020
768#define BIT6 0x00000040
769#define BIT7 0x00000080
770#define BIT8 0x00000100
771#define BIT9 0x00000200
772#define BIT10 0x00000400
773#define BIT11 0x00000800
774#define BIT12 0x00001000
775#define BIT13 0x00002000
776#define BIT14 0x00004000
777#define BIT15 0x00008000
778#define BIT16 0x00010000
779#define BIT17 0x00020000
780#define BIT18 0x00040000
781#define BIT19 0x00080000
782#define BIT20 0x00100000
783#define BIT21 0x00200000
784#define BIT22 0x00400000
785#define BIT23 0x00800000
786#define BIT24 0x01000000
787#define BIT25 0x02000000
788#define BIT26 0x04000000
789#define BIT27 0x08000000
790#define BIT28 0x10000000
791#define BIT29 0x20000000
792#define BIT30 0x40000000
793#define BIT31 0x80000000
794/*===========================================================================
795; MIPI IP registers
796;--------------------------------------------------------------------------*/
797#define MIPIC_REG_OFFSET 0x800 727#define MIPIC_REG_OFFSET 0x800
798#define DEVICE_READY_REG 0xb000 728#define DEVICE_READY_REG 0xb000
799#define LP_OUTPUT_HOLD BIT16 729#define LP_OUTPUT_HOLD (1 << 16)
800#define EXIT_ULPS_DEV_READY 0x3 730#define EXIT_ULPS_DEV_READY 0x3
801#define LP_OUTPUT_HOLD_RELEASE 0x810000 731#define LP_OUTPUT_HOLD_RELEASE 0x810000
802# define ENTERING_ULPS (2 << 1) 732# define ENTERING_ULPS (2 << 1)
@@ -804,33 +734,33 @@ struct dpst_guardband {
804# define ULPS_MASK (3 << 1) 734# define ULPS_MASK (3 << 1)
805# define BUS_POSSESSION (1 << 3) 735# define BUS_POSSESSION (1 << 3)
806#define INTR_STAT_REG 0xb004 736#define INTR_STAT_REG 0xb004
807#define RX_SOT_ERROR BIT0 737#define RX_SOT_ERROR (1 << 0)
808#define RX_SOT_SYNC_ERROR BIT1 738#define RX_SOT_SYNC_ERROR (1 << 1)
809#define RX_ESCAPE_MODE_ENTRY_ERROR BIT3 739#define RX_ESCAPE_MODE_ENTRY_ERROR (1 << 3)
810#define RX_LP_TX_SYNC_ERROR BIT4 740#define RX_LP_TX_SYNC_ERROR (1 << 4)
811#define RX_HS_RECEIVE_TIMEOUT_ERROR BIT5 741#define RX_HS_RECEIVE_TIMEOUT_ERROR (1 << 5)
812#define RX_FALSE_CONTROL_ERROR BIT6 742#define RX_FALSE_CONTROL_ERROR (1 << 6)
813#define RX_ECC_SINGLE_BIT_ERROR BIT7 743#define RX_ECC_SINGLE_BIT_ERROR (1 << 7)
814#define RX_ECC_MULTI_BIT_ERROR BIT8 744#define RX_ECC_MULTI_BIT_ERROR (1 << 8)
815#define RX_CHECKSUM_ERROR BIT9 745#define RX_CHECKSUM_ERROR (1 << 9)
816#define RX_DSI_DATA_TYPE_NOT_RECOGNIZED BIT10 746#define RX_DSI_DATA_TYPE_NOT_RECOGNIZED (1 << 10)
817#define RX_DSI_VC_ID_INVALID BIT11 747#define RX_DSI_VC_ID_INVALID (1 << 11)
818#define TX_FALSE_CONTROL_ERROR BIT12 748#define TX_FALSE_CONTROL_ERROR (1 << 12)
819#define TX_ECC_SINGLE_BIT_ERROR BIT13 749#define TX_ECC_SINGLE_BIT_ERROR (1 << 13)
820#define TX_ECC_MULTI_BIT_ERROR BIT14 750#define TX_ECC_MULTI_BIT_ERROR (1 << 14)
821#define TX_CHECKSUM_ERROR BIT15 751#define TX_CHECKSUM_ERROR (1 << 15)
822#define TX_DSI_DATA_TYPE_NOT_RECOGNIZED BIT16 752#define TX_DSI_DATA_TYPE_NOT_RECOGNIZED (1 << 16)
823#define TX_DSI_VC_ID_INVALID BIT17 753#define TX_DSI_VC_ID_INVALID (1 << 17)
824#define HIGH_CONTENTION BIT18 754#define HIGH_CONTENTION (1 << 18)
825#define LOW_CONTENTION BIT19 755#define LOW_CONTENTION (1 << 19)
826#define DPI_FIFO_UNDER_RUN BIT20 756#define DPI_FIFO_UNDER_RUN (1 << 20)
827#define HS_TX_TIMEOUT BIT21 757#define HS_TX_TIMEOUT (1 << 21)
828#define LP_RX_TIMEOUT BIT22 758#define LP_RX_TIMEOUT (1 << 22)
829#define TURN_AROUND_ACK_TIMEOUT BIT23 759#define TURN_AROUND_ACK_TIMEOUT (1 << 23)
830#define ACK_WITH_NO_ERROR BIT24 760#define ACK_WITH_NO_ERROR (1 << 24)
831#define HS_GENERIC_WR_FIFO_FULL BIT27 761#define HS_GENERIC_WR_FIFO_FULL (1 << 27)
832#define LP_GENERIC_WR_FIFO_FULL BIT28 762#define LP_GENERIC_WR_FIFO_FULL (1 << 28)
833#define SPL_PKT_SENT BIT30 763#define SPL_PKT_SENT (1 << 30)
834#define INTR_EN_REG 0xb008 764#define INTR_EN_REG 0xb008
835#define DSI_FUNC_PRG_REG 0xb00c 765#define DSI_FUNC_PRG_REG 0xb00c
836#define DPI_CHANNEL_NUMBER_POS 0x03 766#define DPI_CHANNEL_NUMBER_POS 0x03
@@ -873,22 +803,22 @@ struct dpst_guardband {
873#define VERT_FRONT_PORCH_COUNT_REG 0xb040 803#define VERT_FRONT_PORCH_COUNT_REG 0xb040
874#define HIGH_LOW_SWITCH_COUNT_REG 0xb044 804#define HIGH_LOW_SWITCH_COUNT_REG 0xb044
875#define DPI_CONTROL_REG 0xb048 805#define DPI_CONTROL_REG 0xb048
876#define DPI_SHUT_DOWN BIT0 806#define DPI_SHUT_DOWN (1 << 0)
877#define DPI_TURN_ON BIT1 807#define DPI_TURN_ON (1 << 1)
878#define DPI_COLOR_MODE_ON BIT2 808#define DPI_COLOR_MODE_ON (1 << 2)
879#define DPI_COLOR_MODE_OFF BIT3 809#define DPI_COLOR_MODE_OFF (1 << 3)
880#define DPI_BACK_LIGHT_ON BIT4 810#define DPI_BACK_LIGHT_ON (1 << 4)
881#define DPI_BACK_LIGHT_OFF BIT5 811#define DPI_BACK_LIGHT_OFF (1 << 5)
882#define DPI_LP BIT6 812#define DPI_LP (1 << 6)
883#define DPI_DATA_REG 0xb04c 813#define DPI_DATA_REG 0xb04c
884#define DPI_BACK_LIGHT_ON_DATA 0x07 814#define DPI_BACK_LIGHT_ON_DATA 0x07
885#define DPI_BACK_LIGHT_OFF_DATA 0x17 815#define DPI_BACK_LIGHT_OFF_DATA 0x17
886#define INIT_COUNT_REG 0xb050 816#define INIT_COUNT_REG 0xb050
887#define MAX_RET_PAK_REG 0xb054 817#define MAX_RET_PAK_REG 0xb054
888#define VIDEO_FMT_REG 0xb058 818#define VIDEO_FMT_REG 0xb058
889#define COMPLETE_LAST_PCKT BIT2 819#define COMPLETE_LAST_PCKT (1 << 2)
890#define EOT_DISABLE_REG 0xb05c 820#define EOT_DISABLE_REG 0xb05c
891#define ENABLE_CLOCK_STOPPING BIT1 821#define ENABLE_CLOCK_STOPPING (1 << 1)
892#define LP_BYTECLK_REG 0xb060 822#define LP_BYTECLK_REG 0xb060
893#define LP_GEN_DATA_REG 0xb064 823#define LP_GEN_DATA_REG 0xb064
894#define HS_GEN_DATA_REG 0xb068 824#define HS_GEN_DATA_REG 0xb068
@@ -899,30 +829,31 @@ struct dpst_guardband {
899#define WORD_COUNTS_POS 0x8 829#define WORD_COUNTS_POS 0x8
900#define MCS_PARAMETER_POS 0x10 830#define MCS_PARAMETER_POS 0x10
901#define GEN_FIFO_STAT_REG 0xb074 831#define GEN_FIFO_STAT_REG 0xb074
902#define HS_DATA_FIFO_FULL BIT0 832#define HS_DATA_FIFO_FULL (1 << 0)
903#define HS_DATA_FIFO_HALF_EMPTY BIT1 833#define HS_DATA_FIFO_HALF_EMPTY (1 << 1)
904#define HS_DATA_FIFO_EMPTY BIT2 834#define HS_DATA_FIFO_EMPTY (1 << 2)
905#define LP_DATA_FIFO_FULL BIT8 835#define LP_DATA_FIFO_FULL (1 << 8)
906#define LP_DATA_FIFO_HALF_EMPTY BIT9 836#define LP_DATA_FIFO_HALF_EMPTY (1 << 9)
907#define LP_DATA_FIFO_EMPTY BIT10 837#define LP_DATA_FIFO_EMPTY (1 << 10)
908#define HS_CTRL_FIFO_FULL BIT16 838#define HS_CTRL_FIFO_FULL (1 << 16)
909#define HS_CTRL_FIFO_HALF_EMPTY BIT17 839#define HS_CTRL_FIFO_HALF_EMPTY (1 << 17)
910#define HS_CTRL_FIFO_EMPTY BIT18 840#define HS_CTRL_FIFO_EMPTY (1 << 18)
911#define LP_CTRL_FIFO_FULL BIT24 841#define LP_CTRL_FIFO_FULL (1 << 24)
912#define LP_CTRL_FIFO_HALF_EMPTY BIT25 842#define LP_CTRL_FIFO_HALF_EMPTY (1 << 25)
913#define LP_CTRL_FIFO_EMPTY BIT26 843#define LP_CTRL_FIFO_EMPTY (1 << 26)
914#define DBI_FIFO_EMPTY BIT27 844#define DBI_FIFO_EMPTY (1 << 27)
915#define DPI_FIFO_EMPTY BIT28 845#define DPI_FIFO_EMPTY (1 << 28)
916#define HS_LS_DBI_ENABLE_REG 0xb078 846#define HS_LS_DBI_ENABLE_REG 0xb078
917#define TXCLKESC_REG 0xb07c 847#define TXCLKESC_REG 0xb07c
918#define DPHY_PARAM_REG 0xb080 848#define DPHY_PARAM_REG 0xb080
919#define DBI_BW_CTRL_REG 0xb084 849#define DBI_BW_CTRL_REG 0xb084
920#define CLK_LANE_SWT_REG 0xb088 850#define CLK_LANE_SWT_REG 0xb088
921/*=========================================================================== 851
922; MIPI Adapter registers 852/*
923;--------------------------------------------------------------------------*/ 853 * MIPI Adapter registers
854 */
924#define MIPI_CONTROL_REG 0xb104 855#define MIPI_CONTROL_REG 0xb104
925#define MIPI_2X_CLOCK_BITS (BIT0 | BIT1) 856#define MIPI_2X_CLOCK_BITS ((1 << 0) | (1 << 1))
926#define MIPI_DATA_ADDRESS_REG 0xb108 857#define MIPI_DATA_ADDRESS_REG 0xb108
927#define MIPI_DATA_LENGTH_REG 0xb10C 858#define MIPI_DATA_LENGTH_REG 0xb10C
928#define MIPI_COMMAND_ADDRESS_REG 0xb110 859#define MIPI_COMMAND_ADDRESS_REG 0xb110
@@ -938,75 +869,76 @@ struct dpst_guardband {
938#define MIPI_READ_DATA_VALID_REG 0xb138 869#define MIPI_READ_DATA_VALID_REG 0xb138
939/* DBI COMMANDS */ 870/* DBI COMMANDS */
940#define soft_reset 0x01 871#define soft_reset 0x01
941/* ************************************************************************* *\ 872/*
942The display module performs a software reset. 873 * The display module performs a software reset.
943Registers are written with their SW Reset default values. 874 * Registers are written with their SW Reset default values.
944\* ************************************************************************* */ 875 */
945#define get_power_mode 0x0a 876#define get_power_mode 0x0a
946/* ************************************************************************* *\ 877/*
947The display module returns the current power mode 878 * The display module returns the current power mode
948\* ************************************************************************* */ 879 */
949#define get_address_mode 0x0b 880#define get_address_mode 0x0b
950/* ************************************************************************* *\ 881/*
951The display module returns the current status. 882 * The display module returns the current status.
952\* ************************************************************************* */ 883 */
953#define get_pixel_format 0x0c 884#define get_pixel_format 0x0c
954/* ************************************************************************* *\ 885/*
955This command gets the pixel format for the RGB image data 886 * This command gets the pixel format for the RGB image data
956used by the interface. 887 * used by the interface.
957\* ************************************************************************* */ 888 */
958#define get_display_mode 0x0d 889#define get_display_mode 0x0d
959/* ************************************************************************* *\ 890/*
960The display module returns the Display Image Mode status. 891 * The display module returns the Display Image Mode status.
961\* ************************************************************************* */ 892 */
962#define get_signal_mode 0x0e 893#define get_signal_mode 0x0e
963/* ************************************************************************* *\ 894/*
964The display module returns the Display Signal Mode. 895 * The display module returns the Display Signal Mode.
965\* ************************************************************************* */ 896 */
966#define get_diagnostic_result 0x0f 897#define get_diagnostic_result 0x0f
967/* ************************************************************************* *\ 898/*
968The display module returns the self-diagnostic results following 899 * The display module returns the self-diagnostic results following
969a Sleep Out command. 900 * a Sleep Out command.
970\* ************************************************************************* */ 901 */
971#define enter_sleep_mode 0x10 902#define enter_sleep_mode 0x10
972/* ************************************************************************* *\ 903/*
973This command causes the display module to enter the Sleep mode. 904 * This command causes the display module to enter the Sleep mode.
974In this mode, all unnecessary blocks inside the display module are disabled 905 * In this mode, all unnecessary blocks inside the display module are
975except interface communication. This is the lowest power mode 906 * disabled except interface communication. This is the lowest power
976the display module supports. 907 * mode the display module supports.
977\* ************************************************************************* */ 908 */
978#define exit_sleep_mode 0x11 909#define exit_sleep_mode 0x11
979/* ************************************************************************* *\ 910/*
980This command causes the display module to exit Sleep mode. 911 * This command causes the display module to exit Sleep mode.
981All blocks inside the display module are enabled. 912 * All blocks inside the display module are enabled.
982\* ************************************************************************* */ 913 */
983#define enter_partial_mode 0x12 914#define enter_partial_mode 0x12
984/* ************************************************************************* *\ 915/*
985This command causes the display module to enter the Partial Display Mode. 916 * This command causes the display module to enter the Partial Display
986The Partial Display Mode window is described by the set_partial_area command. 917 * Mode. The Partial Display Mode window is described by the
987\* ************************************************************************* */ 918 * set_partial_area command.
919 */
988#define enter_normal_mode 0x13 920#define enter_normal_mode 0x13
989/* ************************************************************************* *\ 921/*
990This command causes the display module to enter the Normal mode. 922 * This command causes the display module to enter the Normal mode.
991Normal Mode is defined as Partial Display mode and Scroll mode are off 923 * Normal Mode is defined as Partial Display mode and Scroll mode are off
992\* ************************************************************************* */ 924 */
993#define exit_invert_mode 0x20 925#define exit_invert_mode 0x20
994/* ************************************************************************* *\ 926/*
995This command causes the display module to stop inverting the image data on 927 * This command causes the display module to stop inverting the image
996the display device. The frame memory contents remain unchanged. 928 * data on the display device. The frame memory contents remain unchanged.
997No status bits are changed. 929 * No status bits are changed.
998\* ************************************************************************* */ 930 */
999#define enter_invert_mode 0x21 931#define enter_invert_mode 0x21
1000/* ************************************************************************* *\ 932/*
1001This command causes the display module to invert the image data only on 933 * This command causes the display module to invert the image data only on
1002the display device. The frame memory contents remain unchanged. 934 * the display device. The frame memory contents remain unchanged.
1003No status bits are changed. 935 * No status bits are changed.
1004\* ************************************************************************* */ 936 */
1005#define set_gamma_curve 0x26 937#define set_gamma_curve 0x26
1006/* ************************************************************************* *\ 938/*
1007This command selects the desired gamma curve for the display device. 939 * This command selects the desired gamma curve for the display device.
1008Four fixed gamma curves are defined in section DCS spec. 940 * Four fixed gamma curves are defined in section DCS spec.
1009\* ************************************************************************* */ 941 */
1010#define set_display_off 0x28 942#define set_display_off 0x28
1011/* ************************************************************************* *\ 943/* ************************************************************************* *\
1012This command causes the display module to stop displaying the image data 944This command causes the display module to stop displaying the image data
@@ -1020,77 +952,80 @@ on the display device. The frame memory contents remain unchanged.
1020No status bits are changed. 952No status bits are changed.
1021\* ************************************************************************* */ 953\* ************************************************************************* */
1022#define set_column_address 0x2a 954#define set_column_address 0x2a
1023/* ************************************************************************* *\ 955/*
1024This command defines the column extent of the frame memory accessed by the 956 * This command defines the column extent of the frame memory accessed by
1025hostprocessor with the read_memory_continue and write_memory_continue commands. 957 * the hostprocessor with the read_memory_continue and
1026No status bits are changed. 958 * write_memory_continue commands.
1027\* ************************************************************************* */ 959 * No status bits are changed.
960 */
1028#define set_page_addr 0x2b 961#define set_page_addr 0x2b
1029/* ************************************************************************* *\ 962/*
1030This command defines the page extent of the frame memory accessed by the host 963 * This command defines the page extent of the frame memory accessed by
1031processor with the write_memory_continue and read_memory_continue command. 964 * the host processor with the write_memory_continue and
1032No status bits are changed. 965 * read_memory_continue command.
1033\* ************************************************************************* */ 966 * No status bits are changed.
967 */
1034#define write_mem_start 0x2c 968#define write_mem_start 0x2c
1035/* ************************************************************************* *\ 969/*
1036This command transfers image data from the host processor to the display 970 * This command transfers image data from the host processor to the
1037module s frame memory starting at the pixel location specified by 971 * display module s frame memory starting at the pixel location specified
1038preceding set_column_address and set_page_address commands. 972 * by preceding set_column_address and set_page_address commands.
1039\* ************************************************************************* */ 973 */
1040#define set_partial_area 0x30 974#define set_partial_area 0x30
1041/* ************************************************************************* *\ 975/*
1042This command defines the Partial Display mode s display area. 976 * This command defines the Partial Display mode s display area.
1043There are two parameters associated with 977 * There are two parameters associated with this command, the first
1044this command, the first defines the Start Row (SR) and the second the End Row 978 * defines the Start Row (SR) and the second the End Row (ER). SR and ER
1045(ER). SR and ER refer to the Frame Memory Line Pointer. 979 * refer to the Frame Memory Line Pointer.
1046\* ************************************************************************* */ 980 */
1047#define set_scroll_area 0x33 981#define set_scroll_area 0x33
1048/* ************************************************************************* *\ 982/*
1049This command defines the display modules Vertical Scrolling Area. 983 * This command defines the display modules Vertical Scrolling Area.
1050\* ************************************************************************* */ 984 */
1051#define set_tear_off 0x34 985#define set_tear_off 0x34
1052/* ************************************************************************* *\ 986/*
1053This command turns off the display modules Tearing Effect output signal on 987 * This command turns off the display modules Tearing Effect output
1054the TE signal line. 988 * signal on the TE signal line.
1055\* ************************************************************************* */ 989 */
1056#define set_tear_on 0x35 990#define set_tear_on 0x35
1057/* ************************************************************************* *\ 991/*
1058This command turns on the display modules Tearing Effect output signal 992 * This command turns on the display modules Tearing Effect output signal
1059on the TE signal line. 993 * on the TE signal line.
1060\* ************************************************************************* */ 994 */
1061#define set_address_mode 0x36 995#define set_address_mode 0x36
1062/* ************************************************************************* *\ 996/*
1063This command sets the data order for transfers from the host processor to 997 * This command sets the data order for transfers from the host processor
1064display modules frame memory,bits B[7:5] and B3, and from the display 998 * to display modules frame memory,bits B[7:5] and B3, and from the
1065modules frame memory to the display device, bits B[2:0] and B4. 999 * display modules frame memory to the display device, bits B[2:0] and B4.
1066\* ************************************************************************* */ 1000 */
1067#define set_scroll_start 0x37 1001#define set_scroll_start 0x37
1068/* ************************************************************************* *\ 1002/*
1069This command sets the start of the vertical scrolling area in the frame memory. 1003 * This command sets the start of the vertical scrolling area in the frame
1070The vertical scrolling area is fully defined when this command is used with 1004 * memory. The vertical scrolling area is fully defined when this command
1071the set_scroll_area command The set_scroll_start command has one parameter, 1005 * is used with the set_scroll_area command The set_scroll_start command
1072the Vertical Scroll Pointer. The VSP defines the line in the frame memory 1006 * has one parameter, the Vertical Scroll Pointer. The VSP defines the
1073that is written to the display device as the first line of the vertical 1007 * line in the frame memory that is written to the display device as the
1074scroll area. 1008 * first line of the vertical scroll area.
1075\* ************************************************************************* */ 1009 */
1076#define exit_idle_mode 0x38 1010#define exit_idle_mode 0x38
1077/* ************************************************************************* *\ 1011/*
1078This command causes the display module to exit Idle mode. 1012 * This command causes the display module to exit Idle mode.
1079\* ************************************************************************* */ 1013 */
1080#define enter_idle_mode 0x39 1014#define enter_idle_mode 0x39
1081/* ************************************************************************* *\ 1015/*
1082This command causes the display module to enter Idle Mode. 1016 * This command causes the display module to enter Idle Mode.
1083In Idle Mode, color expression is reduced. Colors are shown on the display 1017 * In Idle Mode, color expression is reduced. Colors are shown on the
1084device using the MSB of each of the R, G and B color components in the frame 1018 * display device using the MSB of each of the R, G and B color
1085memory 1019 * components in the frame memory
1086\* ************************************************************************* */ 1020 */
1087#define set_pixel_format 0x3a 1021#define set_pixel_format 0x3a
1088/* ************************************************************************* *\ 1022/*
1089This command sets the pixel format for the RGB image data used by the interface. 1023 * This command sets the pixel format for the RGB image data used by the
1090Bits D[6:4] DPI Pixel Format Definition 1024 * interface.
1091Bits D[2:0] DBI Pixel Format Definition 1025 * Bits D[6:4] DPI Pixel Format Definition
1092Bits D7 and D3 are not used. 1026 * Bits D[2:0] DBI Pixel Format Definition
1093\* ************************************************************************* */ 1027 * Bits D7 and D3 are not used.
1028 */
1094 #define DCS_PIXEL_FORMAT_3bbp 0x1 1029 #define DCS_PIXEL_FORMAT_3bbp 0x1
1095 #define DCS_PIXEL_FORMAT_8bbp 0x2 1030 #define DCS_PIXEL_FORMAT_8bbp 0x2
1096 #define DCS_PIXEL_FORMAT_12bbp 0x3 1031 #define DCS_PIXEL_FORMAT_12bbp 0x3
@@ -1098,24 +1033,25 @@ Bits D7 and D3 are not used.
1098 #define DCS_PIXEL_FORMAT_18bbp 0x6 1033 #define DCS_PIXEL_FORMAT_18bbp 0x6
1099 #define DCS_PIXEL_FORMAT_24bbp 0x7 1034 #define DCS_PIXEL_FORMAT_24bbp 0x7
1100#define write_mem_cont 0x3c 1035#define write_mem_cont 0x3c
1101/* ************************************************************************* *\ 1036/*
1102This command transfers image data from the host processor to the display 1037 * This command transfers image data from the host processor to the
1103module's frame memory continuing from the pixel location following the 1038 * display module's frame memory continuing from the pixel location
1104previous write_memory_continue or write_memory_start command. 1039 * following the previous write_memory_continue or write_memory_start
1105\* ************************************************************************* */ 1040 * command.
1041 */
1106#define set_tear_scanline 0x44 1042#define set_tear_scanline 0x44
1107/* ************************************************************************* *\ 1043/*
1108This command turns on the display modules Tearing Effect output signal on the 1044 * This command turns on the display modules Tearing Effect output signal
1109TE signal line when the display module reaches line N. 1045 * on the TE signal line when the display module reaches line N.
1110\* ************************************************************************* */ 1046 */
1111#define get_scanline 0x45 1047#define get_scanline 0x45
1112/* ************************************************************************* *\ 1048/*
1113The display module returns the current scanline, N, used to update the 1049 * The display module returns the current scanline, N, used to update the
1114display device. The total number of scanlines on a display device is 1050 * display device. The total number of scanlines on a display device is
1115defined as VSYNC + VBP + VACT + VFP.The first scanline is defined as 1051 * defined as VSYNC + VBP + VACT + VFP.The first scanline is defined as
1116the first line of V Sync and is denoted as Line 0. 1052 * the first line of V Sync and is denoted as Line 0.
1117When in Sleep Mode, the value returned by get_scanline is undefined. 1053 * When in Sleep Mode, the value returned by get_scanline is undefined.
1118\* ************************************************************************* */ 1054 */
1119 1055
1120/* MCS or Generic COMMANDS */ 1056/* MCS or Generic COMMANDS */
1121/* MCS/generic data type */ 1057/* MCS/generic data type */
@@ -1131,7 +1067,7 @@ When in Sleep Mode, the value returned by get_scanline is undefined.
1131#define MCS_READ 0x06 /* MCS read, no parameters */ 1067#define MCS_READ 0x06 /* MCS read, no parameters */
1132#define MCS_LONG_WRITE 0x39 /* MCS long write */ 1068#define MCS_LONG_WRITE 0x39 /* MCS long write */
1133/* MCS/generic commands */ 1069/* MCS/generic commands */
1134/*****TPO MCS**********/ 1070/* TPO MCS */
1135#define write_display_profile 0x50 1071#define write_display_profile 0x50
1136#define write_display_brightness 0x51 1072#define write_display_brightness 0x51
1137#define write_ctrl_display 0x53 1073#define write_ctrl_display 0x53
@@ -1143,19 +1079,19 @@ When in Sleep Mode, the value returned by get_scanline is undefined.
1143#define write_gamma_setting 0x58 1079#define write_gamma_setting 0x58
1144#define write_cabc_min_bright 0x5e 1080#define write_cabc_min_bright 0x5e
1145#define write_kbbc_profile 0x60 1081#define write_kbbc_profile 0x60
1146/*****TMD MCS**************/ 1082/* TMD MCS */
1147#define tmd_write_display_brightness 0x8c 1083#define tmd_write_display_brightness 0x8c
1148 1084
1149/* ************************************************************************* *\ 1085/*
1150This command is used to control ambient light, panel backlight brightness and 1086 * This command is used to control ambient light, panel backlight
1151gamma settings. 1087 * brightness and gamma settings.
1152\* ************************************************************************* */ 1088 */
1153#define BRIGHT_CNTL_BLOCK_ON BIT5 1089#define BRIGHT_CNTL_BLOCK_ON (1 << 5)
1154#define AMBIENT_LIGHT_SENSE_ON BIT4 1090#define AMBIENT_LIGHT_SENSE_ON (1 << 4)
1155#define DISPLAY_DIMMING_ON BIT3 1091#define DISPLAY_DIMMING_ON (1 << 3)
1156#define BACKLIGHT_ON BIT2 1092#define BACKLIGHT_ON (1 << 2)
1157#define DISPLAY_BRIGHTNESS_AUTO BIT1 1093#define DISPLAY_BRIGHTNESS_AUTO (1 << 1)
1158#define GAMMA_AUTO BIT0 1094#define GAMMA_AUTO (1 << 0)
1159 1095
1160/* DCS Interface Pixel Formats */ 1096/* DCS Interface Pixel Formats */
1161#define DCS_PIXEL_FORMAT_3BPP 0x1 1097#define DCS_PIXEL_FORMAT_3BPP 0x1
@@ -1190,8 +1126,9 @@ gamma settings.
1190 * byte alignment 1126 * byte alignment
1191 */ 1127 */
1192#define DBI_CB_TIME_OUT 0xFFFF 1128#define DBI_CB_TIME_OUT 0xFFFF
1193#define GEN_FB_TIME_OUT 2000 1129
1194#define ALIGNMENT_32BYTE_MASK (~(BIT0|BIT1|BIT2|BIT3|BIT4)) 1130#define GEN_FB_TIME_OUT 2000
1131#define ALIGNMENT_32BYTE_MASK (~((1 << 0)|(1 << 1)|(1 << 2)|(1 << 3)|(1 << 4)))
1195#define SKU_83 0x01 1132#define SKU_83 0x01
1196#define SKU_100 0x02 1133#define SKU_100 0x02
1197#define SKU_100L 0x04 1134#define SKU_100L 0x04
diff --git a/drivers/staging/gma500/psb_irq.c b/drivers/staging/gma500/psb_irq.c
index ce7dbf4e555..4597c882472 100644
--- a/drivers/staging/gma500/psb_irq.c
+++ b/drivers/staging/gma500/psb_irq.c
@@ -422,9 +422,9 @@ void psb_irq_turn_on_dpst(struct drm_device *dev)
422 422
423 if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, 423 if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND,
424 OSPM_UHB_ONLY_IF_ON)) { 424 OSPM_UHB_ONLY_IF_ON)) {
425 PSB_WVDC32(BIT31, HISTOGRAM_LOGIC_CONTROL); 425 PSB_WVDC32(1 << 31, HISTOGRAM_LOGIC_CONTROL);
426 hist_reg = PSB_RVDC32(HISTOGRAM_LOGIC_CONTROL); 426 hist_reg = PSB_RVDC32(HISTOGRAM_LOGIC_CONTROL);
427 PSB_WVDC32(BIT31, HISTOGRAM_INT_CONTROL); 427 PSB_WVDC32(1 << 31, HISTOGRAM_INT_CONTROL);
428 hist_reg = PSB_RVDC32(HISTOGRAM_INT_CONTROL); 428 hist_reg = PSB_RVDC32(HISTOGRAM_INT_CONTROL);
429 429
430 PSB_WVDC32(0x80010100, PWM_CONTROL_LOGIC); 430 PSB_WVDC32(0x80010100, PWM_CONTROL_LOGIC);
diff --git a/drivers/staging/gma500/psb_powermgmt.c b/drivers/staging/gma500/psb_powermgmt.c
index 39fa66a5f5d..7deb1ba8254 100644
--- a/drivers/staging/gma500/psb_powermgmt.c
+++ b/drivers/staging/gma500/psb_powermgmt.c
@@ -287,11 +287,6 @@ static void ospm_suspend_pci(struct pci_dev *pdev)
287 printk(KERN_ALERT "ospm_suspend_pci\n"); 287 printk(KERN_ALERT "ospm_suspend_pci\n");
288#endif 288#endif
289 289
290#ifdef CONFIG_MDFD_GL3
291 // Power off GL3 after all GFX sub-systems are powered off.
292 ospm_power_island_down(OSPM_GL3_CACHE_ISLAND);
293#endif
294
295 pci_save_state(pdev); 290 pci_save_state(pdev);
296 pci_read_config_dword(pdev, 0x5C, &bsm); 291 pci_read_config_dword(pdev, 0x5C, &bsm);
297 dev_priv->saveBSM = bsm; 292 dev_priv->saveBSM = bsm;