From nobody Sun Sep 22 01:38:45 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 1A8C0C433EF for ; Mon, 6 Jun 2022 04:50:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229508AbiFFEuX (ORCPT ); Mon, 6 Jun 2022 00:50:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbiFFEuV (ORCPT ); Mon, 6 Jun 2022 00:50:21 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB05C2F1F32 for ; Sun, 5 Jun 2022 21:47:34 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id mh16-20020a17090b4ad000b001e8313301f1so4907459pjb.1 for ; Sun, 05 Jun 2022 21:47:34 -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=hGnDD5r5M3UXCU6BZiTbTzLZsBiSocgUQfxs0cDS1G4=; b=l30rCOLic8LaKGIFsKhI6vz67rGgjxbrO3jiCldFNIW8I5OkLf9aDeJzRGh8jMUXQr SdCvlbgXiwhwr5/BW2rNXyL5J0Ps9u1DEZr8MjIpgqYLPWpvNzo7Yl+yZKxpXm2JIANR IIiMhDTbZV4a5Cc7egdsQqqF+o3IIyQ41+HPU= 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=hGnDD5r5M3UXCU6BZiTbTzLZsBiSocgUQfxs0cDS1G4=; b=UgbquxQb1V6Lz7ZXR1KVCtotfAyYAjGyHHKDtKpC5KBeaFZ6Wn0pU8pW4LCWEaAmLK kRhRuZZDCA/8HHR6uQJrokgDtjmzAcelKAWBO/UIjaFqdWE56E/Nk4ZzGQjtJGZoXU36 VZ/91cD5c2Mvb1bpj6ueqf87nw5HA1x/C8iGwG0oh1yT0Qo1QgJF1Sgjd9wKALwAr0iL D0Q1kvm2MiS9Cuvh8JCZsN12Pyxt21v3bczaczj0xPK/KkBZtHjPJDVLLwbEmlSLg42x UmJ9qi0scOdRQmj7s2rUhkKaWU4G6hPUi5UrW39/S59k0QdvpIiWGYMKfy4RKU+7RR7X cluA== X-Gm-Message-State: AOAM533tnqrJdRrUM21Xraaio73Feq78tCDzt1HxG+A45b0QcieAWu6h CdSaO1Ul4lKg/GiYkqmCZ+OEQg== X-Google-Smtp-Source: ABdhPJzbBbErXs2PWbpEsxPCivcXPl2J9WhwCBQUubS9o01KqgtcAIWDGinwPaxoXPioh5PpozS7CA== X-Received: by 2002:a17:902:c407:b0:163:df01:bbbc with SMTP id k7-20020a170902c40700b00163df01bbbcmr22376780plk.4.1654490854118; Sun, 05 Jun 2022 21:47:34 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 21:47:33 -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 2/8] drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback Date: Mon, 6 Jun 2022 12:47:14 +0800 Message-Id: <20220606044720.945964-3-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: 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 --- v2->v3: add comments for notice. --- drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/d= rm/panel/panel-boe-tv101wum-nl6.c index 1be150ac758f..a9cd07234179 100644 --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c @@ -1511,16 +1511,30 @@ static int boe_panel_get_modes(struct drm_panel *pa= nel, connector->display_info.width_mm =3D boe->desc->size.width_mm; connector->display_info.height_mm =3D boe->desc->size.height_mm; connector->display_info.bpc =3D boe->desc->bpc; + /* + * 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, boe->orientation); =20 return 1; } =20 +static enum drm_panel_orientation boe_panel_get_orientation(struct drm_pan= el *panel) +{ + struct boe_panel *boe =3D to_boe_panel(panel); + + return boe->orientation; +} + static const struct drm_panel_funcs boe_panel_funcs =3D { .unprepare =3D boe_panel_unprepare, .prepare =3D boe_panel_prepare, .enable =3D boe_panel_enable, .get_modes =3D boe_panel_get_modes, + .get_orientation =3D boe_panel_get_orientation, }; =20 static int boe_panel_add(struct boe_panel *boe) --=20 2.36.1.255.ge46751e96f-goog