videomode.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. unsigned int dmt_flags; /* VESA DMT flags */
  27. unsigned int data_flags; /* video data flags */
  28. };
  29. /**
  30. * videomode_from_timing - convert display timing to videomode
  31. * @disp: structure with all possible timing entries
  32. * @vm: return value
  33. * @index: index into the list of display timings in devicetree
  34. *
  35. * DESCRIPTION:
  36. * This function converts a struct display_timing to a struct videomode.
  37. */
  38. int videomode_from_timing(const struct display_timings *disp,
  39. struct videomode *vm, unsigned int index);
  40. #endif