diff mbox series

[1/2] drm/modes: Make width-mm/height-mm check in of_get_drm_panel_display_mode() mandatory

Message ID 20220411004728.68203-1-marex@denx.de (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/modes: Make width-mm/height-mm check in of_get_drm_panel_display_mode() mandatory | expand

Commit Message

Marek Vasut April 11, 2022, 12:47 a.m. UTC
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 <marex@denx.de>
Cc: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dmitry Osipenko <digetx@gmail.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Noralf Trønnes <noralf@tronnes.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Robert Foss <robert.foss@linaro.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
To: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/drm_modes.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Noralf Trønnes April 11, 2022, 4:41 p.m. UTC | #1
Den 11.04.2022 02.47, skrev 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.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Christoph Niedermaier <cniedermaier@dh-electronics.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Dmitry Osipenko <digetx@gmail.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Noralf Trønnes <noralf@tronnes.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Robert Foss <robert.foss@linaro.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> To: dri-devel@lists.freedesktop.org
> ---

Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Marek Vasut April 21, 2022, 9:15 p.m. UTC | #2
On 4/11/22 02:47, Marek Vasut wrote:
> 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.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 6e7e10f16ec03..f0b000ddaddb5 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -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;