fbdev.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. *
  3. * Copyright © 1999 Keith Packard
  4. *
  5. * Permission to use, copy, modify, distribute, and sell this software and its
  6. * documentation for any purpose is hereby granted without fee, provided that
  7. * the above copyright notice appear in all copies and that both that
  8. * copyright notice and this permission notice appear in supporting
  9. * documentation, and that the name of Keith Packard not be used in
  10. * advertising or publicity pertaining to distribution of the software without
  11. * specific, written prior permission. Keith Packard makes no
  12. * representations about the suitability of this software for any purpose. It
  13. * is provided "as is" without express or implied warranty.
  14. *
  15. * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  16. * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  17. * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  18. * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  19. * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  20. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  21. * PERFORMANCE OF THIS SOFTWARE.
  22. */
  23. #ifndef _FBDEV_H_
  24. #define _FBDEV_H_
  25. #include <stdio.h>
  26. #include <linux/fb.h>
  27. #include <unistd.h>
  28. #include <sys/mman.h>
  29. #include "kdrive.h"
  30. #include "randrstr.h"
  31. typedef struct _fbdevPriv {
  32. struct fb_var_screeninfo var;
  33. struct fb_fix_screeninfo fix;
  34. __u16 red[256];
  35. __u16 green[256];
  36. __u16 blue[256];
  37. int fd;
  38. char *fb;
  39. char *fb_base;
  40. } FbdevPriv;
  41. typedef struct _fbdevScrPriv {
  42. Rotation randr;
  43. Bool shadow;
  44. } FbdevScrPriv;
  45. extern const char *fbdevDevicePath;
  46. Bool fbdevCardInit(KdCardInfo * card);
  47. Bool fbdevScreenInit(KdScreenInfo * screen);
  48. Bool fbdevInitScreen(ScreenPtr pScreen);
  49. Bool fbdevFinishInitScreen(ScreenPtr pScreen);
  50. Bool fbdevCreateResources(ScreenPtr pScreen);
  51. void fbdevPreserve(KdCardInfo * card);
  52. Bool fbdevEnable(ScreenPtr pScreen);
  53. Bool fbdevDPMS(ScreenPtr pScreen, int mode);
  54. void fbdevDisable(ScreenPtr pScreen);
  55. void fbdevRestore(KdCardInfo * card);
  56. void fbdevScreenFini(KdScreenInfo * screen);
  57. void fbdevCardFini(KdCardInfo * card);
  58. void fbdevGetColors(ScreenPtr pScreen, int n, xColorItem * pdefs);
  59. void fbdevPutColors(ScreenPtr pScreen, int n, xColorItem * pdefs);
  60. #endif /* _FBDEV_H_ */