Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp347249ybi; Thu, 13 Jun 2019 17:33:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxzM5qmDcnlsYd2pocH82uVLLqupNT+IAo2/So/p+Xf3Yf1ssH7fr9jqdz+qkwgyzEqGVUw X-Received: by 2002:a65:654f:: with SMTP id a15mr10448973pgw.73.1560472410629; Thu, 13 Jun 2019 17:33:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560472410; cv=none; d=google.com; s=arc-20160816; b=bTboxLILAA9oD2YDtMG3hUtqqwfevkqBs+jRHDhKmZNHYShp7SzjI0BBKe9Al3Jl2Q yFGZI/XOMMtuTlv86QHSKcmALWcfp0Bu1HtbVeEczPUTtPoNMvlh9nnOMIlSTrAecYuk 4G0MSwz9Jgr3ESim+FgiKKuUIMzdXXSIyY09SB/L0LPjjApVZDqfopqY5IyGQpjzPLwJ 5CYGm8q4plp8eUZUWfs4XhbKec93N6p+Z3g3IE8pU+eYMOFqw9gHJ40GOMLkoU4kw2zy JDozxxmX7doiTNyHfNp1nymzwsbCZHzQYJvl/7pVF6MbdZCQTPcjkUylP/4OBtRYWJzY aN6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=5o5a2UNvqnt2IqG/d30r1Z1PI+lkRFVIZCDDvP3GRa4=; b=05hvO9YjfrhXqJLkuBa1QekK9J9GU0bdEvJ+5UDWuCQ8GxxZj3hnCWXeqCTc9/ilAl 3zQm/rvxDscI9xhOFhlBaIHPg6eZeNjxU1qafZDufc04XACbM/0TUHPhecFmOJucdPXu wDHoPw7odhCwvatm+m9SkUW6kEfCv3d5oCi1MPI8I9YpzbVGaOoLq7gQzj0p1vUVd7P5 30IPVGmaNDuHwW3S+5+4L0banPvQoC5NDyJsNI6vqKE7gFBP7chIi9tQwZfzcE+2BHXQ 18sv6rEmRHkUBn7vhRvaT8jkvdXTCAfbj8bk6mapUV2NJw39azHXmTz/DWaU4FAV/ZKo +W1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QSPL5o2o; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si967611pgh.69.2019.06.13.17.33.15; Thu, 13 Jun 2019 17:33:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QSPL5o2o; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726740AbfFNAce (ORCPT + 99 others); Thu, 13 Jun 2019 20:32:34 -0400 Received: from mail-vs1-f66.google.com ([209.85.217.66]:43132 "EHLO mail-vs1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725835AbfFNAcd (ORCPT ); Thu, 13 Jun 2019 20:32:33 -0400 Received: by mail-vs1-f66.google.com with SMTP id j26so659984vsn.10 for ; Thu, 13 Jun 2019 17:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5o5a2UNvqnt2IqG/d30r1Z1PI+lkRFVIZCDDvP3GRa4=; b=QSPL5o2oBNVzptcEqAin35G0xLo0WWvgdOOO2+lJQerKfjKIYK/6oBSgxbDxGyOeXK xc1Z2RyR8khlsHj7h/56FHn401h/hL1ihSqJACQe/klR228W7RgTufBtib0cQQpfqY5/ S4NO2rnjTaZdsxN6OkMcnGXhGm9ft7LyISYAE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5o5a2UNvqnt2IqG/d30r1Z1PI+lkRFVIZCDDvP3GRa4=; b=Gg479Dkf8nlWCYFd7QlBmYPhAmWfCIFDGbTVL7ZKbry1JNpBtQ5b+t45NUGffNXuFh rK84Ul5VeGtsW/BbCz2c2BGFAaoIpFBaZb8rGSQZhFEgy3T+KCqZbIak46XMKGAFAAmb flqJ+5wY2f5imJxnJBjWxzgqFVMQVGRlEFJ4UpLQB+L7sGRor3jYh7kvOYjz32FspaEY fe6KOtNZa4yye96jUIPJQ9Zg7ilceqdkMzH6BJALhjiK4+ahx1UyPA2+bt5wgWTIwGJa jt8Ob3cLMsRagVnzjXWJMpeknncZ9GIU3ESniLxAicgLTJXnOutquNXdDGrIU2uC5FSN QgkQ== X-Gm-Message-State: APjAAAUZJ5qjhV79AxlQfjyWB2wCmUuKetqX+wdctOAQb9qy3hudqHXj ljEOwUUsxVQKEc2E0AKHYRQIhSpVHTNvusNVaqcInA== X-Received: by 2002:a67:d384:: with SMTP id b4mr18708468vsj.152.1560472352531; Thu, 13 Jun 2019 17:32:32 -0700 (PDT) MIME-Version: 1.0 References: <20190611040350.90064-1-dbasehore@chromium.org> <20190611040350.90064-2-dbasehore@chromium.org> <20190612212054.GB13155@ravnborg.org> In-Reply-To: <20190612212054.GB13155@ravnborg.org> From: "dbasehore ." Date: Thu, 13 Jun 2019 17:32:21 -0700 Message-ID: Subject: Re: [PATCH 1/5] drm/panel: Add helper for reading DT rotation To: Sam Ravnborg Cc: linux-kernel , Thierry Reding , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Maarten Lankhorst , Maxime Ripard , Sean Paul , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , CK Hu , Philipp Zabel , Matthias Brugger , dri-devel , devicetree@vger.kernel.org, Intel Graphics , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "moderated list:ARM/Mediatek SoC support" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 12, 2019 at 2:20 PM Sam Ravnborg wrote: > > Hi Derek. > > On Mon, Jun 10, 2019 at 09:03:46PM -0700, Derek Basehore wrote: > > This adds a helper function for reading the rotation (panel > > orientation) from the device tree. > > > > Signed-off-by: Derek Basehore > > --- > > drivers/gpu/drm/drm_panel.c | 41 +++++++++++++++++++++++++++++++++++++ > > include/drm/drm_panel.h | 7 +++++++ > > 2 files changed, 48 insertions(+) > > > > diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c > > index dbd5b873e8f2..3b689ce4a51a 100644 > > --- a/drivers/gpu/drm/drm_panel.c > > +++ b/drivers/gpu/drm/drm_panel.c > > @@ -172,6 +172,47 @@ struct drm_panel *of_drm_find_panel(const struct device_node *np) > > return ERR_PTR(-EPROBE_DEFER); > > } > > EXPORT_SYMBOL(of_drm_find_panel); > > + > > +/** > > + * of_drm_get_panel_orientation - look up the rotation of the panel using a > > + * device tree node > > + * @np: device tree node of the panel > > + * @orientation: orientation enum to be filled in > > + * > > + * Looks up the rotation of a panel in the device tree. The rotation in the > > + * device tree is counter clockwise. > > + * > > + * Return: 0 when a valid rotation value (0, 90, 180, or 270) is read or the > > + * rotation property doesn't exist. -EERROR otherwise. > > + */ > > +int of_drm_get_panel_orientation(const struct device_node *np, int *orientation) > > +{ > > + int rotation, ret; > > + > > + ret = of_property_read_u32(np, "rotation", &rotation); > > I just noticed that everywhere this code talks about orientation, > but the property that it reads are rotation. > To my best understanding these are not the same. This is because both were previously defined in the kernel. Rotation was defined as a binding in the devicetree for panels (which is where we wanted to put this property) and orientation already exists as a DRM property. If we want to change one, I would suggest the rotation binding since it doesn't have any upstream users yet. > > Sam