videomode.h 1.3 KB

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