From patchwork Tue Jun 11 00:22:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Basehore X-Patchwork-Id: 10985705 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A268013AF for ; Tue, 11 Jun 2019 00:23:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92449285CB for ; Tue, 11 Jun 2019 00:23:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85AFE28702; Tue, 11 Jun 2019 00:23:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 15F9E285CB for ; Tue, 11 Jun 2019 00:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JoFqSgb2ESMTX89VKdo6XGJ77FlI818WAO06RQaUAdE=; b=nT01cjoo8B92nY Se9LoTWwAiVe4T3MhXnNw1UUEXcH9PwWa4jlGlwMqdQSgKntWBFG00VAaMt4YnawPQqMbCFY3nMAA PP7VrGcqnaAW926Mq9wvbE1dqn+cYV0YrR7veaCC+22SNsoTZGKysQSWypJ8m8qc/ipaHel7pvNLE xoO1nXfkEukREz5dM/kJNg9st4Lw1Mhv5/1FSN0lDsTIUMyY9P4NNseLVQQgp7Mw0Q7IiGqw4VAkz Z16FY2QyK5gTfj4i0KtqcpciJ7g1mGueIp0X9KQ0lPoc1J5sXSW1Hg9ASwPkhwbzz8GpKtCr4svbX uv0K0qTSBueUheHvBBYg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1haUZS-0004d3-5W; Tue, 11 Jun 2019 00:23:26 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1haUZ8-0004KW-N8 for linux-mediatek@lists.infradead.org; Tue, 11 Jun 2019 00:23:08 +0000 Received: by mail-pg1-x542.google.com with SMTP id l19so3287343pgh.9 for ; Mon, 10 Jun 2019 17:23:06 -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=dK5nepKO/Lu9qcWjch0d2Z8IhG0b83DDW/+1Tc5GcLg=; b=CQSD7BQmHeU8dta4f8b5FeRoYweJraemdUXZE33CRhZXzo2oXBuxCTGOM5BsNNhKw5 IvZrNb952TuK7jl2R5T28ivBeonhQhikKcdqjfd37R2qgBuDst95M8MdOOmp83tshMXF enl7C+yuT6sx2o9EbxANZjUSRbg/SsDRj33L0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dK5nepKO/Lu9qcWjch0d2Z8IhG0b83DDW/+1Tc5GcLg=; b=DEuZV0dRXDLm+BoL1i5i+xaqEEpdfdxKoO857JkcMLlExnwMxZcrKUsTNrXfkPPyC3 X+Cc41dR9t+1bsoXYKZOs5qzWdIPcckVspK7WoutSabNprxsR/bFv8b4G866i8+86f9V feNgOUWDBdZJxFXXCOS+VuXTci3Y2f7dTxrI+SdqrRvGIBkdbYN+HO1+tGUKHvDn0E1u ZjSob7rU0+xTz0O2Q8IXaabzaBMcMGY2DVL3HeoiZ3HGeh4fX7lEAKX52MMrPyCBhwI0 nHSyx1IpdahvhefYTWBcCcvfmkZW5mIm0tF+4T3AxySlcCIj8NVO5LwkNZ+0ND+mxDTy WLZw== X-Gm-Message-State: APjAAAVWg0oYmunAYfNdd/ywqYkNA9VBUflGUc3zUSQagdYvm0fW4eGU p4fGZmgDbKn6frvu01fRvDh57g== X-Google-Smtp-Source: APXvYqwcqMLc4JPOcan8IYdWBHlZr/s4dv56BnUDmV3zQ52JM1dZEdhNG4dhlV/n6npVhEvKjcRd2Q== X-Received: by 2002:a62:1b85:: with SMTP id b127mr77773519pfb.165.1560212586202; Mon, 10 Jun 2019 17:23:06 -0700 (PDT) Received: from exogeni.mtv.corp.google.com ([2620:15c:202:1:5be8:f2a6:fd7b:7459]) by smtp.gmail.com with ESMTPSA id t4sm540317pjq.19.2019.06.10.17.23.04 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 10 Jun 2019 17:23:05 -0700 (PDT) From: Derek Basehore To: linux-kernel@vger.kernel.org Subject: [PATCH 1/5] drm/panel: Add helper for reading DT rotation Date: Mon, 10 Jun 2019 17:22:52 -0700 Message-Id: <20190611002256.186969-2-dbasehore@chromium.org> X-Mailer: git-send-email 2.22.0.rc2.383.gf4fbbf30c2-goog In-Reply-To: <20190611002256.186969-1-dbasehore@chromium.org> References: <20190611002256.186969-1-dbasehore@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190610_172306_766818_548E52A1 X-CRM114-Status: GOOD ( 12.11 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Derek Basehore , p.zabel@pengutronix.de, maxime.ripard@bootlin.com, sam@ravnborg.org, intel-gfx@lists.freedesktop.org, joonas.lahtinen@linux.intel.com, maarten.lankhorst@linux.intel.com, jani.nikula@linux.intel.com, airlied@linux.ie, thierry.reding@gmail.com, matthias.bgg@gmail.com, dri-devel@lists.freedesktop.org, daniel@ffwll.ch, rodrigo.vivi@intel.com, ck.hu@mediatek.com, linux-mediatek@lists.infradead.org, sean@poorly.run, linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This adds a helper function for reading the rotation (panel orientation) from the device tree. Signed-off-by: Derek Basehore --- drivers/gpu/drm/drm_panel.c | 41 +++++++++++++++++++++++++++++++++++++ include/drm/drm_panel.h | 7 +++++++ 2 files changed, 48 insertions(+) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index dbd5b873e8f2..3b689ce4a51a 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -172,6 +172,47 @@ struct drm_panel *of_drm_find_panel(const struct device_node *np) return ERR_PTR(-EPROBE_DEFER); } EXPORT_SYMBOL(of_drm_find_panel); + +/** + * of_drm_get_panel_orientation - look up the rotation of the panel using a + * device tree node + * @np: device tree node of the panel + * @orientation: orientation enum to be filled in + * + * Looks up the rotation of a panel in the device tree. The rotation in the + * device tree is counter clockwise. + * + * Return: 0 when a valid rotation value (0, 90, 180, or 270) is read or the + * rotation property doesn't exist. -EERROR otherwise. + */ +int of_drm_get_panel_orientation(const struct device_node *np, int *orientation) +{ + int rotation, ret; + + ret = of_property_read_u32(np, "rotation", &rotation); + if (ret == -EINVAL) { + /* Don't return an error if there's no rotation property. */ + *orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN; + return 0; + } + + if (ret < 0) + return ret; + + if (rotation == 0) + *orientation = DRM_MODE_PANEL_ORIENTATION_NORMAL; + else if (rotation == 90) + *orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP; + else if (rotation == 180) + *orientation = DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP; + else if (rotation == 270) + *orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP; + else + return -EINVAL; + + return 0; +} +EXPORT_SYMBOL(of_drm_get_panel_orientation); #endif MODULE_AUTHOR("Thierry Reding "); diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 8c738c0e6e9f..13631b2efbaa 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -197,11 +197,18 @@ int drm_panel_detach(struct drm_panel *panel); #if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL) struct drm_panel *of_drm_find_panel(const struct device_node *np); +int of_drm_get_panel_orientation(const struct device_node *np, + int *orientation); #else static inline struct drm_panel *of_drm_find_panel(const struct device_node *np) { return ERR_PTR(-ENODEV); } +int of_drm_get_panel_orientation(const struct device_node *np, + int *orientation) +{ + return -ENODEV; +} #endif #endif From patchwork Tue Jun 11 00:22:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Basehore X-Patchwork-Id: 10985711 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 82B6A13AF for ; Tue, 11 Jun 2019 00:24:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72BA0285CB for ; Tue, 11 Jun 2019 00:24:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65DBB28702; Tue, 11 Jun 2019 00:24:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1391B285CB for ; Tue, 11 Jun 2019 00:24:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JBCoajuD5qWgNIdc7SinVBPQG4gTd4oPF+prm0BcmLc=; b=Qoy1bU66H9pTBg 7JiHCqiJsSO5Toej2SCtd8jD+4vGbeGadv1vg21eQ5ZLNWkbUNoafQd6+jEZtHZA3sLI+p9Vbk2Qm LgEyqSkg/Tdk3dtdoZb+3sJbeOwV6chkj/1ORNKnw6TomfNvgWHmr04cZYqJP6eXrM/bTu77yCZ89 S5VZWQ+CyEMEcCfFCKvBAqCmqg3gNQQ6k15vONCuRWsmBNDupvUoTukPaIlPQeqJ/8kAJBAR64jvE IJ2u0sNWkVGJKx8yx/SUqPv7Yg9G68kgvnYegtkdhybcLMACFWeSt31Gr431x+7tYP25R6PGs0HWv Rbjnnzeks2VDtwtP3tmg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1haUZz-00059Y-IQ; Tue, 11 Jun 2019 00:23:59 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1haUZ9-0004La-SF for linux-mediatek@lists.infradead.org; Tue, 11 Jun 2019 00:23:10 +0000 Received: by mail-pg1-x544.google.com with SMTP id a3so5895288pgb.3 for ; Mon, 10 Jun 2019 17:23:07 -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=ys0DSil+WvCMaDGevz2dSiLwFPZR4jwAs4InRe1vZNA=; b=X12Jn3AUd//JNQCTWSBR6eh9r650AWw9Xjg7KpO0V+0SA2HdJEsEae1jQkqDPHyQKe F9jkL7x/7/FbANfIR4mwRASAg6AXFvQesI26VoF7tgXODbVqSvH4TDWixSqzy/8t/2Oe o6kb4qUN0UwhrIOg/a3lFqtIXvRAqNQYOcNrA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ys0DSil+WvCMaDGevz2dSiLwFPZR4jwAs4InRe1vZNA=; b=VD7OorJ1gPD02ADnllVxwDzT2Mn1FGEb7L25JCefHcvudxHbZvamOvfjP66dICqxI/ +ni74PR0Xy1LWCF/HFslg/Yhk+GjDglx5NKiwUeQ8WEstINMpQ2I6djWK1hAsmLQJl13 K2FHJdAaRO9VLt2Hehzltpd1JR0YCetIA7T6RPhfYqJVjqmvsc7LNK7Y6nc5wW3J0V3a b1BrRt3lBUXl5CX0ipc3Mi1pFaAE+YmJbIAw93cIQz+OQiyLzgaE4CSGpXkWIz5pVG3q 0oCo4ebaMkQ1SV7oVR8CgnJkDExI1ZUbExOCOuZH3OtjePJK9ZzuRngTUqRv4669P6RW NpEg== X-Gm-Message-State: APjAAAWVJ5a2jJ2ACNx2r10RlBDaRf9Qki2u9s1rsDybzbHFkwiq5ev0 vwRPD/w+9uqZSfikvou3K9DTsg== X-Google-Smtp-Source: APXvYqxAc42hyNbAAjVSUHVWNoM3DB7fjZVsqMVi9qbCUz/7kQyXOOCdI5Fe02ZPTYUapCArvj8xLA== X-Received: by 2002:a62:7552:: with SMTP id q79mr57521992pfc.71.1560212587343; Mon, 10 Jun 2019 17:23:07 -0700 (PDT) Received: from exogeni.mtv.corp.google.com ([2620:15c:202:1:5be8:f2a6:fd7b:7459]) by smtp.gmail.com with ESMTPSA id t4sm540317pjq.19.2019.06.10.17.23.06 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 10 Jun 2019 17:23:06 -0700 (PDT) From: Derek Basehore To: linux-kernel@vger.kernel.org Subject: [PATCH 2/5] dt-bindings: display/panel: Expand rotation documentation Date: Mon, 10 Jun 2019 17:22:53 -0700 Message-Id: <20190611002256.186969-3-dbasehore@chromium.org> X-Mailer: git-send-email 2.22.0.rc2.383.gf4fbbf30c2-goog In-Reply-To: <20190611002256.186969-1-dbasehore@chromium.org> References: <20190611002256.186969-1-dbasehore@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190610_172308_103352_B755B8B4 X-CRM114-Status: UNSURE ( 9.70 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Derek Basehore , p.zabel@pengutronix.de, maxime.ripard@bootlin.com, sam@ravnborg.org, intel-gfx@lists.freedesktop.org, joonas.lahtinen@linux.intel.com, maarten.lankhorst@linux.intel.com, jani.nikula@linux.intel.com, airlied@linux.ie, thierry.reding@gmail.com, matthias.bgg@gmail.com, dri-devel@lists.freedesktop.org, daniel@ffwll.ch, rodrigo.vivi@intel.com, ck.hu@mediatek.com, linux-mediatek@lists.infradead.org, sean@poorly.run, linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This adds to the rotation documentation to explain how drivers should use the property and gives an example of the property in a devicetree node. Signed-off-by: Derek Basehore --- .../bindings/display/panel/panel.txt | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/panel.txt b/Documentation/devicetree/bindings/display/panel/panel.txt index e2e6867852b8..f35d62d933fc 100644 --- a/Documentation/devicetree/bindings/display/panel/panel.txt +++ b/Documentation/devicetree/bindings/display/panel/panel.txt @@ -2,3 +2,35 @@ Common display properties ------------------------- - rotation: Display rotation in degrees counter clockwise (0,90,180,270) + +Property read from the device tree using of of_drm_get_panel_orientation + +The panel driver may apply the rotation at the TCON level, which will +make the panel look like it isn't rotated to the kernel and any other +software. + +If not, a panel orientation property should be added through the SoC +vendor DRM code using the drm_connector_init_panel_orientation_property +function. + +Example: + panel: panel@0 { + compatible = "boe,himax8279d8p"; + reg = <0>; + enable-gpios = <&pio 45 0>; + pp33-gpios = <&pio 35 0>; + pp18-gpios = <&pio 36 0>; + pinctrl-names = "default", "state_3300mv", "state_1800mv"; + pinctrl-0 = <&panel_pins_default>; + pinctrl-1 = <&panel_pins_3300mv>; + pinctrl-2 = <&panel_pins_1800mv>; + backlight = <&backlight_lcd0>; + rotation = <180>; + status = "okay"; + + port { + panel_in: endpoint { + remote-endpoint = <&dsi_out>; + }; + }; + }; From patchwork Tue Jun 11 00:22:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Basehore X-Patchwork-Id: 10985713 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 66CED13AF for ; Tue, 11 Jun 2019 00:24:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5579928702 for ; Tue, 11 Jun 2019 00:24:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48D1E28705; Tue, 11 Jun 2019 00:24:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D4CCF28702 for ; Tue, 11 Jun 2019 00:24:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wYVGxqI/pOH0MrttiLmKRjHl+61P9tOgoA9O+f2MWHE=; b=p7WbgbbOssLHNB P0aSJVbMYcPdfffQ7rEZimKJJtTIhTP+ETrRT4NqIXw01Ysp9kzcp94ki518+zZtMeaRXj/QPig8E IBEmXUpgOJikunwfXGgPCRIKTftoXKHhUDBCyrw0f2xDz5Kk8Faq0ixtGLhCMPiYlmhY/jI16v2w+ NHxd/T7TYNbrSxx6KSz75M4sHz2MvffgZPUze4Cck/bW9aTOWj24cjWIoy6imuz4uVBw3eeekwLPA oqQS5vYmE+Km5bab0gfbE09dZUorZeqQWku9J5rB+O6UPSf0rXrdX4TioCGJh6WeruzNIg0Y6CggF VNwvykt9VTT0bxjC2T7w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1haUa3-0005CT-F7; Tue, 11 Jun 2019 00:24:03 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1haUZB-0004N4-0L for linux-mediatek@lists.infradead.org; Tue, 11 Jun 2019 00:23:10 +0000 Received: by mail-pg1-x544.google.com with SMTP id f25so5882357pgv.10 for ; Mon, 10 Jun 2019 17:23:08 -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=7l9eJCs2PeowUasvujNxJ+tq7unRBQcTxAKWiz4JMIE=; b=evokIjR4FgyjQ4UFLo9iswsV8vW4ne5f+ymL6lDggG9PK5MCubFk6GC/cJ93jctYsM VaPiJo+Rs9owKBfAdgdm9x/Qx065hL6/VManLQv5fJsFUhQWa5CSgM5J7VV5u4PffOoj 05Sca9TKhk3F9uLQLzI9BpVrtyH3VMUHP7vWk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7l9eJCs2PeowUasvujNxJ+tq7unRBQcTxAKWiz4JMIE=; b=gNSebUciuM/bfjt3hUyaDzcx3TSwUWzOAkhjhDgFkKncLBoLYVYCPibt4YyirWar4K Okgt4FE0P2KbrIZv2pHNFkUHJo9de9ju3XCk8PTbS+jJkjdKTXk/ahfuFtA1rmgmTX5F HAKqkveFfv2WnZvM6nM4HXMnzjdyPVlVjf4Fwf7NLUklinTKzHIqa0M7yNchVtcSAbaT yVBfb6ZZBj562NoT4YYDdBewSbs4ICfxD7WJTD8zG0cJAsg/kshJhAodud4kjwFCVbau Kf52/AsShIoCURZ0foiurh6Isre2ch6u/32zyonkH943GneJYDk9nHQChPxwLHVa6lDk 4urg== X-Gm-Message-State: APjAAAXFhHQhPsR5RSDARJ8XHwAd1NZJJzJnFIwOqnJVMXMqHPjh4O/s mhrQDB9cB2dbG5+AZLY/aoe/Ug== X-Google-Smtp-Source: APXvYqxXrwREiReNGSD5SzpOTe3czQMpgGRjtIlULxAPe0ldReXT1NS+YN+qsMaBOSYIsfxHYJn70A== X-Received: by 2002:a62:2f87:: with SMTP id v129mr78643128pfv.9.1560212588496; Mon, 10 Jun 2019 17:23:08 -0700 (PDT) Received: from exogeni.mtv.corp.google.com ([2620:15c:202:1:5be8:f2a6:fd7b:7459]) by smtp.gmail.com with ESMTPSA id t4sm540317pjq.19.2019.06.10.17.23.07 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 10 Jun 2019 17:23:07 -0700 (PDT) From: Derek Basehore To: linux-kernel@vger.kernel.org Subject: [PATCH 3/5] drm/panel: Add attach/detach callbacks Date: Mon, 10 Jun 2019 17:22:54 -0700 Message-Id: <20190611002256.186969-4-dbasehore@chromium.org> X-Mailer: git-send-email 2.22.0.rc2.383.gf4fbbf30c2-goog In-Reply-To: <20190611002256.186969-1-dbasehore@chromium.org> References: <20190611002256.186969-1-dbasehore@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190610_172309_168330_CECEF2FC X-CRM114-Status: GOOD ( 12.01 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Derek Basehore , p.zabel@pengutronix.de, maxime.ripard@bootlin.com, sam@ravnborg.org, intel-gfx@lists.freedesktop.org, joonas.lahtinen@linux.intel.com, maarten.lankhorst@linux.intel.com, jani.nikula@linux.intel.com, airlied@linux.ie, thierry.reding@gmail.com, matthias.bgg@gmail.com, dri-devel@lists.freedesktop.org, daniel@ffwll.ch, rodrigo.vivi@intel.com, ck.hu@mediatek.com, linux-mediatek@lists.infradead.org, sean@poorly.run, linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This adds the attach/detach callbacks. These are for setting up internal state for the connector/panel pair that can't be done at probe (since the connector doesn't exist) and which don't need to be repeatedly done for every get/modes, prepare, or enable callback. Values such as the panel orientation, and display size can be filled in for the connector. Signed-off-by: Derek Basehore --- drivers/gpu/drm/drm_panel.c | 14 ++++++++++++++ include/drm/drm_panel.h | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index 3b689ce4a51a..72f67678d9d5 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -104,12 +104,23 @@ EXPORT_SYMBOL(drm_panel_remove); */ int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector) { + int ret; + if (panel->connector) return -EBUSY; panel->connector = connector; panel->drm = connector->dev; + if (panel->funcs->attach) { + ret = panel->funcs->attach(panel); + if (ret < 0) { + panel->connector = NULL; + panel->drm = NULL; + return ret; + } + } + return 0; } EXPORT_SYMBOL(drm_panel_attach); @@ -128,6 +139,9 @@ EXPORT_SYMBOL(drm_panel_attach); */ int drm_panel_detach(struct drm_panel *panel) { + if (panel->funcs->detach) + panel->funcs->detach(panel); + panel->connector = NULL; panel->drm = NULL; diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 13631b2efbaa..e136e3a3c996 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -37,6 +37,8 @@ struct display_timing; * struct drm_panel_funcs - perform operations on a given panel * @disable: disable panel (turn off back light, etc.) * @unprepare: turn off panel + * @detach: detach panel->connector (clear internal state, etc.) + * @attach: attach panel->connector (update internal state, etc.) * @prepare: turn on panel and perform set up * @enable: enable panel (turn on back light, etc.) * @get_modes: add modes to the connector that the panel is attached to and @@ -70,6 +72,8 @@ struct display_timing; struct drm_panel_funcs { int (*disable)(struct drm_panel *panel); int (*unprepare)(struct drm_panel *panel); + void (*detach)(struct drm_panel *panel); + int (*attach)(struct drm_panel *panel); int (*prepare)(struct drm_panel *panel); int (*enable)(struct drm_panel *panel); int (*get_modes)(struct drm_panel *panel); From patchwork Tue Jun 11 00:22:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Basehore X-Patchwork-Id: 10985721 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6ACF13AD for ; Tue, 11 Jun 2019 00:24:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95741285CB for ; Tue, 11 Jun 2019 00:24:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 885ED28704; Tue, 11 Jun 2019 00:24:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 26D9E285CB for ; Tue, 11 Jun 2019 00:24:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eUBSXQEya2PP99ic5WhM0fIoq81JwIVWYSKKPdYTLwc=; b=X5JnTMTqlGeeZL 6MsvMSPWd7V7PwxgreyTAta1HPFaE5p/6Dw45UxEc0JxdzmJHmhYjqpZYCzdXICLXDMSIR9pD8SyT Iya4FXKPQQCDQ1uv8Vr+a+wRUV70mfgiAWiSXVLaDtC59BJ9MJaVWya6wLI2YpTXSTt/DNzd00mfb t5X65HELa02nJY0YwBrRx5bXOmBd3u4TWA7/KfShxYRY5iSTmBItyNuVsMZzaEO/Be2++GE2MyaAF IMcxLoxNVG8JBxX8IEFHhQh9rAZVc7RrpBXnjU4BLqvaIRthkB3kla6w3G4NXn4XmbZ4WHIjvx0bj KDZr6Z0lEuutl45UiNIw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1haUar-0005wL-Aw; Tue, 11 Jun 2019 00:24:53 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1haUZC-0004OL-NE for linux-mediatek@lists.infradead.org; Tue, 11 Jun 2019 00:23:13 +0000 Received: by mail-pf1-x444.google.com with SMTP id p184so2947561pfp.7 for ; Mon, 10 Jun 2019 17:23:10 -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=SbGlBPyajmgb9CaueSzIfrgJlhnAGN7+8e2UjE2WPGs=; b=QMTcan/tAguair4X5N96kBUhDCQmzcPQ8o33atawGY8VZu4nSq4tzlWDtJGd+W/JpQ nl1W7EVIj+azFgH5SC++A+b3c6obUjjID0u/wvWW7dT4ASZmLXG0PkwC7/eoU1mQCkOK myUpXIrOD1SQJe+dlbHElyIEz85++rjSgwYnw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SbGlBPyajmgb9CaueSzIfrgJlhnAGN7+8e2UjE2WPGs=; b=KBumyUhMM0jXNG3lkAeo3cNi5R8gzX2roK7AllI7+mQCTRewoVvJtEBYuU+zLoP+Tn St0RAqBOvfkZmZ1AheRCIk3NHA346m/jBur8qBTBos0md4UbwgB3ZIv4VpWRQwyFVwhQ /RfEOYTvpURjgUvv7DIKtjWa11y27M9WLiFWUWVeVqoBSlx/ZbWUMiwn9aGEz47OSr0c fW3SwcKz3sFrnnrIt4uoVjNyoo58gWCL/6c4ETTT2+JFsFNKWWOqzjWgRaAGEuFgw5+b GDmvlQhfG15ywMm1S6JQDFYIdgW3VN9vzmMqpD9OYc0maZ/4jUIiuYZlQAOxLArJLDts RSQQ== X-Gm-Message-State: APjAAAUFOMCsZUbNGibFrCM96as0ws7zVvYmZV6BePcim9DKK9MciAf6 +Vypv+Zbsxu4iPxyb78pIeMs6A== X-Google-Smtp-Source: APXvYqwi56JXscBKRHfQoGNMBePzYhFMyyTHJGvp9aFG+ez3Y7Dba8/6WvJUku8BN9epZSypI5eOvQ== X-Received: by 2002:a63:ee12:: with SMTP id e18mr18316371pgi.412.1560212589668; Mon, 10 Jun 2019 17:23:09 -0700 (PDT) Received: from exogeni.mtv.corp.google.com ([2620:15c:202:1:5be8:f2a6:fd7b:7459]) by smtp.gmail.com with ESMTPSA id t4sm540317pjq.19.2019.06.10.17.23.08 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 10 Jun 2019 17:23:09 -0700 (PDT) From: Derek Basehore To: linux-kernel@vger.kernel.org Subject: [PATCH 4/5] drm/connector: Split out orientation quirk detection Date: Mon, 10 Jun 2019 17:22:55 -0700 Message-Id: <20190611002256.186969-5-dbasehore@chromium.org> X-Mailer: git-send-email 2.22.0.rc2.383.gf4fbbf30c2-goog In-Reply-To: <20190611002256.186969-1-dbasehore@chromium.org> References: <20190611002256.186969-1-dbasehore@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190610_172310_792624_B8E5FE15 X-CRM114-Status: GOOD ( 14.57 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Derek Basehore , p.zabel@pengutronix.de, maxime.ripard@bootlin.com, sam@ravnborg.org, intel-gfx@lists.freedesktop.org, joonas.lahtinen@linux.intel.com, maarten.lankhorst@linux.intel.com, jani.nikula@linux.intel.com, airlied@linux.ie, thierry.reding@gmail.com, matthias.bgg@gmail.com, dri-devel@lists.freedesktop.org, daniel@ffwll.ch, rodrigo.vivi@intel.com, ck.hu@mediatek.com, linux-mediatek@lists.infradead.org, sean@poorly.run, linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This removes the orientation quirk detection from the code to add an orientation property to a panel. This is used only for legacy x86 systems, yet we'd like to start using this on device tree systems where quirk detection like this is not needed. Signed-off-by: Derek Basehore --- drivers/gpu/drm/drm_connector.c | 16 ++++------------ drivers/gpu/drm/i915/vlv_dsi.c | 13 +++++++++---- include/drm/drm_connector.h | 2 +- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index e17586aaa80f..58a09b65028b 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -1894,31 +1894,23 @@ EXPORT_SYMBOL(drm_connector_set_vrr_capable_property); * drm_connector_init_panel_orientation_property - * initialize the connecters panel_orientation property * @connector: connector for which to init the panel-orientation property. - * @width: width in pixels of the panel, used for panel quirk detection - * @height: height in pixels of the panel, used for panel quirk detection * * This function should only be called for built-in panels, after setting * connector->display_info.panel_orientation first (if known). * - * This function will check for platform specific (e.g. DMI based) quirks - * overriding display_info.panel_orientation first, then if panel_orientation - * is not DRM_MODE_PANEL_ORIENTATION_UNKNOWN it will attach the - * "panel orientation" property to the connector. + * This function will check if the panel_orientation is not + * DRM_MODE_PANEL_ORIENTATION_UNKNOWN. If not, it will attach the "panel + * orientation" property to the connector. * * Returns: * Zero on success, negative errno on failure. */ int drm_connector_init_panel_orientation_property( - struct drm_connector *connector, int width, int height) + struct drm_connector *connector) { struct drm_device *dev = connector->dev; struct drm_display_info *info = &connector->display_info; struct drm_property *prop; - int orientation_quirk; - - orientation_quirk = drm_get_panel_orientation_quirk(width, height); - if (orientation_quirk != DRM_MODE_PANEL_ORIENTATION_UNKNOWN) - info->panel_orientation = orientation_quirk; if (info->panel_orientation == DRM_MODE_PANEL_ORIENTATION_UNKNOWN) return 0; diff --git a/drivers/gpu/drm/i915/vlv_dsi.c b/drivers/gpu/drm/i915/vlv_dsi.c index bfe2891eac37..113129996530 100644 --- a/drivers/gpu/drm/i915/vlv_dsi.c +++ b/drivers/gpu/drm/i915/vlv_dsi.c @@ -1650,6 +1650,7 @@ static void intel_dsi_add_properties(struct intel_connector *connector) if (connector->panel.fixed_mode) { u32 allowed_scalers; + int orientation; allowed_scalers = BIT(DRM_MODE_SCALE_ASPECT) | BIT(DRM_MODE_SCALE_FULLSCREEN); if (!HAS_GMCH(dev_priv)) @@ -1660,12 +1661,16 @@ static void intel_dsi_add_properties(struct intel_connector *connector) connector->base.state->scaling_mode = DRM_MODE_SCALE_ASPECT; - connector->base.display_info.panel_orientation = - vlv_dsi_get_panel_orientation(connector); - drm_connector_init_panel_orientation_property( - &connector->base, + orientation = drm_get_panel_orientation_quirk( connector->panel.fixed_mode->hdisplay, connector->panel.fixed_mode->vdisplay); + if (orientation != DRM_MODE_PANEL_ORIENTATION_UNKNOWN) + connector->display_info.panel_orientation = orientation; + else + connector->display_info.panel_orientation = + intel_dsi_get_panel_orientation(connector); + + drm_connector_init_panel_orientation_property(&connector->base); } } diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 47e749b74e5f..c2992f7a0dd5 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1370,7 +1370,7 @@ void drm_connector_set_link_status_property(struct drm_connector *connector, void drm_connector_set_vrr_capable_property( struct drm_connector *connector, bool capable); int drm_connector_init_panel_orientation_property( - struct drm_connector *connector, int width, int height); + struct drm_connector *connector); int drm_connector_attach_max_bpc_property(struct drm_connector *connector, int min, int max); From patchwork Tue Jun 11 00:22:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Basehore X-Patchwork-Id: 10985723 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7BE5E13AD for ; Tue, 11 Jun 2019 00:24:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B6EB285CB for ; Tue, 11 Jun 2019 00:24:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5EFD328702; Tue, 11 Jun 2019 00:24:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0A879285CB for ; Tue, 11 Jun 2019 00:24:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=H1f7i+ndFpksKLCrEB2JDOG/dP+ESTQjK5Qlc+zMnEw=; b=R7Ro+1kwdhpG0Y LtEkKc9EeQOEZPWhTKxIXh8BSbZSdeKNKobSGbxc8D+k9i/KtLN4GFe2z9o6HTiFZF4cFActG+Ctz 1W0nMXvKFd03JoYuVHq6IcNzBZA3oGRmQwIXp+HI2laCG56srXxrqSICfk1E43itXyJN8Ca4ha1a6 UjGkC24cOqp+lEZ3LpJVWYEfk94M2ZjWaejFzcR+Zy+4rWh0Om1MpwR55qMzvj7h2+6/+DYyfbbM+ WX0tp3o/v2Ift49oioRdjK6/7fXKN6ZCK/o975i1/fNxmPiNxavgscV1V+I+3HjrX+Iz8edLc0QbP 5TJFmHVzWZo8RdZNhzuQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1haUau-0005yx-Ca; Tue, 11 Jun 2019 00:24:56 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1haUZD-0004Pw-FP for linux-mediatek@lists.infradead.org; Tue, 11 Jun 2019 00:23:13 +0000 Received: by mail-pg1-x543.google.com with SMTP id d30so5886415pgm.7 for ; Mon, 10 Jun 2019 17:23:11 -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=M8dK47yPhynvSehskkuhR0uoKpp2uUP0x/D6+OPbrUg=; b=f8RsE3S/kfdDH6v5icBqkYxG44gp7sMpthCwyaqeVVv/htgQ5HpcDI6Wv0iU/zWNcb oatVGJ4axZtIjvktwE9gYtDNHp4sChejjwJoasvq2NwX71M8H6s0JQby/OGPhBngYau6 PLZre9cxMKoOn5+neuim6KE3BHgm+44DhuGtg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=M8dK47yPhynvSehskkuhR0uoKpp2uUP0x/D6+OPbrUg=; b=K7a1YYbWo7vsCViGysDRD2lRo32Qg3Po+B+lcTyonRle1SECsBZj7MGIa/HqHHIZaF w5o4FoF0UMq4WfAxCn4FV6/TFAuxOHKm7201FZ/2nNRMnMmgo8GlGEhXt661oTOxbcqE fjXHUYR55yOGWgVTHi1gAp+MQnTwNRdODaFukeNF0maoq6fKmLbjH7qhwxFg7XwmemLc hhpC0j6uy4XVuhbE6sK/8AaxtMfz5k+jfs7n2cT4N/0+yM47Zd8gsk+L9FtaBXaz3Vs+ uIYesa8Y/1yreUgf+ogYWhLSArc8id8Ys3AMEc5PPGfN7b29eh5Os9knb5vbMb0lNO86 wGGA== X-Gm-Message-State: APjAAAU0xcgENJt0tfcg0BCE8VO8p87OEi5NrFRdJJ+Y08bM4P/A18/W LKpxfK8TtrgEeFCjpkj6SB75Yw== X-Google-Smtp-Source: APXvYqxgskg5maq+JeiMbuvV7nLdRyi6nn4eQ55SV9Rs1d3bhqZcPjSw0Twk7BzvTbHKQzN5RyBSvg== X-Received: by 2002:a63:8249:: with SMTP id w70mr15859377pgd.33.1560212590903; Mon, 10 Jun 2019 17:23:10 -0700 (PDT) Received: from exogeni.mtv.corp.google.com ([2620:15c:202:1:5be8:f2a6:fd7b:7459]) by smtp.gmail.com with ESMTPSA id t4sm540317pjq.19.2019.06.10.17.23.09 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 10 Jun 2019 17:23:10 -0700 (PDT) From: Derek Basehore To: linux-kernel@vger.kernel.org Subject: [PATCH 5/5] drm/mtk: add panel orientation property Date: Mon, 10 Jun 2019 17:22:56 -0700 Message-Id: <20190611002256.186969-6-dbasehore@chromium.org> X-Mailer: git-send-email 2.22.0.rc2.383.gf4fbbf30c2-goog In-Reply-To: <20190611002256.186969-1-dbasehore@chromium.org> References: <20190611002256.186969-1-dbasehore@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190610_172311_618348_ED4D3BC2 X-CRM114-Status: UNSURE ( 9.46 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Derek Basehore , p.zabel@pengutronix.de, maxime.ripard@bootlin.com, sam@ravnborg.org, intel-gfx@lists.freedesktop.org, joonas.lahtinen@linux.intel.com, maarten.lankhorst@linux.intel.com, jani.nikula@linux.intel.com, airlied@linux.ie, thierry.reding@gmail.com, matthias.bgg@gmail.com, dri-devel@lists.freedesktop.org, daniel@ffwll.ch, rodrigo.vivi@intel.com, ck.hu@mediatek.com, linux-mediatek@lists.infradead.org, sean@poorly.run, linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This inits the panel orientation property for the mediatek dsi driver if the panel orientation (connector.display_info.panel_orientation) is not DRM_MODE_PANEL_ORIENTATION_UNKNOWN. Signed-off-by: Derek Basehore Acked-by: CK Hu --- drivers/gpu/drm/mediatek/mtk_dsi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index 4a0b9150a7bb..08ffdc7526dd 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -782,10 +782,18 @@ static int mtk_dsi_create_connector(struct drm_device *drm, struct mtk_dsi *dsi) DRM_ERROR("Failed to attach panel to drm\n"); goto err_connector_cleanup; } + + ret = drm_connector_init_panel_orientation_property(&dsi->conn); + if (ret) { + DRM_ERROR("Failed to init panel orientation\n"); + goto err_panel_detach; + } } return 0; +err_panel_detach: + drm_panel_detach(dsi->panel); err_connector_cleanup: drm_connector_cleanup(&dsi->conn); return ret;