Lines Matching refs:dinfo
67 int intelfbhw_get_chipset(struct pci_dev *pdev, struct intelfb_info *dinfo) in intelfbhw_get_chipset() argument
70 if (!pdev || !dinfo) in intelfbhw_get_chipset()
75 dinfo->name = "Intel(R) 830M"; in intelfbhw_get_chipset()
76 dinfo->chipset = INTEL_830M; in intelfbhw_get_chipset()
77 dinfo->mobile = 1; in intelfbhw_get_chipset()
78 dinfo->pll_index = PLLS_I8xx; in intelfbhw_get_chipset()
81 dinfo->name = "Intel(R) 845G"; in intelfbhw_get_chipset()
82 dinfo->chipset = INTEL_845G; in intelfbhw_get_chipset()
83 dinfo->mobile = 0; in intelfbhw_get_chipset()
84 dinfo->pll_index = PLLS_I8xx; in intelfbhw_get_chipset()
87 dinfo->mobile = 1; in intelfbhw_get_chipset()
88 dinfo->name = "Intel(R) 854"; in intelfbhw_get_chipset()
89 dinfo->chipset = INTEL_854; in intelfbhw_get_chipset()
93 dinfo->mobile = 1; in intelfbhw_get_chipset()
94 dinfo->pll_index = PLLS_I8xx; in intelfbhw_get_chipset()
99 dinfo->name = "Intel(R) 855GME"; in intelfbhw_get_chipset()
100 dinfo->chipset = INTEL_855GME; in intelfbhw_get_chipset()
103 dinfo->name = "Intel(R) 855GM"; in intelfbhw_get_chipset()
104 dinfo->chipset = INTEL_855GM; in intelfbhw_get_chipset()
107 dinfo->name = "Intel(R) 852GME"; in intelfbhw_get_chipset()
108 dinfo->chipset = INTEL_852GME; in intelfbhw_get_chipset()
111 dinfo->name = "Intel(R) 852GM"; in intelfbhw_get_chipset()
112 dinfo->chipset = INTEL_852GM; in intelfbhw_get_chipset()
115 dinfo->name = "Intel(R) 852GM/855GM"; in intelfbhw_get_chipset()
116 dinfo->chipset = INTEL_85XGM; in intelfbhw_get_chipset()
121 dinfo->name = "Intel(R) 865G"; in intelfbhw_get_chipset()
122 dinfo->chipset = INTEL_865G; in intelfbhw_get_chipset()
123 dinfo->mobile = 0; in intelfbhw_get_chipset()
124 dinfo->pll_index = PLLS_I8xx; in intelfbhw_get_chipset()
127 dinfo->name = "Intel(R) 915G"; in intelfbhw_get_chipset()
128 dinfo->chipset = INTEL_915G; in intelfbhw_get_chipset()
129 dinfo->mobile = 0; in intelfbhw_get_chipset()
130 dinfo->pll_index = PLLS_I9xx; in intelfbhw_get_chipset()
133 dinfo->name = "Intel(R) 915GM"; in intelfbhw_get_chipset()
134 dinfo->chipset = INTEL_915GM; in intelfbhw_get_chipset()
135 dinfo->mobile = 1; in intelfbhw_get_chipset()
136 dinfo->pll_index = PLLS_I9xx; in intelfbhw_get_chipset()
139 dinfo->name = "Intel(R) 945G"; in intelfbhw_get_chipset()
140 dinfo->chipset = INTEL_945G; in intelfbhw_get_chipset()
141 dinfo->mobile = 0; in intelfbhw_get_chipset()
142 dinfo->pll_index = PLLS_I9xx; in intelfbhw_get_chipset()
145 dinfo->name = "Intel(R) 945GM"; in intelfbhw_get_chipset()
146 dinfo->chipset = INTEL_945GM; in intelfbhw_get_chipset()
147 dinfo->mobile = 1; in intelfbhw_get_chipset()
148 dinfo->pll_index = PLLS_I9xx; in intelfbhw_get_chipset()
151 dinfo->name = "Intel(R) 945GME"; in intelfbhw_get_chipset()
152 dinfo->chipset = INTEL_945GME; in intelfbhw_get_chipset()
153 dinfo->mobile = 1; in intelfbhw_get_chipset()
154 dinfo->pll_index = PLLS_I9xx; in intelfbhw_get_chipset()
157 dinfo->name = "Intel(R) 965G"; in intelfbhw_get_chipset()
158 dinfo->chipset = INTEL_965G; in intelfbhw_get_chipset()
159 dinfo->mobile = 0; in intelfbhw_get_chipset()
160 dinfo->pll_index = PLLS_I9xx; in intelfbhw_get_chipset()
163 dinfo->name = "Intel(R) 965GM"; in intelfbhw_get_chipset()
164 dinfo->chipset = INTEL_965GM; in intelfbhw_get_chipset()
165 dinfo->mobile = 1; in intelfbhw_get_chipset()
166 dinfo->pll_index = PLLS_I9xx; in intelfbhw_get_chipset()
280 int intelfbhw_check_non_crt(struct intelfb_info *dinfo) in intelfbhw_check_non_crt() argument
311 int intelfbhw_validate_mode(struct intelfb_info *dinfo, in intelfbhw_validate_mode() argument
327 if (tmp > dinfo->fb.size) { in intelfbhw_validate_mode()
330 BtoKB(tmp), BtoKB(dinfo->fb.size)); in intelfbhw_validate_mode()
383 struct intelfb_info *dinfo = GET_DINFO(info); in intelfbhw_pan_display() local
397 offset = (yoffset * dinfo->pitch) + in intelfbhw_pan_display()
400 offset += dinfo->fb.offset << 12; in intelfbhw_pan_display()
402 dinfo->vsync.pan_offset = offset; in intelfbhw_pan_display()
404 !intelfbhw_enable_irq(dinfo)) in intelfbhw_pan_display()
405 dinfo->vsync.pan_display = 1; in intelfbhw_pan_display()
407 dinfo->vsync.pan_display = 0; in intelfbhw_pan_display()
417 struct intelfb_info *dinfo = GET_DINFO(info); in intelfbhw_do_blank() local
437 DBG_MSG("cursor_on is %d\n", dinfo->cursor_on); in intelfbhw_do_blank()
439 if (dinfo->cursor_on) { in intelfbhw_do_blank()
441 intelfbhw_cursor_hide(dinfo); in intelfbhw_do_blank()
443 intelfbhw_cursor_show(dinfo); in intelfbhw_do_blank()
444 dinfo->cursor_on = 1; in intelfbhw_do_blank()
446 dinfo->cursor_blanked = blank; in intelfbhw_do_blank()
497 void intelfbhw_setcolreg(struct intelfb_info *dinfo, unsigned regno, in intelfbhw_setcolreg() argument
501 u32 palette_reg = (dinfo->pipe == PIPE_A) ? in intelfbhw_setcolreg()
516 int intelfbhw_read_hw_state(struct intelfb_info *dinfo, in intelfbhw_read_hw_state() argument
525 if (!hw || !dinfo) in intelfbhw_read_hw_state()
682 static void intelfbhw_get_p1p2(struct intelfb_info *dinfo, int dpll, in intelfbhw_get_p1p2() argument
687 if (IS_I9XX(dinfo)) { in intelfbhw_get_p1p2()
710 void intelfbhw_print_hw_state(struct intelfb_info *dinfo, in intelfbhw_print_hw_state() argument
715 int index = dinfo->pll_index; in intelfbhw_print_hw_state()
729 intelfbhw_get_p1p2(dinfo, hw->vga_pd, &p1, &p2); in intelfbhw_print_hw_state()
740 intelfbhw_get_p1p2(dinfo, hw->vga_pd, &p1, &p2); in intelfbhw_print_hw_state()
757 intelfbhw_get_p1p2(dinfo, hw->dpll_a, &p1, &p2); in intelfbhw_print_hw_state()
768 intelfbhw_get_p1p2(dinfo, hw->dpll_a, &p1, &p2); in intelfbhw_print_hw_state()
1043 int intelfbhw_mode_to_hw(struct intelfb_info *dinfo, in intelfbhw_mode_to_hw() argument
1118 if (calc_pll_params(dinfo->pll_index, clock_target, &m1, &m2, in intelfbhw_mode_to_hw()
1140 if (IS_I9XX(dinfo)) { in intelfbhw_mode_to_hw()
1251 hw->disp_a_stride = dinfo->pitch; in intelfbhw_mode_to_hw()
1257 hw->disp_a_base += dinfo->fb.offset << 12; in intelfbhw_mode_to_hw()
1260 stride_alignment = IS_I9XX(dinfo) ? STRIDE_ALIGNMENT_I9XX : in intelfbhw_mode_to_hw()
1280 int intelfbhw_program_mode(struct intelfb_info *dinfo, in intelfbhw_program_mode() argument
1303 dinfo->pipe = intelfbhw_active_pipe(hw); in intelfbhw_program_mode()
1305 if (dinfo->pipe == PIPE_B) { in intelfbhw_program_mode()
1432 switch (dinfo->info->var.vmode & (FB_VMODE_INTERLACED | in intelfbhw_program_mode()
1453 if (dinfo->pdev->device == PCI_DEVICE_ID_INTEL_830M) { in intelfbhw_program_mode()
1485 static void refresh_ring(struct intelfb_info *dinfo);
1486 static void reset_state(struct intelfb_info *dinfo);
1487 static void do_flush(struct intelfb_info *dinfo);
1489 static u32 get_ring_space(struct intelfb_info *dinfo) in get_ring_space() argument
1493 if (dinfo->ring_tail >= dinfo->ring_head) in get_ring_space()
1494 ring_space = dinfo->ring.size - in get_ring_space()
1495 (dinfo->ring_tail - dinfo->ring_head); in get_ring_space()
1497 ring_space = dinfo->ring_head - dinfo->ring_tail; in get_ring_space()
1507 static int wait_ring(struct intelfb_info *dinfo, int n) in wait_ring() argument
1518 while (dinfo->ring_space < n) { in wait_ring()
1519 dinfo->ring_head = INREG(PRI_RING_HEAD) & RING_HEAD_MASK; in wait_ring()
1520 dinfo->ring_space = get_ring_space(dinfo); in wait_ring()
1522 if (dinfo->ring_head != last_head) { in wait_ring()
1524 last_head = dinfo->ring_head; in wait_ring()
1530 reset_state(dinfo); in wait_ring()
1531 refresh_ring(dinfo); in wait_ring()
1532 do_flush(dinfo); in wait_ring()
1537 dinfo->ring_space, n); in wait_ring()
1540 dinfo->ring_lockup = 1; in wait_ring()
1549 static void do_flush(struct intelfb_info *dinfo) in do_flush() argument
1557 void intelfbhw_do_sync(struct intelfb_info *dinfo) in intelfbhw_do_sync() argument
1563 if (!dinfo->accel) in intelfbhw_do_sync()
1571 do_flush(dinfo); in intelfbhw_do_sync()
1572 wait_ring(dinfo, dinfo->ring.size - RING_MIN_FREE); in intelfbhw_do_sync()
1573 dinfo->ring_space = dinfo->ring.size - RING_MIN_FREE; in intelfbhw_do_sync()
1576 static void refresh_ring(struct intelfb_info *dinfo) in refresh_ring() argument
1582 dinfo->ring_head = INREG(PRI_RING_HEAD) & RING_HEAD_MASK; in refresh_ring()
1583 dinfo->ring_tail = INREG(PRI_RING_TAIL) & RING_TAIL_MASK; in refresh_ring()
1584 dinfo->ring_space = get_ring_space(dinfo); in refresh_ring()
1587 static void reset_state(struct intelfb_info *dinfo) in reset_state() argument
1605 refresh_ring(dinfo); in reset_state()
1606 intelfbhw_do_sync(dinfo); in reset_state()
1617 void intelfbhw_2d_stop(struct intelfb_info *dinfo) in intelfbhw_2d_stop() argument
1621 dinfo->accel, dinfo->ring_active); in intelfbhw_2d_stop()
1624 if (!dinfo->accel) in intelfbhw_2d_stop()
1627 dinfo->ring_active = 0; in intelfbhw_2d_stop()
1628 reset_state(dinfo); in intelfbhw_2d_stop()
1636 void intelfbhw_2d_start(struct intelfb_info *dinfo) in intelfbhw_2d_start() argument
1640 dinfo->accel, dinfo->ring_active); in intelfbhw_2d_start()
1643 if (!dinfo->accel) in intelfbhw_2d_start()
1651 OUTREG(PRI_RING_START, dinfo->ring.physical & RING_START_MASK); in intelfbhw_2d_start()
1653 ((dinfo->ring.size - GTT_PAGE_SIZE) & RING_LENGTH_MASK) | in intelfbhw_2d_start()
1655 refresh_ring(dinfo); in intelfbhw_2d_start()
1656 dinfo->ring_active = 1; in intelfbhw_2d_start()
1660 void intelfbhw_do_fillrect(struct intelfb_info *dinfo, u32 x, u32 y, u32 w, in intelfbhw_do_fillrect() argument
1671 br09 = dinfo->fb_start + (y * pitch + x * (bpp / 8)); in intelfbhw_do_fillrect()
1699 DBG_MSG("ring = 0x%08x, 0x%08x (%d)\n", dinfo->ring_head, in intelfbhw_do_fillrect()
1700 dinfo->ring_tail, dinfo->ring_space); in intelfbhw_do_fillrect()
1705 intelfbhw_do_bitblt(struct intelfb_info *dinfo, u32 curx, u32 cury, in intelfbhw_do_bitblt() argument
1716 br09 = dinfo->fb_start; in intelfbhw_do_bitblt()
1718 br12 = dinfo->fb_start; in intelfbhw_do_bitblt()
1750 int intelfbhw_do_drawglyph(struct intelfb_info *dinfo, u32 fg, u32 bg, u32 w, in intelfbhw_do_drawglyph() argument
1787 br09 = dinfo->fb_start; in intelfbhw_do_drawglyph()
1839 void intelfbhw_cursor_init(struct intelfb_info *dinfo) in intelfbhw_cursor_init() argument
1847 if (dinfo->mobile || IS_I9XX(dinfo)) { in intelfbhw_cursor_init()
1848 if (!dinfo->cursor.physical) in intelfbhw_cursor_init()
1856 OUTREG(CURSOR_A_BASEADDR, dinfo->cursor.physical); in intelfbhw_cursor_init()
1863 OUTREG(CURSOR_A_BASEADDR, dinfo->cursor.offset << 12); in intelfbhw_cursor_init()
1870 void intelfbhw_cursor_hide(struct intelfb_info *dinfo) in intelfbhw_cursor_hide() argument
1878 dinfo->cursor_on = 0; in intelfbhw_cursor_hide()
1879 if (dinfo->mobile || IS_I9XX(dinfo)) { in intelfbhw_cursor_hide()
1880 if (!dinfo->cursor.physical) in intelfbhw_cursor_hide()
1887 OUTREG(CURSOR_A_BASEADDR, dinfo->cursor.physical); in intelfbhw_cursor_hide()
1895 void intelfbhw_cursor_show(struct intelfb_info *dinfo) in intelfbhw_cursor_show() argument
1903 dinfo->cursor_on = 1; in intelfbhw_cursor_show()
1905 if (dinfo->cursor_blanked) in intelfbhw_cursor_show()
1908 if (dinfo->mobile || IS_I9XX(dinfo)) { in intelfbhw_cursor_show()
1909 if (!dinfo->cursor.physical) in intelfbhw_cursor_show()
1916 OUTREG(CURSOR_A_BASEADDR, dinfo->cursor.physical); in intelfbhw_cursor_show()
1924 void intelfbhw_cursor_setpos(struct intelfb_info *dinfo, int x, int y) in intelfbhw_cursor_setpos() argument
1942 if (IS_I9XX(dinfo)) in intelfbhw_cursor_setpos()
1943 OUTREG(CURSOR_A_BASEADDR, dinfo->cursor.physical); in intelfbhw_cursor_setpos()
1946 void intelfbhw_cursor_setcolor(struct intelfb_info *dinfo, u32 bg, u32 fg) in intelfbhw_cursor_setcolor() argument
1958 void intelfbhw_cursor_load(struct intelfb_info *dinfo, int width, int height, in intelfbhw_cursor_load() argument
1961 u8 __iomem *addr = (u8 __iomem *)dinfo->cursor.virtual; in intelfbhw_cursor_load()
1969 if (!dinfo->cursor.virtual) in intelfbhw_cursor_load()
1987 void intelfbhw_cursor_reset(struct intelfb_info *dinfo) in intelfbhw_cursor_reset() argument
1989 u8 __iomem *addr = (u8 __iomem *)dinfo->cursor.virtual; in intelfbhw_cursor_reset()
1996 if (!dinfo->cursor.virtual) in intelfbhw_cursor_reset()
2011 struct intelfb_info *dinfo = dev_id; in intelfbhw_irq() local
2013 spin_lock(&dinfo->int_lock); in intelfbhw_irq()
2016 if (dinfo->info->var.vmode & FB_VMODE_INTERLACED) in intelfbhw_irq()
2022 spin_unlock(&dinfo->int_lock); in intelfbhw_irq()
2030 if (dinfo->vsync.pan_display) { in intelfbhw_irq()
2031 dinfo->vsync.pan_display = 0; in intelfbhw_irq()
2032 OUTREG(DSPABASE, dinfo->vsync.pan_offset); in intelfbhw_irq()
2035 dinfo->vsync.count++; in intelfbhw_irq()
2036 wake_up_interruptible(&dinfo->vsync.wait); in intelfbhw_irq()
2038 spin_unlock(&dinfo->int_lock); in intelfbhw_irq()
2043 int intelfbhw_enable_irq(struct intelfb_info *dinfo) in intelfbhw_enable_irq() argument
2046 if (!test_and_set_bit(0, &dinfo->irq_flags)) { in intelfbhw_enable_irq()
2047 if (request_irq(dinfo->pdev->irq, intelfbhw_irq, IRQF_SHARED, in intelfbhw_enable_irq()
2048 "intelfb", dinfo)) { in intelfbhw_enable_irq()
2049 clear_bit(0, &dinfo->irq_flags); in intelfbhw_enable_irq()
2053 spin_lock_irq(&dinfo->int_lock); in intelfbhw_enable_irq()
2057 spin_lock_irq(&dinfo->int_lock); in intelfbhw_enable_irq()
2059 if (dinfo->info->var.vmode & FB_VMODE_INTERLACED) in intelfbhw_enable_irq()
2068 spin_unlock_irq(&dinfo->int_lock); in intelfbhw_enable_irq()
2072 void intelfbhw_disable_irq(struct intelfb_info *dinfo) in intelfbhw_disable_irq() argument
2074 if (test_and_clear_bit(0, &dinfo->irq_flags)) { in intelfbhw_disable_irq()
2075 if (dinfo->vsync.pan_display) { in intelfbhw_disable_irq()
2076 dinfo->vsync.pan_display = 0; in intelfbhw_disable_irq()
2077 OUTREG(DSPABASE, dinfo->vsync.pan_offset); in intelfbhw_disable_irq()
2079 spin_lock_irq(&dinfo->int_lock); in intelfbhw_disable_irq()
2085 spin_unlock_irq(&dinfo->int_lock); in intelfbhw_disable_irq()
2087 free_irq(dinfo->pdev->irq, dinfo); in intelfbhw_disable_irq()
2091 int intelfbhw_wait_for_vsync(struct intelfb_info *dinfo, u32 pipe) in intelfbhw_wait_for_vsync() argument
2099 vsync = &dinfo->vsync; in intelfbhw_wait_for_vsync()
2105 ret = intelfbhw_enable_irq(dinfo); in intelfbhw_wait_for_vsync()