Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp1346137iof; Tue, 7 Jun 2022 03:54:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuz0M8sSZ5kYIg3Gq7gD6KZUw3D3uVoq3ja+HyCBUI37GgHlXNxs6NC8pNpuPhMv39Btih X-Received: by 2002:a05:6a00:1a03:b0:510:a1d9:7de0 with SMTP id g3-20020a056a001a0300b00510a1d97de0mr95337439pfv.53.1654599268526; Tue, 07 Jun 2022 03:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654599268; cv=none; d=google.com; s=arc-20160816; b=ZXJsp/rScL5jKyj+tZgWouTnqV1ADDGWzFVLBXtplgBf9G6RQwhEA+V6DIq9aerDJw fmCk1AjNRu/83VUuSzrB44dSz3GXVTOQAPtYgmLHYDrsCeah+mGV9kl3i6nxy2DBrPT1 0+dAifdetHd6ehDFLpwd6Lb9eAvPkLxFxbr7ZZNpo0ADi40Lf8HJayui6FGYz7A9iDdN 809+DAp32RokggpaO985GfF0CmD6mGIFcjTyBbpBrYTAcZJoDOAtQ4liyMm9cMz/lB/V 1gK9kDGRr1W9CTfkiBpHaJGQMAYOlOY7gM8SOpSZnVCrg4Sm24Yj9VRtepUHndTD9NgX JS3g== 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=lJ9t0JsMzf9+b8G+NsrCGuGZ2WHm7yJdraWRSfiKGkA=; b=Hw5UJZZ7JfXhXtf2a7BODe2DwZ3TsGimk/11uxih7TB88zeGdw2VpOunuTZrSah8+T ULzu2UkCxhixVuI3AmuTDyE+YfzSpil9TJLVx8KfoI9YFpupvNjTF6POse73n3VyPy2U rJIA9MEv7o5O5gRBFOoTfD3NCPmLo6zd30MVS0dhgs7Cyk3YDfGT6iqwS2uA/XP78si+ yrIuG9yk4BYhZJhragj3aO0HZcuJM5YW1lRIYKP9nSb14PAisOX0TXlRLKm3/5qzCMDp plosdL4Pwq4HkG4ZehmgtvLOUDOXb/2H8rSYieEdX9jR4ki6WWYo4dHCjjlZpOMOQYMQ jArQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=luqlEGHc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hk6-20020a17090b224600b001dfab05243bsi25286629pjb.181.2022.06.07.03.54.15; Tue, 07 Jun 2022 03:54:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=luqlEGHc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233573AbiFGDif (ORCPT + 99 others); Mon, 6 Jun 2022 23:38:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233296AbiFGDic (ORCPT ); Mon, 6 Jun 2022 23:38:32 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A551535DE5 for ; Mon, 6 Jun 2022 20:38:30 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id fu3so31088955ejc.7 for ; Mon, 06 Jun 2022 20:38:30 -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=lJ9t0JsMzf9+b8G+NsrCGuGZ2WHm7yJdraWRSfiKGkA=; b=luqlEGHcZ3EsuUaCVY6GMNpFf/WWxyuViWZVeRqUEErf9I9VtVM1lds0X9kadOzOJN cszTD9YoVUoRI7Y7blXJ11oo9McRcIKLzrEKA7N554p76iZLgY8Rd3ITfDBweQcSXSEp ZvIHkSGHIxEHuVqKNxRubd5d5H8shRx58lWHE= 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=lJ9t0JsMzf9+b8G+NsrCGuGZ2WHm7yJdraWRSfiKGkA=; b=7ox13zhroVbkdSeXr+LN9jzawv7DxpYgfEinAdmqUvVoQpDVUKCrW2ZeUOEBK654+l avUf3soxl18Kldsv84eMbpPamBkjZMW0LJlx6TFo9II/wOLgyVWjynqj70I7h0cGfDiD 1xO1THX68ehUz/YRENlJJWpA44AjPcS1buQLe594vpRvB9feMPcLzI137xFLtwQ73KEn u1pEzYaZfFdaivX5nZhJ6kl5AsAEUXpB2poBQw/j3rpKbE6N7xG24T2FiwDRvvwODo3R a4jAw9+FTq1tpKlUCM/YhPfzMMU5ooKBvdHlXydUVi2LjAE/27DLeSOgHpqOiGGskhda 0YXg== X-Gm-Message-State: AOAM5301RBEIcLwIp1WniwqYa2kXlrnvTwPNLyeCWoJKD5/2oH8FhWuD uWPT7KJWvEc6LpwCbSEz+iKDgnokBn5b9ydl8iK4/A== X-Received: by 2002:a17:907:868f:b0:702:f865:55de with SMTP id qa15-20020a170907868f00b00702f86555demr24650686ejc.24.1654573109183; Mon, 06 Jun 2022 20:38:29 -0700 (PDT) MIME-Version: 1.0 References: <20220606152431.1889185-1-hsinyi@chromium.org> <20220606152431.1889185-9-hsinyi@chromium.org> In-Reply-To: From: Hsin-Yi Wang Date: Tue, 7 Jun 2022 11:46:24 +0800 Message-ID: Subject: Re: [PATCH v4 8/8] drm/mediatek: Config orientation property if panel provides it To: Stephen Boyd Cc: Chun-Kuang Hu , Hans de Goede , Thierry Reding , Sam Ravnborg , 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 , 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.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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:16 AM Stephen Boyd wrote: > > Quoting Hsin-Yi Wang (2022-06-06 08:24:31) > > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c > > index d9f10a33e6fa..c56282412bfa 100644 > > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c > > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c > > @@ -822,6 +823,12 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi) > > ret = PTR_ERR(dsi->connector); > > goto err_cleanup_encoder; > > } > > + > > + /* Read panel orientation */ > > + if (dsi->panel) > > + drm_connector_set_panel_orientation(dsi->connector, > > + drm_panel_get_orientation(dsi->panel)); > > + > > It could be simplified like so? > > drm_connector_set_orientation_from_panel(dsi->connector, dsi->panel); > > Then the API could get the orientation if the panel pointer is valid. > Does any code need to use/modify the orientation value besides > drm_connector_set_panel_orientation()? > We can add another function to call drm_connector_set_orientation_from_panel(), which will be like void drm_connector_set_orientation_from_panel(connector, panel) { if (panel) drm_connector_set_panel_orientation(connector,drm_panel_get_orientation(panel)); } Though it's very should but I can add this if this can make the caller more convenient. > > drm_connector_attach_encoder(dsi->connector, &dsi->encoder); > > > > return 0;