Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp569000iof; Mon, 6 Jun 2022 08:39:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4vwbSE/UMrempuSxzePVBRw8OBetzalKNvcVVDLb8mXh/6jp5xCLp/0fdBh+qH/wz9X9j X-Received: by 2002:a17:90b:287:b0:1e3:45c9:9a93 with SMTP id az7-20020a17090b028700b001e345c99a93mr27737676pjb.80.1654529980076; Mon, 06 Jun 2022 08:39:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654529980; cv=none; d=google.com; s=arc-20160816; b=FH7Du4etrL/bidf5/b63Fnh/4l9IT5/pa7ECM9QBcLL25grGuGW9FbKuiiQ2yzFRGL MCAxYeDyY4Ojk9mvp1bYBjwz2pqzUuQTMtKvZfa/LVSPauU+hkr5oahzVlqgUE4HI138 gyfcKM5TNDhw1opFWEKkXFey7yG8TfPdT2Im+iL17zGqeNUVZeLVcAsT4KoCQpQPnWT6 QVc9nCbjfX8Bhm/EZTLgUkjShUuK6xuyrzyTR7iARYLqmUP6Qm3dBZBkRl6xjWyrZeXr lerzRoAHIM6KEpmB43mICiQ4rw30na5Or8k6C8YWoZ1q9GANsNigt58qqNBT+KaN+RTQ UuPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NhoEcPNDHmfOm0zH51yFx0TR/S9SyI37TTBudlPfFt8=; b=AQ9o/1sIgX3qRYi/cXLZP3AE97nJxCKP56VFfResMJYh8Twkj1cwaOyYOblTZmZpi6 vlCexDdMP1e4bn3JZVVCfpj0oVN+DQs7IsWzBxACaku5RchPetStEtcCN43GbCEtEApw Pe4Ag65eRlnpWeBRcvkuNsHX7+eYyZNOYC9fTuqH6upZMgXZzH0qBYsT7pirAQ9s9b7l 0ZKXHYQlhqK7LTl0UqR1pThZ4HBVnoandq9Pt6v8MWdVbmKkoeHPtE0O/UWC3PP+nEDp TmznIHrFjLc34IyE4kgPZ+fYFL8gQQZlsNghAn1+OKa1lryGbG9nbqZKfuWWqA5IP8eQ nTnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bLmVV9G8; 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 z9-20020a170902ccc900b0016413dbc6a4si22071268ple.429.2022.06.06.08.39.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 08:39:40 -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=bLmVV9G8; 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 A73FC3202FA; Mon, 6 Jun 2022 08:25:30 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240564AbiFFPZG (ORCPT + 99 others); Mon, 6 Jun 2022 11:25:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240520AbiFFPYu (ORCPT ); Mon, 6 Jun 2022 11:24:50 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FEF12BE09B for ; Mon, 6 Jun 2022 08:24:48 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id w13-20020a17090a780d00b001e8961b355dso949473pjk.5 for ; Mon, 06 Jun 2022 08:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NhoEcPNDHmfOm0zH51yFx0TR/S9SyI37TTBudlPfFt8=; b=bLmVV9G8nxZ0DbEYeB04GCYrVF2yXJrTwxLlXkwIBhzX21qKiBs6l8Dwx7L84vs3+B twAgdvwouWoMicxROrFcPiYDyKUdr556My/cs1kZ3Wg12HmivoQ1fmW6YwiVviprIKCC SbKLVBBE9VUMN6dWFdzXWoIC8MuBLA5+G1v8M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NhoEcPNDHmfOm0zH51yFx0TR/S9SyI37TTBudlPfFt8=; b=03tF/pspSge9K26dhzIQVBDUAmMWhBXZlBFTnFQ8lJPKwwh0NSeU2onKZOuJXzWVgl 0J151O6S58X5IW1mLZkl29HIAISZU/uBf4H56n2w4z31OFbcROYXsUBxNNNCCOQrvkhN zPOiKToN9z3MECQYWbykGVrK/rSbkRaoIlOH7X6PSSzDNlNXUW+xeFHv86S8dbq5EOQk 2ucdI04nVi0bhIWnkj8puxN8Eft0ByaukhXxzF5hp6P7wJHYnygMkVQ3WiwCQ4z8eD5u lMLA3/PHygyrw3ESO83kJ+rVFGuRqofe07yFdRIEndC1AQB6RV7LeQ+AnCBSD0AlSmYs Xq4g== X-Gm-Message-State: AOAM5322Zz0FLc7o1S7K3vU24R5E2eW1amcKDexR7Yfxg3kvBArvbNfZ XR3goTI5rOf9Y6tDouJeTl2iqQ== X-Received: by 2002:a17:902:7781:b0:161:c85a:8fff with SMTP id o1-20020a170902778100b00161c85a8fffmr24699866pll.97.1654529087820; Mon, 06 Jun 2022 08:24:47 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:a0a:5e4:e24:c8c4]) by smtp.gmail.com with ESMTPSA id h1-20020a655181000000b003fbaae74971sm10749306pgq.72.2022.06.06.08.24.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 08:24:47 -0700 (PDT) From: Hsin-Yi Wang To: Chun-Kuang Hu Cc: 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 , Stephen Boyd , Douglas Anderson , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 3/8] drm/panel: panel-edp: Implement .get_orientation callback Date: Mon, 6 Jun 2022 23:24:26 +0800 Message-Id: <20220606152431.1889185-4-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220606152431.1889185-1-hsinyi@chromium.org> References: <20220606152431.1889185-1-hsinyi@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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-edp.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c index c96014464355..c0a43bc7d24a 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -586,7 +586,12 @@ static int panel_edp_get_modes(struct drm_panel *panel, else if (!num) dev_warn(p->base.dev, "No display modes\n"); - /* 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. + */ drm_connector_set_panel_orientation(connector, p->orientation); return num; @@ -609,6 +614,13 @@ static int panel_edp_get_timings(struct drm_panel *panel, return p->desc->num_timings; } +static enum drm_panel_orientation panel_edp_get_orientation(struct drm_panel *panel) +{ + struct panel_edp *p = to_panel_edp(panel); + + return p->orientation; +} + static int detected_panel_show(struct seq_file *s, void *data) { struct drm_panel *panel = s->private; @@ -637,6 +649,7 @@ static const struct drm_panel_funcs panel_edp_funcs = { .prepare = panel_edp_prepare, .enable = panel_edp_enable, .get_modes = panel_edp_get_modes, + .get_orientation = panel_edp_get_orientation, .get_timings = panel_edp_get_timings, .debugfs_init = panel_edp_debugfs_init, }; -- 2.36.1.255.ge46751e96f-goog