Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp1344708iof; Tue, 7 Jun 2022 03:52:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkI+n9y7kZCLoetC/lfY2AqDU6GzAmbfS1tv/bqESnbJMt8i3eRuhjLNXMd2Fjt2igTR2n X-Received: by 2002:a63:3ce:0:b0:3fc:6a52:8668 with SMTP id 197-20020a6303ce000000b003fc6a528668mr25193037pgd.424.1654599137185; Tue, 07 Jun 2022 03:52:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654599137; cv=none; d=google.com; s=arc-20160816; b=ePkpW4+4rs70XrkNDV1BU51OLFh3KEZIXmFG48yEmvnyf6tZcmg59ktDysKLtczD8v Tynq7OtDpT9KwF0YfdS3HkW5OBW5KMgzt3hdvswETmCXxmxAKAxOw3GvMcUkfbAZ5GsB esG6uQxkatsWHUXB8t8FAUb0zRh/uComhQWuHIztiNE4EJKl1SAMexC3aE7l7CQPoZM+ yBuh3E+rNffO8GTa7mpxzlHcYEDuUA88jnkb3Bp5+GIV9fT96/Zmb1AMCd72XZr62cfq 360W+pQ3VsatiXAAlem0pBxwft2erhPC/ZXu3fhpVLC5IziFyhO8UOzMUoetGCF0cNAk GRPw== 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=bTcKUvKBFqx0lJtGawmW30NCfuDMQMt7XlkJoMiwP40=; b=O0KAXf7pN96FqgtgTlFJyyaXEEp1In0s4Q0ixZeLd/XmgHyI40hY47rQD9vK3qH1LW EDblonIbcAS0TBti2p8YXSVMAWZ5u0txL1VJhZxqpoDJkTm//UzMQV/13YhAs3QTuqF1 1U9L5JRMWGTYvhrZLWvtnNqO8YOSsb9R5a5bu1ZXrKUMzopdkh4KPcXIjb8BvGaDaLj0 IzgMJMfOhbGt3073i6QoNjr2y6L549A9T+dFXsReFugLfoRtmAe3N24bbl3+voDchThO J9Gzw7JKTvPlB1D89bdEekAvA9smJJWKAjjnUJJjHiQo8Jd66M6xlLT57FYDF9XVKbpI RnOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=BRcrqvdc; 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 t20-20020a635f14000000b003ab0604a0c9si23402907pgb.561.2022.06.07.03.52.05; Tue, 07 Jun 2022 03:52:17 -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=BRcrqvdc; 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 S237962AbiFGHyD (ORCPT + 99 others); Tue, 7 Jun 2022 03:54:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237960AbiFGHyB (ORCPT ); Tue, 7 Jun 2022 03:54:01 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24C93C9676 for ; Tue, 7 Jun 2022 00:53:59 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id 25so21576795edw.8 for ; Tue, 07 Jun 2022 00:53:59 -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=bTcKUvKBFqx0lJtGawmW30NCfuDMQMt7XlkJoMiwP40=; b=BRcrqvdcJ8xhPPgG0bBbVBAiVx5+b1kxVRYTF+auAqOwaNxiSEJIGoWo2Vw1NSQv+g m+QFnkk9OCc0qPYzLEDDAl6JIeZKI2nmJ3WKE52P77RWJopLhG0nlii3OGBErGC4aljv V5z+8qwkVzCJGQbsGoFZmWoLE7owrtk67FYI4= 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=bTcKUvKBFqx0lJtGawmW30NCfuDMQMt7XlkJoMiwP40=; b=29joBEGgK+Z44EsQvkN8nvSkyKVqHSHNTpSrtCo9ryF7pwhETEMbVbOJxe/4dps7ka QvWwKw4Ec+HZZdvOY9zS995KK+A4lkz6ApAhL/Qz/UuQ9S6YnAkSNP3wuOrk03GyJ8mW kx21v49V4cb61JsAJrRuf1uhSqjHkcEo+0PSDSntN4qTind+vtpeEGPzYbEYFoJyE4KU B9G5776s9JNvK6ODim8aWWcuTCEt3K8XoJMSPJtDjA3S7DXBlUxZ9R0qR6qDx9zxyJe8 +pZXPyDC9hQl56Z1cPV+PSdJE6fzKTwg40p3Lk5zc3tBTup5PHFHgtceJYlM/QMCBmZ0 qR/w== X-Gm-Message-State: AOAM532Rd5yP6Qnxie8VghJjmB8Mm/v5ZAUlOM0yHeg0UIKOQ9RH1TaC Wkwa792+FMxFkYh5EDu1oV/R435emk1k07Wvz5PwSg== X-Received: by 2002:a05:6402:1941:b0:413:2b5f:9074 with SMTP id f1-20020a056402194100b004132b5f9074mr32019311edz.414.1654588437586; Tue, 07 Jun 2022 00:53:57 -0700 (PDT) MIME-Version: 1.0 References: <20220606152431.1889185-1-hsinyi@chromium.org> <20220606152431.1889185-2-hsinyi@chromium.org> In-Reply-To: From: Hsin-Yi Wang Date: Tue, 7 Jun 2022 15:53:31 +0800 Message-ID: Subject: Re: [PATCH v4 1/8] drm/panel: Add an API drm_panel_get_orientation() to return panel orientation 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:06 AM Stephen Boyd wrote: > > Quoting Hsin-Yi Wang (2022-06-06 08:24:24) > > diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c > > index f634371c717a..e12056cfeca8 100644 > > --- a/drivers/gpu/drm/drm_panel.c > > +++ b/drivers/gpu/drm/drm_panel.c > > @@ -223,6 +223,15 @@ int drm_panel_get_modes(struct drm_panel *panel, > > } > > EXPORT_SYMBOL(drm_panel_get_modes); > > > > +enum drm_panel_orientation drm_panel_get_orientation(struct drm_panel *panel) > > Should 'panel' be marked const to indicate that it can't be modified? > But .get_orientation() will need to call to_XXX_panel, eg. static inline struct boe_panel *to_boe_panel(struct drm_panel *panel) ==> .get_modes(panel) <-- can't be const. ==> drm_panel_get_orientation(panel) <-- can't be const. We can definitely cast it in the functions, or make to_XXX_panel() accept const, but I think this will lose the meaning of using const anyway. > > +{ > > + if (panel && panel->funcs && panel->funcs->get_orientation) > > + return panel->funcs->get_orientation(panel);