Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp134165iof; Sun, 5 Jun 2022 23:22:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIzS20QL4PhuH3US1GGm7OyHEpRvMzlH/8nbEq80AG1ckA1XV/Xhlbaj/TC9HNdSamSS9H X-Received: by 2002:a65:67da:0:b0:3fc:6ca7:d58c with SMTP id b26-20020a6567da000000b003fc6ca7d58cmr19858150pgs.562.1654496571306; Sun, 05 Jun 2022 23:22:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654496571; cv=none; d=google.com; s=arc-20160816; b=OB6HcEZBowmgtmgfAI1DPRSpW4/+4upbFobjUDMgxVUO9voi4uoa6eBIoHUgHSQSdE +teAZ5FEx5I8VmE2Fzv0Ci/TwTkN2GJTFd5/vRSfr40dhL2tpcpe8szmTu2kgF2ku9dd d9I4BzLdGs0G7t/zqxA8994bGqJOIgTeOjocImffQUwWWiaiEuLfGN7dHcP3Wgo8Aqig fmsGYr3TW67tvdqQBzowD99Q/Y6QCj6AZnZSKL3/xa111x8hMtwbmqgzoQ1ZbeGd6l1R pEEd7BbNblQ3/SZhFACjSjHqmK2YmgUSUTomxVlGOA63EocKscub03cjstFqJouFEUrn P/QQ== 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=j5js470YBzKdTaXPl+QQ3rHxeotAooP4m8EcPovVk7E=; b=xnHLwXJVG6Q5xOLik1kzIQ1bOh+mlI1yed6nX+c5CydlftZQV77Pq0F50SnsZML6WK kjW9oZYWGqJv4wm2htkYWuwjHSDuNg1AYNXELOFZBQHcsHfU1izQtIj2F5H9F2V7svHp y2QAlaX3zuHyGJpZH4OxDU+IRGMYBniDPF7vxTK5RRjrwgazFJhOcxcJK4Vd1sReq1it Pxq2d+C4tZgZnUKxbE5qsnL9WBlPitCNnrd/tocmS/daAIULIiyvSzvm/Asw6s3Eo7gL 2CfIsg9n1e7NvPK2Rn2P01HgBw2YfoIpzuhFZIE5y4DhAtK4nYOa2S8Qna0GaBRirVp6 nlcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jsy7p+Ff; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id 193-20020a6301ca000000b003fd55608dccsi9835117pgb.192.2022.06.05.23.22.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 23:22:51 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jsy7p+Ff; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 E7D9E2A434; Sun, 5 Jun 2022 22:02:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229546AbiFFEuh (ORCPT + 99 others); Mon, 6 Jun 2022 00:50:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbiFFEu1 (ORCPT ); Mon, 6 Jun 2022 00:50:27 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74A242F2969 for ; Sun, 5 Jun 2022 21:47:38 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id n8so11251467plh.1 for ; Sun, 05 Jun 2022 21:47:38 -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=j5js470YBzKdTaXPl+QQ3rHxeotAooP4m8EcPovVk7E=; b=jsy7p+Ffk83iH0WeQKhkJUtkuFwG2INATX6huMKL3o2tgG0gGW3qfw6O/Y1Oi1MDyg 86riQ5YlrwYS7iGY1PePFPe+QKpOOSPUS/fFSgbsGS9/VB15qANkhc1m6SHZ/SEYuU7k 2XcBTzVWeh3t3DXe0/FAfRY1xILCc0/LrypXU= 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=j5js470YBzKdTaXPl+QQ3rHxeotAooP4m8EcPovVk7E=; b=NyhfNIKDY19YRNsAGzNCFQSW9HPD8xk32PIRibOWFoal4RgzgpaIoBpp6s3PKALcAb Q9tYxcMaUR3U6NC7zUdK5rU/fNV0C2huW/2Cdb/rsASodkImrdaID9Sfcix9BeMuJJ0D OgiFwj86f2kN6SBFrumFFgvDsThsZhvBhC0yeFFGQWtvB0s7kVZztIYp3Xw4m8QsZucq 9UC2NH3NxFhAgIUpX6H6Hc1+uJVdg2xHV1hltAPTX0u0U4oksJnMJQad1l6ySWUBt6jO EF25Bs93QTnu0BiHhDLaoSCSvayRPdPArQyfYbmX4CfNQIGPf9LPzSu6JFq7mv7visus 8LtA== X-Gm-Message-State: AOAM533h6g8XQ0m5GpDnth/AUk7cmL7rCO+DCSeAQW/xFImnjdrj71M/ bUdjpr62uiL85uQl/LNpSXYt7g== X-Received: by 2002:a17:902:8648:b0:167:86f2:aec3 with SMTP id y8-20020a170902864800b0016786f2aec3mr986607plt.172.1654490857525; Sun, 05 Jun 2022 21:47:37 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:ced3:b110:401b:b32c]) by smtp.gmail.com with ESMTPSA id t190-20020a6381c7000000b003db7de758besm9718609pgd.5.2022.06.05.21.47.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 21:47:37 -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 v3 3/8] drm/panel: panel-edp: Implement .get_orientation callback Date: Mon, 6 Jun 2022 12:47:15 +0800 Message-Id: <20220606044720.945964-4-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220606044720.945964-1-hsinyi@chromium.org> References: <20220606044720.945964-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 --- v2->v3: add comments for notice. --- 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 1732b4f56e38..5fa208005395 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