videomode.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de>
  3. *
  4. * generic videomode description
  5. *
  6. * This file is released under the GPLv2
  7. */
  8. #ifndef __LINUX_VIDEOMODE_H
  9. #define __LINUX_VIDEOMODE_H
  10. #include <linux/types.h>
  11. #include <video/display_timing.h>
  12. /*
  13. * Subsystem independent description of a videomode.
  14. * Can be generated from struct display_timing.
  15. */
  16. struct videomode {
  17. unsigned long pixelclock; /* pixelclock in Hz */
  18. u32 hactive;
  19. u32 hfront_porch;
  20. u32 hback_porch;
  21. u32 hsync_len;
  22. u32 vactive;
  23. u32 vfront_porch;
  24. u32 vback_porch;
  25. u32 vsync_len;
  26. enum display_flags flags; /* display flags */
  27. };
  28. /**
  29. * videomode_from_timing - convert display timing to videomode
  30. * @dt: display_timing structure
  31. * @vm: return value
  32. *
  33. * DESCRIPTION:
  34. * This function converts a struct display_timing to a struct videomode.
  35. */
  36. void videomode_from_timing(const struct display_timing *dt,
  37. struct videomode *vm);
  38. /**
  39. * videomode_from_timings - convert one display timings entry to videomode
  40. * @disp: structure with all possible timing entries
  41. * @vm: return value
  42. * @index: index into the list of display timings in devicetree
  43. *
  44. * DESCRIPTION:
  45. * This function converts one struct display_timing entry to a struct videomode.
  46. */
  47. int videomode_from_timings(const struct display_timings *disp,
  48. struct videomode *vm, unsigned int index);
  49. #endif