Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp127487iof; Sun, 5 Jun 2022 23:11:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy21Ecdrj/a18qAk6GGtW3d9kSuGTVs0fjl1mdDNpQssVI0idbG+aQ0/T/fr+rAdDtlWmKs X-Received: by 2002:a63:f405:0:b0:3fc:74c6:fa2 with SMTP id g5-20020a63f405000000b003fc74c60fa2mr19890010pgi.38.1654495866498; Sun, 05 Jun 2022 23:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654495866; cv=none; d=google.com; s=arc-20160816; b=fFSZcYchPfjCJn9mkCjW8znIeI4zFqZ8xt2MdfFuxShsOBC10vctEFYBxZRAEGaU9B nsmnk2vfgDNIMoTkfdYjjt2/TSgOL5W01oyk67Nh+0/Ynw787QyphVb4Hfp0O4ztPnTK TgDOuHGeO2HHBnJcuqe1O7Zx5VevjpWaG9COjCeUyrGpeeNn4CS0Pp1j1cV8MQVeOEKW 4JC+vd7H6ftBMKQkqHFXB1WqBkKP1lGrxlnTyRgBiVO3KoXzGNMhrPhP5y1egg7LaTya BtG+4NpBV4qAOth0hwP0BdciS3CqyTYuXD0bnx/0IlTJTD4gf1fPbkQYV11bTuSuWG/T fo0A== 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=jJ29kS9c54d0XZMXg/mI13/u5APCZGzRFuqJAJLTaSY=; b=X1Pp1+RrgOQ0apV2Jk9e4ETA6u2nZZukaG1A8jRYPNERymwIZmqUwmKlF3VjUA8D1X CV1kVPMvnEvSO+6M1b3NajGVoDgGB6rAznygnl8Jz1kT4WmD+CukjNG4FWiEsSvPVH/i 05C5efMih3i1a1gpiQsAT2BfwXAZn7XRHGiLnO6uw9yBRnCXF9Mx8mZF6w1fKB6neyf+ ViqcckW1suERsSP8/lkBB3x+Y445zjwpaWSO68hiHXvJ5f0IBMxE+w6EYGY4LMUv+gLl 7zGxkeoeL7EmH+tSf+veQP4sLfKLy+Nt6PLUeoMeST0GN1FPqcOarsdgtIt6Lepa1YG/ /hVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Kx8+twWh; 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 m12-20020a170902f64c00b0016198140119si9141533plg.606.2022.06.05.23.11.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 23:11:06 -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=Kx8+twWh; 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 B2702ED7A0; Sun, 5 Jun 2022 22:03:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229535AbiFFEua (ORCPT + 99 others); Mon, 6 Jun 2022 00:50:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbiFFEuY (ORCPT ); Mon, 6 Jun 2022 00:50:24 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D37B42F4497 for ; Sun, 5 Jun 2022 21:47:41 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id c18so3667124pgh.11 for ; Sun, 05 Jun 2022 21:47:41 -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=jJ29kS9c54d0XZMXg/mI13/u5APCZGzRFuqJAJLTaSY=; b=Kx8+twWhs/MPzSGyOLbfniqa2/hFoAzxdS5zJtPY3HxAawuRcw8KkL4mgSmRFD6xAy TLCEAO9autEMesNlLsqrz0eEEQehlWzf4CMj7ow9KfICb0QKPZKvjj9jjU0uLAN+BCde ZWUMw6pzqRfkezTfLlpU8gnUUiZhoVvmX6dWI= 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=jJ29kS9c54d0XZMXg/mI13/u5APCZGzRFuqJAJLTaSY=; b=R6XCHdnmVeZcRV67uR2nEa9bblRDaClcXzlQ+8Q49DwWxCFo/1HtMpwFXL9wY2Pa20 49wNc0IRPUL1R4wRDCp8QZG+4j/skyPoYFcPguNfCCoHXJ1i2fS9XMq2X60OsF6g0na+ hAYKHdvvMiiooYTHdt2LncmfEkQFQuMixxrFBONA2xTArYwU894aEhsDXuwKSWA78xga pN1TA3s/LcIiE4RCE71PlHCe+zb3WItf9E6S1APBzmh9nznqwMAXwNsdMptiRhUeAGJr rpjlpIymi+nT5nRkWP5NmcEypzkHmMW4SOIVU65zrfsPLxD4ceCUomIBd5qJDVBj0Gqb 6KEw== X-Gm-Message-State: AOAM533JSq4sp5XLk4VVDP15XcZKhr4vh5UKTkegdC6nv3o4aesqX9J5 Z4v5ZYDcNf6Pm1ZJntqgQpHCXw== X-Received: by 2002:a62:e116:0:b0:51b:c452:47e6 with SMTP id q22-20020a62e116000000b0051bc45247e6mr21890310pfh.25.1654490861026; Sun, 05 Jun 2022 21:47:41 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 21:47:40 -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 4/8] drm/panel: lvds: Implement .get_orientation callback Date: Mon, 6 Jun 2022 12:47:16 +0800 Message-Id: <20220606044720.945964-5-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-lvds.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c index 27a1c9923b09..239527409b00 100644 --- a/drivers/gpu/drm/panel/panel-lvds.c +++ b/drivers/gpu/drm/panel/panel-lvds.c @@ -102,15 +102,29 @@ static int panel_lvds_get_modes(struct drm_panel *panel, connector->display_info.bus_flags = lvds->data_mirror ? DRM_BUS_FLAG_DATA_LSB_TO_MSB : DRM_BUS_FLAG_DATA_MSB_TO_LSB; + /* + * 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); return 1; } +static enum drm_panel_orientation panel_lvds_get_orientation,(struct drm_panel *panel) +{ + struct panel_lvds *lvds = to_panel_lvds(panel); + + return lvds->orientation; +} + static const struct drm_panel_funcs panel_lvds_funcs = { .unprepare = panel_lvds_unprepare, .prepare = panel_lvds_prepare, .get_modes = panel_lvds_get_modes, + .get_orientation = panel_lvds_get_orientation, }; static int panel_lvds_parse_dt(struct panel_lvds *lvds) -- 2.36.1.255.ge46751e96f-goog