From patchwork Mon Apr 11 00:47:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12808367 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A9D56C433F5 for ; Mon, 11 Apr 2022 00:47:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1FFC910E410; Mon, 11 Apr 2022 00:47:46 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0D5D810E410 for ; Mon, 11 Apr 2022 00:47:44 +0000 (UTC) Received: from tr.lan (ip-86-49-12-201.net.upcbroadband.cz [86.49.12.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 45F0583C90; Mon, 11 Apr 2022 02:47:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1649638062; bh=8UE3sCZ5ItLTXlIK2WJ/xtxkdmO/CEjKvLZ+7Rb660U=; h=From:To:Cc:Subject:Date:From; b=adrlOqIOc2FtVVk5mjnIwKcQ9z5SQLftYP68JPSudmSPuJHhCZ5lUeuneEepRql6V gq5VYtmBu52NMUptmNLpACiVtfl0Tf72J3ZBt26dI73Uf7Xm9INorXIraJcYjVxjoH RU0qc3fieKnYqG5q8F5d3xrjLQGONBQF+mhLF6jdQNn11+DjT6HbchhTD+A4jk5YZO OV9RicR1nejdzJfdVYZ3fbbO3L7ZvrO5cKg1wP+OG0VgCvcsALEbDar+wXusyFnxVs U+m0Gw3YMQris1IFiwE4ccJ7SrVS9fwlQuJBwrG9FUNnvdjsDRqQmYzc4QXPcGhg3O VSDtEkSAoweoQ== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/modes: Make width-mm/height-mm check in of_get_drm_panel_display_mode() mandatory Date: Mon, 11 Apr 2022 02:47:27 +0200 Message-Id: <20220411004728.68203-1-marex@denx.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Christoph Niedermaier , Daniel Vetter , robert.foss@linaro.org, Rob Herring , =?utf-8?q?Noralf_Tr=C3=B8nnes?= , Laurent Pinchart , Thomas Zimmermann , Dmitry Osipenko , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Cc: Christoph Niedermaier Cc: Daniel Vetter Cc: Dmitry Osipenko Cc: Laurent Pinchart Cc: Noralf Trønnes Cc: Rob Herring Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Reviewed-by: Noralf Trønnes --- drivers/gpu/drm/drm_modes.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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;