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: 10985707 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 2A44613AF for ; Tue, 11 Jun 2019 00:23:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18EEB285CB for ; Tue, 11 Jun 2019 00:23:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C9D828702; Tue, 11 Jun 2019 00:23:36 +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 A61A7285CB for ; Tue, 11 Jun 2019 00:23:35 +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=zkq7dbOUF4ugKvZhjmX7Yt/j+SI9h20AGxutB3Hkdhc=; b=CO3/S/WZzdyNgo kK2sxhZTVBDCvPr6NADAJpAe8LK6ZJi1N5mCfCB5wOqqd3H5d+Tz2KgmYVf58Bt1CBfAAUhnU5chC wbrmdblNHx/yqNSwqbhfHzQPsHRFxIeDLgtEnopviHIJTf29tZg7nQ5SkpTLTZbJGO+r7KDEj+D7V RobKXzXPvWBkio5K8Dqj3uuLgllqednZ1J7xBlEbMj7u94eW3y2I4hg+myzywExlb1Tk6eAAVTeHj xyy7VLSf2FbfkcgRk9fd2rU4VqkMoDcKJu5sd3D7wgulDnBOTi0WxjE3pPMMLo5Bjjspm79O8nXbU A3bWYJyv8H7v4u9if7NA==; 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 1haUZX-0004gz-3q; Tue, 11 Jun 2019 00:23:31 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1haUZ8-0004KX-IK for linux-arm-kernel@lists.infradead.org; Tue, 11 Jun 2019 00:23:08 +0000 Received: by mail-pg1-x541.google.com with SMTP id n2so5876116pgp.11 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=PYy9gCj885biO+iFweoYEIm5PtaG7dhiDZO4XCqbPZm5YHsFRyUV5y63TSpqfcykrb Pfn/kEUE7IeqjEaDSgoKOw7TQqUrTT/+FspFSzW1yRG/ujxQ8RVglv61sFplFJvRXUwK 6AcGPtWFs/ZbsxdjwiwBLpu8m8crjovcSDl8koDkwR994A2u//0oBxBeNifFQKduyH79 msSDx4BNYZ/kloAEUWLE8BQgZJZ1IgGTzwzIzj9661wBuHqN4w2Y59USDYgen5kk/pec rvqs3Gh94aqqcO38cOW8ZZtXAaqVk7DlKFyT8SdO4sKcYu2PDEipmJbOfJLGBKgfP4/J 1NiA== X-Gm-Message-State: APjAAAUJEcK7EHJwPBXQfoh2gWOPXc5KQIaW0DS4ELOPwdT8uY0B+3VG 34hRRI35J2LtsiEnihOaz8ng7g== 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_623783_9BF6D309 X-CRM114-Status: GOOD ( 13.58 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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: 10985709 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 54DAF13AD for ; Tue, 11 Jun 2019 00:23:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 445EC285CB for ; Tue, 11 Jun 2019 00:23:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 35D2428702; Tue, 11 Jun 2019 00:23:50 +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 D7704285CB for ; Tue, 11 Jun 2019 00:23:49 +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=cOAizeajip4I49w2o0O3vfzTxaoVOXpJus5h1LIOuhE=; b=HrBcyBj5fnl+7D AfoieaedZQkNry29QL0D+KSQLPjKuxErMvputVqP9Pm7rSJyau5BoJXYcKC1s4dRolnwPyWbqOYRL AJHQocyumg/4ThmXTOHq2ikB3SJwYjp16xYZ2nbHiIdqy9IEyezgbvef0UXWcmUmUp79f9W/Z/SG8 kZzG6FYDf5eB12weXwd4Ja5g8hTbaeqwRKI4QZANuFXVLlHL0usxciJpvFPHZqmaK1OuOtVE+wvAC kdv6m6sNc+LgUuevsXENbuD9KQxE/VZRJfDMb3lVEXU09rbMTLFW8bsITZiRq1isR66NFn1+y94SZ QDaTNYDKG3a6cC58wXVQ==; 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 1haUZk-0004uV-M4; Tue, 11 Jun 2019 00:23:44 +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-0004Lb-SE for linux-arm-kernel@lists.infradead.org; Tue, 11 Jun 2019 00:23:09 +0000 Received: by mail-pg1-x544.google.com with SMTP id v11so5886226pgl.5 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=TyfSb8LpVkOAjU7sQ5kWgfBkVlyls5nvbPJblwsxh6rzNgY8OwVbqFBoII9unSAhg1 4Ft2LKaTKbUZmGUwePjnjF2BZmsDpZ0wkvEsHBw7ipdXh/htd8uuUYl0KojvfNrS2Kuy p+/QxMSLowhWM/0DpN5SLPukaBZ8Uy/NAXwDcXGfTKgxJCZ5DAsJPKDKMCVI7H0gioTf c98xvw8VocExrRQxKOoG7pzlbHgTJ4BTVhuWtLnduWmOvDQzQG6Z9VXA4okrGS7ifIMO 5Hn9qQmKl5UHs1Zc0GrQuWk3ffNR2rA5w8M6ndSY8BfSozQdI6vJQ91pakaf/p2nBIxU QUdA== X-Gm-Message-State: APjAAAVL4DCL8zp9+drr3GYpKO3vbcGtEzO5lZNN2Y2P1XbDGajDqDhK HVJR/Q/LlPU0Ci73otebu3yykg== 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_061703_A5E4FEE0 X-CRM114-Status: GOOD ( 11.17 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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: 10985715 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 1CF7C13AD for ; Tue, 11 Jun 2019 00:24:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C3B6285CB for ; Tue, 11 Jun 2019 00:24:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3B5C28702; Tue, 11 Jun 2019 00:24:11 +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 9C6F6285CB for ; Tue, 11 Jun 2019 00:24:11 +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=Ac4Zq4pCTbtSWS8b3Oi2ngcXO7+7gfwtK50R0pjweY4=; b=VtTwU86VaCHSB/ io+O0NIFIbQ/AzPxyPJXRotY3RILBmitxOY4zU20jB5+pDEO2hSVk+qPcnqXq1OeslGXUzu8vHycS uXeeX8hTGd1pspMIHshTKY7oewmzigfKJAcUDkH7oFvg+gNhZlZnwkog3BqHjempzqnu/jrpZY9AL mtx8FaQuw/X3BvKuC7dDXGMEL/Wr7wCXkKp2p+tR3stNGCphtXlGv8ymVEdTBh7evYnSwjMTViZ1F lzPSZ9TjVmjqTm7NOXKUEZ16xC0IFxKQ9Nb7XcPRNY0BE18LumFkvgqpjtp1YUIh+xbApEKcxP6H7 arnCa1Z6J50CvL60q1yg==; 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 1haUa7-0005EO-FN; Tue, 11 Jun 2019 00:24:07 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1haUZB-0004N3-1z for linux-arm-kernel@lists.infradead.org; Tue, 11 Jun 2019 00:23:11 +0000 Received: by mail-pf1-x443.google.com with SMTP id 81so6219948pfy.13 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=qCEi9v7lLiPR72KG+Cq7FhwVPeA7gaPM8CXWy95OAUiRcR6AL127gBDGcf+rORkw5F KMMNXGpjykvYg+PwUmSKBkvWOlWaMVm2nRRdoCj2vNyNmucUkCexEFM3lvJTc1RhwTxi BVzUuxuf22SBETUCLzltCnlilRVjh4eRW5uZz18nZSxJPeSpBMI2oBogZELQqW7GDmMo c9oq0NktQMQcP7cW/sUUipxZgQ/R+0gXmS1gYnSQA97P+lIVRO1WTYPypfU+DSIevJS7 jJcoxWxFQBEwkz6nDAqMZ2McFcwhtAjqdP1kVVFcz5YHXQPclfS48QaTUkHSD8CSUyH1 /Ceg== X-Gm-Message-State: APjAAAWTPx9cSpAaAnL14mvM9/Iiv1jAJTK9zwgOLj1fm/2qZGfqh/0q YZZ5oq1XdvfmAwZnTjgap6G92w== 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_224108_C953F9F2 X-CRM114-Status: GOOD ( 13.48 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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: 10985717 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 E45B313AF for ; Tue, 11 Jun 2019 00:24:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3EA328704 for ; Tue, 11 Jun 2019 00:24:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C556D28707; Tue, 11 Jun 2019 00:24:27 +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 560E928704 for ; Tue, 11 Jun 2019 00:24:27 +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=8+nAhNV54rTRQT9OCYgXLn0nPva6IVjY2JlHLwK2Hg4=; b=nw/pBrioWyB0ZG T/aIQ/uoiaiQbECwYYXl1BmD1uSz5wQXC95Dp+ZEmUNogSp2QN52n1lmwkYYbJKDIAJezv2cvZJ1t BzmNToJrJnlzFzvbrACh+Z4K8tcpUqk7rFlR6hgeRLrHPCl1amSz4Fb1eWo6M/FjdFl7pUbtsr/4u ptVGMaZZ0TiudqIxcFa12pFVC8jWyV6IY/X2HO9wJ47k3szs7dN1y0YUhVVvMUOpZEAXOak4SgiS6 ovR5LxciJWo6TjA58SKih+n9g1VKP56nkS5RFXSh7tk4MEHIq+nkwty573zquY+biTa0twofFfy81 AnUvXqFdt4gj1LERdH2w==; 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 1haUaL-0005SL-22; Tue, 11 Jun 2019 00:24:21 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1haUZC-0004OM-G1 for linux-arm-kernel@lists.infradead.org; Tue, 11 Jun 2019 00:23:13 +0000 Received: by mail-pf1-x441.google.com with SMTP id i189so6228336pfg.10 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=Id3CUn9T+0vSDO1P19nX+UNh0zChr9f41kkgyGJhtckhX7ANvghXoBFvFKGIzr17na Vh4wN84ZUoKLYYxTDrbNy/McIG9q5kk4HV/suMkU6RUkebi05/ZLnL5qnbZOlMPmpX2y 4x7crW46prCBdAZZ2UMIGNMY2fR3aHalrARwyckASPnMQq9wiVAGLoTG7VtYeYjrPWXu 2RK2AP/3/KqFt8t2OTXrf5RWCZYHemNTok8W8nqJEyBKBfo4S+mjwz9FARzGvCyNlov5 1b+IOsrhk+e+uD2r7mJtIl6J1mW8QMh9joH2iJ9pmbtrLpp33aivtOPMOSuO4DIJ1VLY zfKg== X-Gm-Message-State: APjAAAXU431xv3kzrflDHiojoBn1wuAjQXdmBHXb2dEOIv8AEQOpXZ07 XOqPNljHZGas33MPI02XTFfaCg== 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_645788_76AAD069 X-CRM114-Status: GOOD ( 16.04 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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: 10985719 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 DBBC113AD for ; Tue, 11 Jun 2019 00:24:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBDEF28702 for ; Tue, 11 Jun 2019 00:24:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE99B28704; Tue, 11 Jun 2019 00:24:44 +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 6BEC428702 for ; Tue, 11 Jun 2019 00:24:44 +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=B5hF4GQfMmnKAM3M8VFDpPaDv3SnDxz9YPMubYs4Wm4=; b=jaXk1/02X/GqTu uqlBRuurbKwBvgFwh6ErFcUSI0GpxM6cDhxD21tkALEUevagpG4WlHI17jHEGBUFvi51wrd2LnuST KjdSwJagbKG8GjnAMcB0WyVCIUmPUedgQ4n5lgEXYBE4ZAGFn9bfNXM//NAXiBZFgD6yjqW4Q6tcM WdUbfjo3Jl9VStxQeyOW1vY8XLa/ifP2csWopJTSq9a2Yhmd72dqhOIs/cJUMs5J1J2EbtW/6mcp6 X3I4yzRYmy3s/M8i2iDTgPtIkNXXM0UsLXvRzCyMYFnCOyqVtUq53VUQns0ytmDKgYXFF4IkSNOX5 ISRAwA+pnTN9z//IpmRw==; 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 1haUad-0005gn-F5; Tue, 11 Jun 2019 00:24:39 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1haUZD-0004Pt-Hi for linux-arm-kernel@lists.infradead.org; Tue, 11 Jun 2019 00:23:13 +0000 Received: by mail-pf1-x442.google.com with SMTP id r7so355978pfl.3 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=XFXdpBdF0eqZ0ftUQAzYLVlyKZGgDlUsLCjSPyZJuAKFlUgHCc/eutNHbOohbc3emE qtOFRUUIG83gz5ufasQ6Mc9jA1ZnsW0OecW6djKQc+0cVjBI1TDgnXkUB8+101eJq01x DXpEMUrV2VCzWE0ufeox7z3eXll1gN6Bb2UrxAu2KPKUiNp6qOKl5CeIqEWzrmd2vvUw EcBZcXDnkC1sRbx6EaqxYmwWMT6Mrms/oQvjx0P2A/EmC/NmbkT/ABd/Ep0y+B3rFUKv oaw/9A+Q3QhgyVbxy6u6M+oFOLZhvkiGXMEozuHBt9EloMomD6grt9q1e3JeHULtVZ8m IsQQ== X-Gm-Message-State: APjAAAUC7/zuoiR6/hdsuS/jfh2gCrn4QJC1kH+xp4fMGVTSpWTVgSDH 9A5AqFNZ3Ie/eHvHlH/QopVfbQ== 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_628176_5398E5F8 X-CRM114-Status: GOOD ( 10.93 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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;