Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp127499iof; Sun, 5 Jun 2022 23:11:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbE+4WYwwpJkKwY6pUXsdvTgy3Ka+X8IH0+6j6iOv79L/+6bJja9kp1WwAvWxbRQTW1bMS X-Received: by 2002:a05:6a00:1901:b0:518:916e:4a85 with SMTP id y1-20020a056a00190100b00518916e4a85mr22684993pfi.65.1654495867780; Sun, 05 Jun 2022 23:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654495867; cv=none; d=google.com; s=arc-20160816; b=hd5WvnbuqJ2Rs5bEl8XrN8FxQRtiqNs/c/tvB41Jpuy68IEiJMEz8rgDMvFb4Nv1TV Uhus802aag5tAr/ESenrfW/2H38HypgZRlD4hpD/afBL1iq0n3uOObvcKnSd+c26mCya ygb//qOX1y0/yA75h70YmN8dt2FxfDDwvazpMzABLroi6gsUrYhjY6buGGtJiG30FZ48 lpkAqybHdQ8Q+lO4f/dbCBLw3nuATiE4gTuk17iwhk8zVFc+l4CGzG3FtoQY64IRCEGg v9RIb/NrlqZKAQsZ6v7EohcS1mnGqfrMH3kEqd+QmoJRNQDQRH1G7SA2OUqzU5ckVG3u KviQ== 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=OBG3ddtj+ZgIQfqLNbcmwFIyPm4EVBcaHeaGb5pT53Q=; b=RjRwzF4EDE8I+F0o2rRdIdM1t63R89ZSkMA/QSQM6k91cwi7Y+yRU8tufX8Oy8UN6j Ygks/fvI0SJKSMtQRN/XUeeZU0qUAcGEZX8RcNRH/sRyFOV+M+loG9+ATRPPcA8T4+yv aGuyDC5VRUeF9xqIsrd6BmH4IwtP0+0N3fgF3qtTNFzAnc0iHWrG92jlrNJoku73DT0G IBR3QEUP04QiEMwyczy5sJRsq20ZSOD1E7G/8ztGKDdE/OjI2j+Ff8v2QBGTUuMc8OqV kcyAsLweJ7DBrKOTfYx8vDmOArvPvT7tL0Jdn3r5rIaqDZZMveqFcebpCYWFue9+Yl9L K/9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="YTN/yrUX"; 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 m6-20020a056a00080600b00505cf611c6bsi16106125pfk.73.2022.06.05.23.11.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 23:11:07 -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="YTN/yrUX"; 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 33AABB496; Sun, 5 Jun 2022 22:03:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229565AbiFFEum (ORCPT + 99 others); Mon, 6 Jun 2022 00:50:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbiFFEua (ORCPT ); Mon, 6 Jun 2022 00:50:30 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D2572F4F75 for ; Sun, 5 Jun 2022 21:47:48 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id gd1so11891603pjb.2 for ; Sun, 05 Jun 2022 21:47: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=OBG3ddtj+ZgIQfqLNbcmwFIyPm4EVBcaHeaGb5pT53Q=; b=YTN/yrUXNy7AmhJsYdMLLEXrXzJNpCpiojsuW+/5T6R8odawYfdjXEzZ+B7EFnw/W6 vYpDD9rzbiFP9XqgXZteF3gEyBPpL6GV8oBttP2HW053YVX1vnDQASxMTW9EXSt4MaCX dydxq0zVhK/pKtHCsXczIiTtwm7cPPHuSBmBk= 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=OBG3ddtj+ZgIQfqLNbcmwFIyPm4EVBcaHeaGb5pT53Q=; b=CvUCtv7LHImTHaMh+5YsK7HfCMwJLQeDNQcVZ5VZWZmev/MCyoAnRG8gxWh/gVvqsF r3t5eqvfYn/7Q41rABrvctU7DyoWvLcp3ROAqOw8p1oKXOi2M8HyqEGRWjo+2K9y9edM UiYa0DM9uWUls5+yfRf34pPixVgIwTbXee0p5YiWUVdMrH647qP2YVOIV85lGAygtGeL i3Pt+Gx6vyf5vrJAY/trkkodHQRq91thczQCkgy1qEuhML9GAicMZiB1w7uzsXM9ww6z NFWJfOsE/U+1IqGD26t69455YTzvzLrt1HLmOO5EPAmxUR2pi9kn1OBiGug2n+fkDakF 4cUw== X-Gm-Message-State: AOAM531baEqUCmrr65u02IWlZwxA3erlAbCv9Pp/b0sA4A4Ybn4GYoZ7 +UABAkMiz8k4l4JyxP1ZR58+XA== X-Received: by 2002:a17:90b:1e01:b0:1e3:1f4c:dd71 with SMTP id pg1-20020a17090b1e0100b001e31f4cdd71mr24916639pjb.168.1654490867923; Sun, 05 Jun 2022 21:47:47 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 21:47: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 v3 6/8] drm/panel: ili9881c: Implement .get_orientation callback Date: Mon, 6 Jun 2022 12:47:18 +0800 Message-Id: <20220606044720.945964-7-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-ilitek-ili9881c.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c index ba30d11547ad..c098a0ed6be7 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c @@ -853,17 +853,31 @@ static int ili9881c_get_modes(struct drm_panel *panel, connector->display_info.width_mm = mode->width_mm; connector->display_info.height_mm = mode->height_mm; + /* + * 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, ctx->orientation); return 1; } +static enum drm_panel_orientation ili9881c_get_orientation(struct drm_panel *panel) +{ + struct ili9881c *ctx = panel_to_ili9881c(panel); + + return ctx->orientation; +} + static const struct drm_panel_funcs ili9881c_funcs = { .prepare = ili9881c_prepare, .unprepare = ili9881c_unprepare, .enable = ili9881c_enable, .disable = ili9881c_disable, .get_modes = ili9881c_get_modes, + .get_orientation = ili9881c_get_orientation, }; static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) -- 2.36.1.255.ge46751e96f-goog