i810_main.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*-*- linux-c -*-
  2. * linux/drivers/video/i810fb_main.h -- Intel 810 frame buffer device
  3. * main header file
  4. *
  5. * Copyright (C) 2001 Antonino Daplas<adaplas@pol.net>
  6. * All Rights Reserved
  7. *
  8. *
  9. * This file is subject to the terms and conditions of the GNU General Public
  10. * License. See the file COPYING in the main directory of this archive for
  11. * more details.
  12. */
  13. #ifndef __I810_MAIN_H__
  14. #define __I810_MAIN_H__
  15. /* Video Timings */
  16. extern void round_off_xres (u32 *xres);
  17. extern void round_off_yres (u32 *xres, u32 *yres);
  18. extern u32 i810_get_watermark (const struct fb_var_screeninfo *var,
  19. struct i810fb_par *par);
  20. extern void i810fb_encode_registers(const struct fb_var_screeninfo *var,
  21. struct i810fb_par *par, u32 xres, u32 yres);
  22. extern void i810fb_fill_var_timings(struct fb_var_screeninfo *var);
  23. /* Accelerated Functions */
  24. extern void i810fb_fillrect (struct fb_info *p,
  25. const struct fb_fillrect *rect);
  26. extern void i810fb_copyarea (struct fb_info *p,
  27. const struct fb_copyarea *region);
  28. extern void i810fb_imageblit(struct fb_info *p, const struct fb_image *image);
  29. extern int i810fb_sync (struct fb_info *p);
  30. extern void i810fb_init_ringbuffer(struct fb_info *info);
  31. extern void i810fb_load_front (u32 offset, struct fb_info *info);
  32. #ifdef CONFIG_FB_I810_I2C
  33. /* I2C */
  34. extern int i810_probe_i2c_connector(struct fb_info *info, u8 **out_edid,
  35. int conn);
  36. extern void i810_create_i2c_busses(struct i810fb_par *par);
  37. extern void i810_delete_i2c_busses(struct i810fb_par *par);
  38. #else
  39. static inline int i810_probe_i2c_connector(struct fb_info *info, u8 **out_edid,
  40. int conn)
  41. {
  42. return 1;
  43. }
  44. static inline void i810_create_i2c_busses(struct i810fb_par *par) { }
  45. static inline void i810_delete_i2c_busses(struct i810fb_par *par) { }
  46. #endif
  47. /* Conditionals */
  48. #ifdef CONFIG_X86
  49. static inline void flush_cache(void)
  50. {
  51. asm volatile ("wbinvd":::"memory");
  52. }
  53. #else
  54. #define flush_cache() do { } while(0)
  55. #endif
  56. #ifdef CONFIG_MTRR
  57. #include <asm/mtrr.h>
  58. static inline void __devinit set_mtrr(struct i810fb_par *par)
  59. {
  60. par->mtrr_reg = mtrr_add((u32) par->aperture.physical,
  61. par->aperture.size, MTRR_TYPE_WRCOMB, 1);
  62. if (par->mtrr_reg < 0) {
  63. printk(KERN_ERR "set_mtrr: unable to set MTRR\n");
  64. return;
  65. }
  66. par->dev_flags |= HAS_MTRR;
  67. }
  68. static inline void unset_mtrr(struct i810fb_par *par)
  69. {
  70. if (par->dev_flags & HAS_MTRR)
  71. mtrr_del(par->mtrr_reg, (u32) par->aperture.physical,
  72. par->aperture.size);
  73. }
  74. #else
  75. #define set_mtrr(x) printk("set_mtrr: MTRR is disabled in the kernel\n")
  76. #define unset_mtrr(x) do { } while (0)
  77. #endif /* CONFIG_MTRR */
  78. #ifdef CONFIG_FB_I810_GTF
  79. #define IS_DVT (0)
  80. #else
  81. #define IS_DVT (1)
  82. #endif
  83. #endif /* __I810_MAIN_H__ */