drm/modes: Make width-mm/height-mm check in of_get_drm_panel_display_mode() mandatory
Subsystems (4)
PATCH 1/2 drm/modes: Make width-mm/height-mm check in of_get_drm_panel_display_mode() mandatory
All users of this function require width-mm/height-mm DT property to be present per their DT bindings, make width-mm/height-mm check mandatory. It is generally a good idea to specify panel dimensions, so userspace can configure e.g. scaling accordingly.
--- drivers/gpu/drm/drm_modes.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_modes.c +4 -4
@@ -735,8 +735,8 @@ EXPORT_SYMBOL_GPL(of_get_drm_display_mode);* @dmode: will be set to the return value * @bus_flags: information about pixelclk, sync and DE polarity * -* The Device Tree properties width-mm and height-mm will be read and set on -* the display mode if they are present. +* The mandatory Device Tree properties width-mm and height-mm +* are read and set on the display mode. * * Returns: * Zero on success, negative error code on failure.
@@ -761,11 +761,11 @@ int of_get_drm_panel_display_mode(struct device_node *np,drm_bus_flags_from_videomode (&vm, bus_flags); ret =of_property_read_u32 (np,"width-mm" , &width_mm); -if (ret && ret != -EINVAL ) +if (ret)return ret; ret =of_property_read_u32 (np,"height-mm" , &height_mm); -if (ret && ret != -EINVAL ) +if (ret)return ret; dmode->width_mm = width_mm;
Signature · 1 line
2.35.1
PATCH 2/2 drm/panel: lvds: Drop now redundant width-mm and height-mm check
The check for mandatory DT properties width-mm and height-mm is now part of of_get_drm_panel_display_mode(), drop the redundant check from this driver.
--- drivers/gpu/drm/panel/panel-lvds.c | 12 ------------ 1 file changed, 12 deletions(-)
drivers/gpu/drm/panel/panel-lvds.c +0 -12
@@ -128,18 +128,6 @@ static int panel_lvds_parse_dt(struct panel_lvds *lvds)return ret; } -if (lvds->dmode.width_mm ==0 ) { -dev_err (lvds->dev,"%pOF: invalid or missing %s DT property\n" , - np,"width-mm" ); -return -ENODEV ; - } - -if (lvds->dmode.height_mm ==0 ) { -dev_err (lvds->dev,"%pOF: invalid or missing %s DT property\n" , - np,"height-mm" ); -return -ENODEV ; - } -of_property_read_string (np,"label" , &lvds->label); ret =drm_of_lvds_get_data_mapping (np);
Signature · 1 line
2.35.1
Re: [PATCH 2/2] drm/panel: lvds: Drop now redundant width-mm and height-mm check
Den 11.04.2022 02.47, skrev Marek Vasut:
Quoted 14 lines
The check for mandatory DT properties width-mm and height-mm is now part of
of_get_drm_panel_display_mode(), drop the redundant check from this driver.Signed-off-by Marek Vasut <[email protected]>Cc Christoph Niedermaier <[email protected]>Cc Daniel Vetter <[email protected]>Cc Dmitry Osipenko <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Noralf Trønnes <[email protected]>Cc Rob Herring <[email protected]>Cc Robert Foss <[email protected]>Cc Sam Ravnborg <[email protected]>Cc Thomas Zimmermann <[email protected]>
Quoted 2 lines
To: [email protected]
---
Den 11.04.2022 02.47, skrev Marek Vasut:
Quoted 15 lines
All users of this function require width-mm/height-mm DT property to be present per their DT bindings, make width-mm/height-mm check mandatory. It is generally a good idea to specify panel dimensions, so userspace can configure e.g. scaling accordingly.
Signed-off-by Marek Vasut <[email protected]>Cc Christoph Niedermaier <[email protected]>Cc Daniel Vetter <[email protected]>Cc Dmitry Osipenko <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Noralf Trønnes <[email protected]>Cc Rob Herring <[email protected]>Cc Robert Foss <[email protected]>Cc Sam Ravnborg <[email protected]>Cc Thomas Zimmermann <[email protected]>
Quoted 2 lines
To: [email protected]
---
Quoted 4 lines · Marek Vasut
All users of this function require width-mm/height-mm DT property to be present per their DT bindings, make width-mm/height-mm check mandatory. It is generally a good idea to specify panel dimensions, so userspace can configure e.g. scaling accordingly.
I will apply these two patches soon.