From mboxrd@z Thu Jan 1 00:00:00 1970 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 B0FC0C433EF for ; Fri, 1 Apr 2022 17:02:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C6B3D10E02B; Fri, 1 Apr 2022 17:02:13 +0000 (UTC) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9F33510E02B for ; Fri, 1 Apr 2022 17:02:12 +0000 (UTC) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 908902F7; Fri, 1 Apr 2022 19:02:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1648832530; bh=LGWLodHx28jd9verpae7ChrJT1fbqIVgWRUqV/RT+Qk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fUUIXowVKX915u/uLCBJ327EQZZ1fA5lOohKKjX/l6QLzicaioQ3B7Y9Zo6YqXDdL bYKeOZy7murJnzPMXtg7zk//Ft7s1mWdKr+xytGEzkeVjkVsfk6db9LkFBBE0TRaxY +Daqw8iOeODDZ2y7NJFmtQu4kqvHZIceit/ut2tA= Date: Fri, 1 Apr 2022 20:02:08 +0300 From: Laurent Pinchart To: Marek Vasut Subject: Re: [PATCH 1/2] drm/panel: lvds: Simplify mode parsing Message-ID: References: <20220331192347.103299-1-marex@denx.de> <66182d46-9270-1096-97b1-1cd635e0795e@denx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <66182d46-9270-1096-97b1-1cd635e0795e@denx.de> 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: Christoph Niedermaier , Daniel Vetter , robert.foss@linaro.org, dri-devel@lists.freedesktop.org, Thomas Zimmermann , Dmitry Osipenko , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, Apr 01, 2022 at 06:11:22PM +0200, Marek Vasut wrote: > On 4/1/22 17:48, Laurent Pinchart wrote: > > Hi, > > [...] > > >> diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c > >> index 27a1c9923b09..65c6a6e9e223 100644 > >> --- a/drivers/gpu/drm/panel/panel-lvds.c > >> +++ b/drivers/gpu/drm/panel/panel-lvds.c > >> @@ -30,7 +30,8 @@ struct panel_lvds { > >> const char *label; > >> unsigned int width; > >> unsigned int height; > >> - struct videomode video_mode; > >> + struct drm_display_mode dmode; > > > > "dmode" sounds a bit weird, I would have gone for just "mode", or > > "display_mode", but I don't mind much. > > That's how the of_get_drm_panel_display_mode() parameter is called in > drivers/gpu/drm/drm_modes.c , so I'll just keep it for consistency. > > [...] > > >> - videomode_from_timing(&timing, &lvds->video_mode); > >> - > >> - ret = of_property_read_u32(np, "width-mm", &lvds->width); > >> - if (ret < 0) { > >> - dev_err(lvds->dev, "%pOF: invalid or missing %s DT property\n", > >> - np, "width-mm"); > >> - return -ENODEV; > >> - } > >> - ret = of_property_read_u32(np, "height-mm", &lvds->height); > >> - if (ret < 0) { > >> - dev_err(lvds->dev, "%pOF: invalid or missing %s DT property\n", > >> - np, "height-mm"); > >> - return -ENODEV; > >> - } > > > > of_get_drm_panel_display_mode() doesn't consider missing width-mm or > > height-mm properties as an error. Should we check here that ->width_mm > > and ->height_mm are not 0 ? > > I wonder whether we should always require valid width-mm and height-mm > DT property in of_get_drm_panel_display_mode() instead. If that doesn't introduce any regression, that would be my preference too. > [...] -- Regards, Laurent Pinchart