From nobody Sun Sep 22 02:04:48 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07A2AC43334 for ; Mon, 6 Jun 2022 15:25:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240546AbiFFPY7 (ORCPT ); Mon, 6 Jun 2022 11:24:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240526AbiFFPYy (ORCPT ); Mon, 6 Jun 2022 11:24:54 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D187A2C3B30 for ; Mon, 6 Jun 2022 08:24:51 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id gc3-20020a17090b310300b001e33092c737so12823960pjb.3 for ; Mon, 06 Jun 2022 08:24:51 -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=JUUMSUxjqpGlmr3hthDS9G4YblhtZnmP+Xt3CB0AHAw=; b=MM9wCxMHjra8vSnY99x51x6RVe62qnapf1dqn+TZ9V6KMLtMycNavxNRE0f2U7wBnO dSH0v42r3ErXXt7j22NXnI+Be3YKWIHWXNkU5iPsPIWtsk8gDOrVq68MESt0950u85Xf i4r5p4PXFFCfquE0opsQ7jduBXRim/P69Sfu4= 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=JUUMSUxjqpGlmr3hthDS9G4YblhtZnmP+Xt3CB0AHAw=; b=2RkwBN0TAXO6+r8oWzEWMJgh7JVTMRwyk01rP1NvD7eseLvsBw937BAXJCg189hkjg eq8IFYVZwN3pJuiCKTEwalx9Lm6A5S3b3eqhoZNLl8zlmRqhlOZwHzzVU5DkVRrc/XYz 9/Cd+j+nvw617UaPyHFwi+e5vkanIDgrNXYtkn/v31mKLV9Fe5sT9xbUIFDbKE+E88gD i/26weKahez/zUq/j814OM4rfqoMTKyMghW+uQIF4x1pLLgZDB0PFmYgF1o+F/X0QXOu ap29tpLKOkDc2IEVs/FeohiXXTH8xE6tqN5QxuJvGCD4qtiI5QdSDr5J1Kf0RnMDjv3n EEHg== X-Gm-Message-State: AOAM5326SijLDZEwoBdUgHdjCnplj0Z2h6jqoEBmSeQYpokdBe+i+J+A t6svvWQ8mbkVk7oYUiu9V8XrdA== X-Google-Smtp-Source: ABdhPJyfS7sG1ItRoGo2m20r8vhB47EXPGK0Qy9fOfm5yN9s8qx5qB50fptn8+CQbBgByjupLlzaxQ== X-Received: by 2002:a17:902:e889:b0:167:523c:6011 with SMTP id w9-20020a170902e88900b00167523c6011mr15889647plg.114.1654529091208; Mon, 06 Jun 2022 08:24:51 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 08:24:50 -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 4/8] drm/panel: lvds: Implement .get_orientation callback Date: Mon, 6 Jun 2022 23:24:27 +0800 Message-Id: <20220606152431.1889185-5-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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" To return the orientation property to drm/kms driver. Signed-off-by: Hsin-Yi Wang Reviewed-by: Hans de Goede Reviewed-by: Douglas Anderson --- v3->v4: rebase to latest linux-next to solve conflict. --- drivers/gpu/drm/panel/panel-lvds.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/pan= el-lvds.c index f11252fb00fe..491b64c2c8d6 100644 --- a/drivers/gpu/drm/panel/panel-lvds.c +++ b/drivers/gpu/drm/panel/panel-lvds.c @@ -99,15 +99,30 @@ static int panel_lvds_get_modes(struct drm_panel *panel, drm_display_info_set_bus_formats(&connector->display_info, &lvds->bus_format, 1); connector->display_info.bus_flags =3D lvds->bus_flags; + + /* + * 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, lvds->orientation); =20 return 1; } =20 +static enum drm_panel_orientation panel_lvds_get_orientation,(struct drm_p= anel *panel) +{ + struct panel_lvds *lvds =3D to_panel_lvds(panel); + + return lvds->orientation; +} + static const struct drm_panel_funcs panel_lvds_funcs =3D { .unprepare =3D panel_lvds_unprepare, .prepare =3D panel_lvds_prepare, .get_modes =3D panel_lvds_get_modes, + .get_orientation =3D panel_lvds_get_orientation, }; =20 static int panel_lvds_parse_dt(struct panel_lvds *lvds) --=20 2.36.1.255.ge46751e96f-goog