Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2131204iof; Tue, 7 Jun 2022 20:47:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsyELJWsrki+VOinAZxNHT4od/FxQML9iCB3vuX8pREldPUtKGgRCiwsqhO2W/Wmt9lqtS X-Received: by 2002:a17:902:7783:b0:167:8245:ea04 with SMTP id o3-20020a170902778300b001678245ea04mr12155519pll.95.1654660029314; Tue, 07 Jun 2022 20:47:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654660029; cv=none; d=google.com; s=arc-20160816; b=yijTZ/p9MpGpfSxMCANYmXwtTFPRYbBFWsl9yGHlpO5Ex7dgHZ7rwJvqHAiUFxT6y6 HOt5KcVawDBrfdp88I4n5bMu/1oArBM9xXSOMl/F2IBnQtzE3JPvAswRdMfno2XPhcNB IFLwjcuc1m1s1lgi5Iyr7CGg+QpMYBbd0jCyiFL3fl3gVsKaXjX98D0tqN26H58P2kQk O6/IJAmQhjJt1JiRm9jzUb7YCuTIz5brJuqScA1bHaeXjgXkGVnegGPwp0DdkIuo5gzY UQlcuonhSDWvOCvVeyPXwJFQSTZ27r57vGxATFWpFdlwXvFaUtlOS5B4rQjjPiXewSbE kJ6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=+rF3WnKoDiq9d0J5JTo2dbHB29qndpGa9NLM7gHMjks=; b=Brz31HONY9Rujbwvo4vv3Pze9DDMLIycjQo1K255dD965k5zdQck9IsO/8INITowNS 8kKvWnxvPqcavhZnlXFYGH3XTpM0tngvY3irbEM9YRYTzVMtwX7HC/spQHrWBc2OUEqA uZJye9/5ft7RFqW9iBPahZwrpyJI3jBpFmUK+jAi2zTwpb2YB2TFJxMv2AA7vdBGJkf1 0fle9JATn4taTlhEE5VoJXmnCJb7askqOt4a2an3ZfesvDp8iLdwFlUxYhbYrv1w8Ikk uS7T+Vv/iN/GfzSz9BlSSHob/O6Iu1tJUffzX5Sq5tSavVLu5i2Wj98dPPp0ElzMHQhm jSaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dOTd7bOs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d20-20020a056a0010d400b0050d6ea9b033si28170473pfu.225.2022.06.07.20.47.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 20:47:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dOTd7bOs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0010D356872; Tue, 7 Jun 2022 20:07:25 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236456AbiFGDzQ (ORCPT + 99 others); Mon, 6 Jun 2022 23:55:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231979AbiFGDzN (ORCPT ); Mon, 6 Jun 2022 23:55:13 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E536C8BE0 for ; Mon, 6 Jun 2022 20:55:11 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id b8so4588834edj.11 for ; Mon, 06 Jun 2022 20:55:11 -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=+rF3WnKoDiq9d0J5JTo2dbHB29qndpGa9NLM7gHMjks=; b=dOTd7bOssfnug98baEiau/IHu9iQgmO17eKfDY/Bah2lZ9CfdHsZQVDOuAxtfFOjt6 OfMgThkcO291HJnaSUEMg8Th8FQnPhCGiKp27GaI/cmwZ2T3IA2Pv/VH1MCx4C5srtdM KSQa6JTtjCr3JKGym2k92cRDgRRlctuhUe8L8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+rF3WnKoDiq9d0J5JTo2dbHB29qndpGa9NLM7gHMjks=; b=dg43O4x0+GqaUDqopQpVD3KBNwy1lhMqJVB3KvLkm5bp5goHu+2byhEr5ZoENWjYUs 5rZCHS30lUG+Rk1+XzR5/+71EZiKOhAXM7bkvBUhVROSREuFsE6tnA1hV2ivBrylROo5 MMcYjTj3UnDkR3D0gRvkxrzEKkI2vvL6Ld3huqnBEpFwMSX0x0Oju5jmOlvyXVPAqbjP 8BPAg4ROpVrM33twtkgKDg21U6Nkpu0im/WQCFW5WxGuYNZePvwJC0s1SkSopXc5yxuA XxffUHZStOqNXyDuslZkBC0hwCa3kOeFui7ue/8rPCfW53dv50ADMxuIDATPFRhSx+PP KQLA== X-Gm-Message-State: AOAM53114qoe3SsPFgFLc0uaChwAs3P9jP7391bQNh/RGiCcKP3EcgL5 w12lgL6/ttzLzzzga1UMYWxYaPeJ6jJzIkCpFV3Czg== X-Received: by 2002:a05:6402:84a:b0:423:fe99:8c53 with SMTP id b10-20020a056402084a00b00423fe998c53mr30452834edz.195.1654574109792; Mon, 06 Jun 2022 20:55:09 -0700 (PDT) MIME-Version: 1.0 References: <20220606152431.1889185-1-hsinyi@chromium.org> <20220606152431.1889185-6-hsinyi@chromium.org> In-Reply-To: From: Hsin-Yi Wang Date: Tue, 7 Jun 2022 11:54:43 +0800 Message-ID: Subject: Re: [PATCH v4 5/8] drm/panel: panel-simple: Implement .get_orientation callback To: Sam Ravnborg Cc: Chun-Kuang Hu , Hans de Goede , Thierry Reding , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Rob Clark , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 7, 2022 at 3:25 AM Sam Ravnborg wrote: > > Hi Hsin-Yi, > > On Mon, Jun 06, 2022 at 11:24:28PM +0800, Hsin-Yi Wang wrote: > > To return the orientation property to drm/kms driver. > > > > Signed-off-by: Hsin-Yi Wang > > Reviewed-by: Hans de Goede > > Reviewed-by: Douglas Anderson > > --- > > drivers/gpu/drm/panel/panel-simple.c | 16 +++++++++++++++- > > 1 file changed, 15 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c > > index 4a2e580a2f7b..f232b8cf4075 100644 > > --- a/drivers/gpu/drm/panel/panel-simple.c > > +++ b/drivers/gpu/drm/panel/panel-simple.c > > @@ -411,7 +411,12 @@ static int panel_simple_get_modes(struct drm_panel *panel, > > /* add hard-coded panel modes */ > > num += panel_simple_get_non_edid_modes(p, connector); > > > > - /* set up connector's "panel orientation" property */ > > + /* > > + * drm drivers are expected to call drm_panel_get_orientation() to get > > + * panel's orientation then drm_connector_set_panel_orientation() to > > + * set the property before drm_dev_register(). Otherwise there will be > > + * a WARN_ON if orientation is set after drm is registered. > > + */ > > This comment is not really relevant here. If we need to explain this > then put it in drm_panel.c/h - as this applies for all panels and not > just the panel_simple. > Keep in mind, this is the source new panels often use a inspiration and > no need to have this copied around. > Will update this. > > drm_connector_set_panel_orientation(connector, p->orientation); > > > > return num; > > @@ -434,6 +439,14 @@ static int panel_simple_get_timings(struct drm_panel *panel, > > return p->desc->num_timings; > > } > > > > +static enum drm_panel_orientation panel_simple_get_orientation(struct drm_panel *panel) > > +{ > > + struct panel_simple *p = to_panel_simple(panel); > > + > > + return p->orientation; > > +} > > + > > + > > static const struct drm_panel_funcs panel_simple_funcs = { > > .disable = panel_simple_disable, > > .unprepare = panel_simple_unprepare, > > @@ -441,6 +454,7 @@ static const struct drm_panel_funcs panel_simple_funcs = { > > .enable = panel_simple_enable, > > .get_modes = panel_simple_get_modes, > > .get_timings = panel_simple_get_timings, > > + .get_orientation = panel_simple_get_orientation, > > I like the order in this list to match the order in the .h file. > So my OCD would like you to move it up right after get_modes, > but feel free to ignore this. > Sure. > With the suggested changes: > Reviewed-by: Sam Ravnborg > > > }; > > > > static struct panel_desc panel_dpi; > > -- > > 2.36.1.255.ge46751e96f-goog