Which one to choose between "drm_display_mode" and "display_timing" structures in "panel-simple.c"

Hello everyone

In the panel-simple.c linux display driver (drivers/gpu/drm/panel/panel-simple.c) there are two structures that can be used to descrive the display features. These structures are:

  • drm_display_mode
  • display_timing

Can be used only one of the two, is it right?. My question is: when choose drm_display_mode and when choose display_timing?

Thanks

I see you’ve already posted on ST’s forum: Display customization - STMicroelectronics Community

struct panel_desc {
	/**
	 * @modes: Pointer to array of fixed modes appropriate for this panel.
	 *
	 * If only one mode then this can just be the address of the mode.
	 * NOTE: cannot be used with "timings" and also if this is specified
	 * then you cannot override the mode in the device tree.
	 */
	const struct drm_display_mode *modes;

	/** @num_modes: Number of elements in modes array. */
	unsigned int num_modes;

	/**
	 * @timings: Pointer to array of display timings
	 *
	 * NOTE: cannot be used with "modes" and also these will be used to
	 * validate a device tree override if one is present.
	 */
	const struct display_timing *timings;

using drm_display_mode is usually a fixed mode, by using display_timing this allows you to force your own special override values in the device-tree… (drm_display_mode = fixed, display_timing = usually defined as a range)…

Regards,

Hello @RobertCNelson.
Using the “display_timing” structure, is it mandatory to use the override values in the own devicetree?
Thanks

Unless your device tree uses a compatible LCD with defined settings already in simple panel driver… you’d need to specify them directly…

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/display/panel/display-timings.yaml?h=v6.4-rc7

Hello @RobertCNelson
In the example of the link you indicate me, the maximum, minimum and typical values ​​are defined for some parameters of the timing0 and timing1 structures. I thought that the override values in the devicetree must be a single value for each parameter. By putting more values for a single parameter, what does the system use?
Thanks

It depends on your hardware, you’ll find on many LCD’s datasheet a min, avg, and max values for many of the settings…

Regards,

Ok, many thanks.