1 /* i915_drv.c -- i830,i845,i855,i865,i915 driver -*- linux-c -*-
5 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the
10 * "Software"), to deal in the Software without restriction, including
11 * without limitation the rights to use, copy, modify, merge, publish,
12 * distribute, sub license, and/or sell copies of the Software, and to
13 * permit persons to whom the Software is furnished to do so, subject to
14 * the following conditions:
16 * The above copyright notice and this permission notice (including the
17 * next paragraph) shall be included in all copies or substantial portions
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
23 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
24 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35 #include "drm_pciids.h"
37 static struct pci_device_id pciidlist[] = {
41 #ifdef I915_HAVE_FENCE
42 extern struct drm_fence_driver i915_fence_driver;
45 #ifdef I915_HAVE_BUFFER
47 static uint32_t i915_mem_prios[] = {DRM_BO_MEM_PRIV0, DRM_BO_MEM_TT, DRM_BO_MEM_LOCAL};
48 static uint32_t i915_busy_prios[] = {DRM_BO_MEM_TT, DRM_BO_MEM_PRIV0, DRM_BO_MEM_LOCAL};
50 static struct drm_bo_driver i915_bo_driver = {
51 .mem_type_prio = i915_mem_prios,
52 .mem_busy_prio = i915_busy_prios,
53 .num_mem_type_prio = sizeof(i915_mem_prios)/sizeof(uint32_t),
54 .num_mem_busy_prio = sizeof(i915_busy_prios)/sizeof(uint32_t),
55 .create_ttm_backend_entry = i915_create_ttm_backend_entry,
56 .fence_type = i915_fence_type,
57 .invalidate_caches = i915_invalidate_caches,
58 .init_mem_type = i915_init_mem_type,
59 .evict_flags = i915_evict_flags,
61 .ttm_cache_flush = i915_flush_ttm,
62 .command_stream_barrier = NULL,
71 static bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe)
73 struct drm_i915_private *dev_priv = dev->dev_private;
76 return (I915_READ(DPLL_A) & DPLL_VCO_ENABLE);
78 return (I915_READ(DPLL_B) & DPLL_VCO_ENABLE);
81 static void i915_save_palette(struct drm_device *dev, enum pipe pipe)
83 struct drm_i915_private *dev_priv = dev->dev_private;
84 unsigned long reg = (pipe == PIPE_A ? PALETTE_A : PALETTE_B);
88 if (!i915_pipe_enabled(dev, pipe))
92 array = dev_priv->save_palette_a;
94 array = dev_priv->save_palette_b;
96 for(i = 0; i < 256; i++)
97 array[i] = I915_READ(reg + (i << 2));
100 static void i915_restore_palette(struct drm_device *dev, enum pipe pipe)
102 struct drm_i915_private *dev_priv = dev->dev_private;
103 unsigned long reg = (pipe == PIPE_A ? PALETTE_A : PALETTE_B);
107 if (!i915_pipe_enabled(dev, pipe))
111 array = dev_priv->save_palette_a;
113 array = dev_priv->save_palette_b;
115 for(i = 0; i < 256; i++)
116 I915_WRITE(reg + (i << 2), array[i]);
119 static u8 i915_read_indexed(u16 index_port, u16 data_port, u8 reg)
121 outb(reg, index_port);
122 return inb(data_port);
125 static u8 i915_read_ar(u16 st01, u8 reg, u16 palette_enable)
128 outb(palette_enable | reg, VGA_AR_INDEX);
129 return inb(VGA_AR_DATA_READ);
132 static void i915_write_ar(u8 st01, u8 reg, u8 val, u16 palette_enable)
135 outb(palette_enable | reg, VGA_AR_INDEX);
136 outb(val, VGA_AR_DATA_WRITE);
139 static void i915_write_indexed(u16 index_port, u16 data_port, u8 reg, u8 val)
141 outb(reg, index_port);
142 outb(val, data_port);
145 static void i915_save_vga(struct drm_device *dev)
147 struct drm_i915_private *dev_priv = dev->dev_private;
149 u16 cr_index, cr_data, st01;
151 /* VGA color palette registers */
152 dev_priv->saveDACMASK = inb(VGA_DACMASK);
153 /* DACCRX automatically increments during read */
155 /* Read 3 bytes of color data from each index */
156 for (i = 0; i < 256 * 3; i++)
157 dev_priv->saveDACDATA[i] = inb(VGA_DACDATA);
160 dev_priv->saveMSR = inb(VGA_MSR_READ);
161 if (dev_priv->saveMSR & VGA_MSR_CGA_MODE) {
162 cr_index = VGA_CR_INDEX_CGA;
163 cr_data = VGA_CR_DATA_CGA;
166 cr_index = VGA_CR_INDEX_MDA;
167 cr_data = VGA_CR_DATA_MDA;
171 /* CRT controller regs */
172 i915_write_indexed(cr_index, cr_data, 0x11,
173 i915_read_indexed(cr_index, cr_data, 0x11) &
175 for (i = 0; i <= 0x24; i++)
176 dev_priv->saveCR[i] =
177 i915_read_indexed(cr_index, cr_data, i);
178 /* Make sure we don't turn off CR group 0 writes */
179 dev_priv->saveCR[0x11] &= ~0x80;
181 /* Attribute controller registers */
183 dev_priv->saveAR_INDEX = inb(VGA_AR_INDEX);
184 for (i = 0; i <= 0x14; i++)
185 dev_priv->saveAR[i] = i915_read_ar(st01, i, 0);
187 outb(dev_priv->saveAR_INDEX, VGA_AR_INDEX);
190 /* Graphics controller registers */
191 for (i = 0; i < 9; i++)
192 dev_priv->saveGR[i] =
193 i915_read_indexed(VGA_GR_INDEX, VGA_GR_DATA, i);
195 dev_priv->saveGR[0x10] =
196 i915_read_indexed(VGA_GR_INDEX, VGA_GR_DATA, 0x10);
197 dev_priv->saveGR[0x11] =
198 i915_read_indexed(VGA_GR_INDEX, VGA_GR_DATA, 0x11);
199 dev_priv->saveGR[0x18] =
200 i915_read_indexed(VGA_GR_INDEX, VGA_GR_DATA, 0x18);
202 /* Sequencer registers */
203 for (i = 0; i < 8; i++)
204 dev_priv->saveSR[i] =
205 i915_read_indexed(VGA_SR_INDEX, VGA_SR_DATA, i);
208 static void i915_restore_vga(struct drm_device *dev)
210 struct drm_i915_private *dev_priv = dev->dev_private;
212 u16 cr_index, cr_data, st01;
215 outb(dev_priv->saveMSR, VGA_MSR_WRITE);
216 if (dev_priv->saveMSR & VGA_MSR_CGA_MODE) {
217 cr_index = VGA_CR_INDEX_CGA;
218 cr_data = VGA_CR_DATA_CGA;
221 cr_index = VGA_CR_INDEX_MDA;
222 cr_data = VGA_CR_DATA_MDA;
226 /* Sequencer registers, don't write SR07 */
227 for (i = 0; i < 7; i++)
228 i915_write_indexed(VGA_SR_INDEX, VGA_SR_DATA, i,
229 dev_priv->saveSR[i]);
231 /* CRT controller regs */
232 /* Enable CR group 0 writes */
233 i915_write_indexed(cr_index, cr_data, 0x11, dev_priv->saveCR[0x11]);
234 for (i = 0; i <= 0x24; i++)
235 i915_write_indexed(cr_index, cr_data, i, dev_priv->saveCR[i]);
237 /* Graphics controller regs */
238 for (i = 0; i < 9; i++)
239 i915_write_indexed(VGA_GR_INDEX, VGA_GR_DATA, i,
240 dev_priv->saveGR[i]);
242 i915_write_indexed(VGA_GR_INDEX, VGA_GR_DATA, 0x10,
243 dev_priv->saveGR[0x10]);
244 i915_write_indexed(VGA_GR_INDEX, VGA_GR_DATA, 0x11,
245 dev_priv->saveGR[0x11]);
246 i915_write_indexed(VGA_GR_INDEX, VGA_GR_DATA, 0x18,
247 dev_priv->saveGR[0x18]);
249 /* Attribute controller registers */
250 inb(st01); /* switch back to index mode */
251 for (i = 0; i <= 0x14; i++)
252 i915_write_ar(st01, i, dev_priv->saveAR[i], 0);
253 inb(st01); /* switch back to index mode */
254 outb(dev_priv->saveAR_INDEX | 0x20, VGA_AR_INDEX);
257 /* VGA color palette registers */
258 outb(dev_priv->saveDACMASK, VGA_DACMASK);
259 /* DACCRX automatically increments during read */
261 /* Read 3 bytes of color data from each index */
262 for (i = 0; i < 256 * 3; i++)
263 outb(dev_priv->saveDACDATA[i], VGA_DACDATA);
267 static int i915_suspend(struct drm_device *dev, pm_message_t state)
269 struct drm_i915_private *dev_priv = dev->dev_private;
272 if (!dev || !dev_priv) {
273 printk(KERN_ERR "dev: %p, dev_priv: %p\n", dev, dev_priv);
274 printk(KERN_ERR "DRM not initialized, aborting suspend.\n");
278 if (state.event == PM_EVENT_PRETHAW)
281 pci_save_state(dev->pdev);
282 pci_read_config_byte(dev->pdev, LBB, &dev_priv->saveLBB);
284 /* Display arbitration control */
285 dev_priv->saveDSPARB = I915_READ(DSPARB);
287 /* Pipe & plane A info */
288 dev_priv->savePIPEACONF = I915_READ(PIPEACONF);
289 dev_priv->savePIPEASRC = I915_READ(PIPEASRC);
290 dev_priv->saveFPA0 = I915_READ(FPA0);
291 dev_priv->saveFPA1 = I915_READ(FPA1);
292 dev_priv->saveDPLL_A = I915_READ(DPLL_A);
294 dev_priv->saveDPLL_A_MD = I915_READ(DPLL_A_MD);
295 dev_priv->saveHTOTAL_A = I915_READ(HTOTAL_A);
296 dev_priv->saveHBLANK_A = I915_READ(HBLANK_A);
297 dev_priv->saveHSYNC_A = I915_READ(HSYNC_A);
298 dev_priv->saveVTOTAL_A = I915_READ(VTOTAL_A);
299 dev_priv->saveVBLANK_A = I915_READ(VBLANK_A);
300 dev_priv->saveVSYNC_A = I915_READ(VSYNC_A);
301 dev_priv->saveBCLRPAT_A = I915_READ(BCLRPAT_A);
303 dev_priv->saveDSPACNTR = I915_READ(DSPACNTR);
304 dev_priv->saveDSPASTRIDE = I915_READ(DSPASTRIDE);
305 dev_priv->saveDSPASIZE = I915_READ(DSPASIZE);
306 dev_priv->saveDSPAPOS = I915_READ(DSPAPOS);
307 dev_priv->saveDSPABASE = I915_READ(DSPABASE);
309 dev_priv->saveDSPASURF = I915_READ(DSPASURF);
310 dev_priv->saveDSPATILEOFF = I915_READ(DSPATILEOFF);
312 i915_save_palette(dev, PIPE_A);
313 dev_priv->savePIPEASTAT = I915_READ(I915REG_PIPEASTAT);
315 /* Pipe & plane B info */
316 dev_priv->savePIPEBCONF = I915_READ(PIPEBCONF);
317 dev_priv->savePIPEBSRC = I915_READ(PIPEBSRC);
318 dev_priv->saveFPB0 = I915_READ(FPB0);
319 dev_priv->saveFPB1 = I915_READ(FPB1);
320 dev_priv->saveDPLL_B = I915_READ(DPLL_B);
322 dev_priv->saveDPLL_B_MD = I915_READ(DPLL_B_MD);
323 dev_priv->saveHTOTAL_B = I915_READ(HTOTAL_B);
324 dev_priv->saveHBLANK_B = I915_READ(HBLANK_B);
325 dev_priv->saveHSYNC_B = I915_READ(HSYNC_B);
326 dev_priv->saveVTOTAL_B = I915_READ(VTOTAL_B);
327 dev_priv->saveVBLANK_B = I915_READ(VBLANK_B);
328 dev_priv->saveVSYNC_B = I915_READ(VSYNC_B);
329 dev_priv->saveBCLRPAT_A = I915_READ(BCLRPAT_A);
331 dev_priv->saveDSPBCNTR = I915_READ(DSPBCNTR);
332 dev_priv->saveDSPBSTRIDE = I915_READ(DSPBSTRIDE);
333 dev_priv->saveDSPBSIZE = I915_READ(DSPBSIZE);
334 dev_priv->saveDSPBPOS = I915_READ(DSPBPOS);
335 dev_priv->saveDSPBBASE = I915_READ(DSPBBASE);
336 if (IS_I965GM(dev) || IS_IGD_GM(dev)) {
337 dev_priv->saveDSPBSURF = I915_READ(DSPBSURF);
338 dev_priv->saveDSPBTILEOFF = I915_READ(DSPBTILEOFF);
340 i915_save_palette(dev, PIPE_B);
341 dev_priv->savePIPEBSTAT = I915_READ(I915REG_PIPEBSTAT);
344 dev_priv->saveADPA = I915_READ(ADPA);
347 dev_priv->savePP_CONTROL = I915_READ(PP_CONTROL);
348 dev_priv->savePFIT_PGM_RATIOS = I915_READ(PFIT_PGM_RATIOS);
349 dev_priv->saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL);
351 dev_priv->saveBLC_PWM_CTL2 = I915_READ(BLC_PWM_CTL2);
352 if (IS_MOBILE(dev) && !IS_I830(dev))
353 dev_priv->saveLVDS = I915_READ(LVDS);
354 if (!IS_I830(dev) && !IS_845G(dev))
355 dev_priv->savePFIT_CONTROL = I915_READ(PFIT_CONTROL);
356 dev_priv->saveLVDSPP_ON = I915_READ(LVDSPP_ON);
357 dev_priv->saveLVDSPP_OFF = I915_READ(LVDSPP_OFF);
358 dev_priv->savePP_CYCLE = I915_READ(PP_CYCLE);
360 /* FIXME: save TV & SDVO state */
363 dev_priv->saveFBC_CFB_BASE = I915_READ(FBC_CFB_BASE);
364 dev_priv->saveFBC_LL_BASE = I915_READ(FBC_LL_BASE);
365 dev_priv->saveFBC_CONTROL2 = I915_READ(FBC_CONTROL2);
366 dev_priv->saveFBC_CONTROL = I915_READ(FBC_CONTROL);
368 /* Interrupt state */
369 dev_priv->saveIIR = I915_READ(I915REG_INT_IDENTITY_R);
370 dev_priv->saveIER = I915_READ(I915REG_INT_ENABLE_R);
371 dev_priv->saveIMR = I915_READ(I915REG_INT_MASK_R);
374 dev_priv->saveVCLK_DIVISOR_VGA0 = I915_READ(VCLK_DIVISOR_VGA0);
375 dev_priv->saveVCLK_DIVISOR_VGA1 = I915_READ(VCLK_DIVISOR_VGA1);
376 dev_priv->saveVCLK_POST_DIV = I915_READ(VCLK_POST_DIV);
377 dev_priv->saveVGACNTRL = I915_READ(VGACNTRL);
379 /* Clock gating state */
380 dev_priv->saveD_STATE = I915_READ(D_STATE);
381 dev_priv->saveDSPCLK_GATE_D = I915_READ(DSPCLK_GATE_D);
383 /* Cache mode state */
384 dev_priv->saveCACHE_MODE_0 = I915_READ(CACHE_MODE_0);
386 /* Memory Arbitration state */
387 dev_priv->saveMI_ARB_STATE = I915_READ(MI_ARB_STATE);
390 for (i = 0; i < 16; i++) {
391 dev_priv->saveSWF0[i] = I915_READ(SWF0 + (i << 2));
392 dev_priv->saveSWF1[i] = I915_READ(SWF10 + (i << 2));
394 for (i = 0; i < 3; i++)
395 dev_priv->saveSWF2[i] = I915_READ(SWF30 + (i << 2));
399 if (state.event == PM_EVENT_SUSPEND) {
400 /* Shut down the device */
401 pci_disable_device(dev->pdev);
402 pci_set_power_state(dev->pdev, PCI_D3hot);
408 static int i915_resume(struct drm_device *dev)
410 struct drm_i915_private *dev_priv = dev->dev_private;
413 pci_set_power_state(dev->pdev, PCI_D0);
414 pci_restore_state(dev->pdev);
415 if (pci_enable_device(dev->pdev))
418 pci_write_config_byte(dev->pdev, LBB, dev_priv->saveLBB);
420 I915_WRITE(DSPARB, dev_priv->saveDSPARB);
422 /* Pipe & plane A info */
423 /* Prime the clock */
424 if (dev_priv->saveDPLL_A & DPLL_VCO_ENABLE) {
425 I915_WRITE(DPLL_A, dev_priv->saveDPLL_A &
429 I915_WRITE(FPA0, dev_priv->saveFPA0);
430 I915_WRITE(FPA1, dev_priv->saveFPA1);
431 /* Actually enable it */
432 I915_WRITE(DPLL_A, dev_priv->saveDPLL_A);
435 I915_WRITE(DPLL_A_MD, dev_priv->saveDPLL_A_MD);
439 I915_WRITE(HTOTAL_A, dev_priv->saveHTOTAL_A);
440 I915_WRITE(HBLANK_A, dev_priv->saveHBLANK_A);
441 I915_WRITE(HSYNC_A, dev_priv->saveHSYNC_A);
442 I915_WRITE(VTOTAL_A, dev_priv->saveVTOTAL_A);
443 I915_WRITE(VBLANK_A, dev_priv->saveVBLANK_A);
444 I915_WRITE(VSYNC_A, dev_priv->saveVSYNC_A);
445 I915_WRITE(BCLRPAT_A, dev_priv->saveBCLRPAT_A);
447 /* Restore plane info */
448 I915_WRITE(DSPASIZE, dev_priv->saveDSPASIZE);
449 I915_WRITE(DSPAPOS, dev_priv->saveDSPAPOS);
450 I915_WRITE(PIPEASRC, dev_priv->savePIPEASRC);
451 I915_WRITE(DSPABASE, dev_priv->saveDSPABASE);
452 I915_WRITE(DSPASTRIDE, dev_priv->saveDSPASTRIDE);
454 I915_WRITE(DSPASURF, dev_priv->saveDSPASURF);
455 I915_WRITE(DSPATILEOFF, dev_priv->saveDSPATILEOFF);
458 I915_WRITE(PIPEACONF, dev_priv->savePIPEACONF);
460 i915_restore_palette(dev, PIPE_A);
461 /* Enable the plane */
462 I915_WRITE(DSPACNTR, dev_priv->saveDSPACNTR);
463 I915_WRITE(DSPABASE, I915_READ(DSPABASE));
465 /* Pipe & plane B info */
466 if (dev_priv->saveDPLL_B & DPLL_VCO_ENABLE) {
467 I915_WRITE(DPLL_B, dev_priv->saveDPLL_B &
471 I915_WRITE(FPB0, dev_priv->saveFPB0);
472 I915_WRITE(FPB1, dev_priv->saveFPB1);
473 /* Actually enable it */
474 I915_WRITE(DPLL_B, dev_priv->saveDPLL_B);
477 I915_WRITE(DPLL_B_MD, dev_priv->saveDPLL_B_MD);
481 I915_WRITE(HTOTAL_B, dev_priv->saveHTOTAL_B);
482 I915_WRITE(HBLANK_B, dev_priv->saveHBLANK_B);
483 I915_WRITE(HSYNC_B, dev_priv->saveHSYNC_B);
484 I915_WRITE(VTOTAL_B, dev_priv->saveVTOTAL_B);
485 I915_WRITE(VBLANK_B, dev_priv->saveVBLANK_B);
486 I915_WRITE(VSYNC_B, dev_priv->saveVSYNC_B);
487 I915_WRITE(BCLRPAT_B, dev_priv->saveBCLRPAT_B);
489 /* Restore plane info */
490 I915_WRITE(DSPBSIZE, dev_priv->saveDSPBSIZE);
491 I915_WRITE(DSPBPOS, dev_priv->saveDSPBPOS);
492 I915_WRITE(PIPEBSRC, dev_priv->savePIPEBSRC);
493 I915_WRITE(DSPBBASE, dev_priv->saveDSPBBASE);
494 I915_WRITE(DSPBSTRIDE, dev_priv->saveDSPBSTRIDE);
496 I915_WRITE(DSPBSURF, dev_priv->saveDSPBSURF);
497 I915_WRITE(DSPBTILEOFF, dev_priv->saveDSPBTILEOFF);
500 I915_WRITE(PIPEBCONF, dev_priv->savePIPEBCONF);
502 i915_restore_palette(dev, PIPE_B);
503 /* Enable the plane */
504 I915_WRITE(DSPBCNTR, dev_priv->saveDSPBCNTR);
505 I915_WRITE(DSPBBASE, I915_READ(DSPBBASE));
508 I915_WRITE(ADPA, dev_priv->saveADPA);
512 I915_WRITE(BLC_PWM_CTL2, dev_priv->saveBLC_PWM_CTL2);
513 if (IS_MOBILE(dev) && !IS_I830(dev))
514 I915_WRITE(LVDS, dev_priv->saveLVDS);
515 if (!IS_I830(dev) && !IS_845G(dev))
516 I915_WRITE(PFIT_CONTROL, dev_priv->savePFIT_CONTROL);
518 I915_WRITE(PFIT_PGM_RATIOS, dev_priv->savePFIT_PGM_RATIOS);
519 I915_WRITE(BLC_PWM_CTL, dev_priv->saveBLC_PWM_CTL);
520 I915_WRITE(LVDSPP_ON, dev_priv->saveLVDSPP_ON);
521 I915_WRITE(LVDSPP_OFF, dev_priv->saveLVDSPP_OFF);
522 I915_WRITE(PP_CYCLE, dev_priv->savePP_CYCLE);
523 I915_WRITE(PP_CONTROL, dev_priv->savePP_CONTROL);
525 /* FIXME: restore TV & SDVO state */
528 I915_WRITE(FBC_CFB_BASE, dev_priv->saveFBC_CFB_BASE);
529 I915_WRITE(FBC_LL_BASE, dev_priv->saveFBC_LL_BASE);
530 I915_WRITE(FBC_CONTROL2, dev_priv->saveFBC_CONTROL2);
531 I915_WRITE(FBC_CONTROL, dev_priv->saveFBC_CONTROL);
534 I915_WRITE(VGACNTRL, dev_priv->saveVGACNTRL);
535 I915_WRITE(VCLK_DIVISOR_VGA0, dev_priv->saveVCLK_DIVISOR_VGA0);
536 I915_WRITE(VCLK_DIVISOR_VGA1, dev_priv->saveVCLK_DIVISOR_VGA1);
537 I915_WRITE(VCLK_POST_DIV, dev_priv->saveVCLK_POST_DIV);
540 /* Clock gating state */
541 I915_WRITE (D_STATE, dev_priv->saveD_STATE);
542 I915_WRITE (DSPCLK_GATE_D, dev_priv->saveDSPCLK_GATE_D);
544 /* Cache mode state */
545 I915_WRITE (CACHE_MODE_0, dev_priv->saveCACHE_MODE_0 | 0xffff0000);
547 /* Memory arbitration state */
548 I915_WRITE (MI_ARB_STATE, dev_priv->saveMI_ARB_STATE | 0xffff0000);
550 for (i = 0; i < 16; i++) {
551 I915_WRITE(SWF0 + (i << 2), dev_priv->saveSWF0[i]);
552 I915_WRITE(SWF10 + (i << 2), dev_priv->saveSWF1[i+7]);
554 for (i = 0; i < 3; i++)
555 I915_WRITE(SWF30 + (i << 2), dev_priv->saveSWF2[i]);
557 i915_restore_vga(dev);
562 static int probe(struct pci_dev *pdev, const struct pci_device_id *ent);
563 static struct drm_driver driver = {
564 /* don't use mtrr's here, the Xserver or user space app should
565 * deal with them for intel hardware.
568 DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | /* DRIVER_USE_MTRR | */
569 DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED,
570 .load = i915_driver_load,
571 .unload = i915_driver_unload,
572 .firstopen = i915_driver_firstopen,
573 .lastclose = i915_driver_lastclose,
574 .preclose = i915_driver_preclose,
575 .suspend = i915_suspend,
576 .resume = i915_resume,
577 .device_is_agp = i915_driver_device_is_agp,
578 .get_vblank_counter = i915_get_vblank_counter,
579 .enable_vblank = i915_enable_vblank,
580 .disable_vblank = i915_disable_vblank,
581 .irq_preinstall = i915_driver_irq_preinstall,
582 .irq_postinstall = i915_driver_irq_postinstall,
583 .irq_uninstall = i915_driver_irq_uninstall,
584 .irq_handler = i915_driver_irq_handler,
585 .reclaim_buffers = drm_core_reclaim_buffers,
586 .get_map_ofs = drm_core_get_map_ofs,
587 .get_reg_ofs = drm_core_get_reg_ofs,
588 .ioctls = i915_ioctls,
590 .owner = THIS_MODULE,
592 .release = drm_release,
596 .fasync = drm_fasync,
597 #if defined(CONFIG_COMPAT) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
598 .compat_ioctl = i915_compat_ioctl,
603 .id_table = pciidlist,
605 .remove = __devexit_p(drm_cleanup_pci),
607 #ifdef I915_HAVE_FENCE
608 .fence_driver = &i915_fence_driver,
610 #ifdef I915_HAVE_BUFFER
611 .bo_driver = &i915_bo_driver,
616 .major = DRIVER_MAJOR,
617 .minor = DRIVER_MINOR,
618 .patchlevel = DRIVER_PATCHLEVEL,
621 static int probe(struct pci_dev *pdev, const struct pci_device_id *ent)
623 return drm_get_dev(pdev, ent, &driver);
626 static int __init i915_init(void)
628 driver.num_ioctls = i915_max_ioctl;
629 return drm_init(&driver, pciidlist);
632 static void __exit i915_exit(void)
637 module_init(i915_init);
638 module_exit(i915_exit);
640 MODULE_AUTHOR(DRIVER_AUTHOR);
641 MODULE_DESCRIPTION(DRIVER_DESC);
642 MODULE_LICENSE("GPL and additional rights");