From patchwork Tue Jun 11 04:03:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Basehore X-Patchwork-Id: 10985855 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 EBD6113AF for ; Tue, 11 Jun 2019 04:04:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE34827F54 for ; Tue, 11 Jun 2019 04:04:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1292286C1; Tue, 11 Jun 2019 04:04:32 +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 7D57027F54 for ; Tue, 11 Jun 2019 04:04:32 +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=ZEptRpFm6w7dSK qNQZIT3PcQLRpFeBJOC9xesHi2fcrCxrSU1gNY6dMHM16PsVui27OOIiwKzsYAlkYfnjlggreWydh 764nohf3yaLp1EgNvuwZX6f6BbAf+0kRegWWVlQICEQh/R2dVvKJaSfv1M2Ux9n3d58HDLA3shHt2 zS7lSEbb2xgOHSQkAMcHGzWNwiLZlkDAxijf9BE2ruxKKHVW6LRPxdt36+VZU2CH3FSUeJtb5QHb8 sWFj/utjrVjvcYV9Qc5mbT9DDSzP83tDPIWYsfuYwm014WOA2Ehl18NaXizg6RC0tlHnDu1AM2E7O KA1nRhXxUZ3PVMDjaObw==; 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 1haY1Q-0006Dd-5c; Tue, 11 Jun 2019 04:04:32 +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 1haY0q-0005gS-Vs for linux-mediatek@lists.infradead.org; Tue, 11 Jun 2019 04:03:58 +0000 Received: by mail-pg1-x543.google.com with SMTP id 196so6161134pgc.6 for ; Mon, 10 Jun 2019 21:03:56 -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=KXrCMiQg7a3OfPUXlEJ0jxFjUzyZmNjg7jLQ3vlyHvu+/ZoYFywdDn0CYhVxJ6210H Be7ENhzB8haIWSJaAFOqD/im/zV70ZC09Z+ulYwJ0v3pb2/30T9ccgBbFuxxbqyb4Sb3 F8SC9XyvrE2wKX+6pwO4Kc/M8q4p4YESBKAMI= 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=RY3QARCb0rbSCty26SMCinifqUhJ8PCzWX42ib4tMuYhtFxpTOwF4VtItToVnq6Cye FBy7aEUKXnle1ORpsljrIypu0XO6l3aV9Gq/vKRW7IvPWvqg2bm2kG+evvnGzq50LpS/ Hj1kw+ya55DGLXzie9Cqsgs1WAUhWTmc9EYVgCyN7bjXNGbLhJ7vTp9B8b+mMKIWa00q WdhLmNG4zP/ifVF4sMuJ8K2C+bYpibaLgHuzVBAJn8kcywl6D9FVb3SilSwuvaM5WzA8 z5lK+GHkEEj5dQM2o+gzlZL/N4wke7OgBeTQ1/yOsbmIA4Kk4/C2w+o7d+wKvQ6qNuX3 bQRg== X-Gm-Message-State: APjAAAXu4KmvhY9RE4eLJcyR6IHKdCkYjxyiBsu+WVhr1OdpnUDye+Bb 6yFob3BgP8d30I0Sv3YVQ6oBtg== X-Google-Smtp-Source: APXvYqwobTrT91p21YyGnsEse1+RxzZxvnHAKh/XjPiTdvWC3iFSRE8s82N6n3Ie7F+FBFdVUvCVAQ== X-Received: by 2002:a62:ce07:: with SMTP id y7mr49658309pfg.12.1560225836465; Mon, 10 Jun 2019 21:03:56 -0700 (PDT) Received: from exogeni.mtv.corp.google.com ([2620:15c:202:1:5be8:f2a6:fd7b:7459]) by smtp.gmail.com with ESMTPSA id y133sm13301185pfb.28.2019.06.10.21.03.55 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 10 Jun 2019 21:03:55 -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 21:03:46 -0700 Message-Id: <20190611040350.90064-2-dbasehore@chromium.org> X-Mailer: git-send-email 2.22.0.rc2.383.gf4fbbf30c2-goog In-Reply-To: <20190611040350.90064-1-dbasehore@chromium.org> References: <20190611040350.90064-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_210357_024648_D59857E2 X-CRM114-Status: GOOD ( 13.87 ) 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: Mark Rutland , devicetree@vger.kernel.org, Derek Basehore , Philipp Zabel , David Airlie , Sean Paul , intel-gfx@lists.freedesktop.org, Joonas Lahtinen , Maarten Lankhorst , Jani Nikula , Maxime Ripard , Rob Herring , Thierry Reding , dri-devel@lists.freedesktop.org, Daniel Vetter , Rodrigo Vivi , CK Hu , linux-mediatek@lists.infradead.org, Sam Ravnborg , linux-arm-kernel@lists.infradead.org, Matthias Brugger 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 04:03:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Basehore X-Patchwork-Id: 10985857 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 87E3014C0 for ; Tue, 11 Jun 2019 04:04:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7804427F54 for ; Tue, 11 Jun 2019 04:04:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 692CB286C1; Tue, 11 Jun 2019 04:04:38 +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 1268E27F54 for ; Tue, 11 Jun 2019 04:04:38 +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=O6cQY8OSmUREU4 jcCvPu3ayyf9iPFPYXcu96cJCxI/wVoOdJBCWcyZllCMJmQ1r6+tYZJ+JmiZqrP5rCTgkTjH8nR0p 140MwP25Q/4KjXSqTXPnu3jwyDfiW1347bzGBHkIjgJXRKlQlXMJJpYygxbFZ4MnDW5bHDDv0Y3/X ti2Hh8fGf0FDLlJKshInGHVaXopcBdoQJjvQNsUYKm9wT9TsxBs5cRC5d2u8Gmw+yjg2Xs4lJHvBm PWU7weu9h3R0U3cW5YaUjHFz5Rnp435Cqcc3aq+/9j8kqu1mLCXGEdGpVS1abHqpbs0I/230+x24C I4xAijOdHrEyIaI0ZTlA==; 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 1haY1U-0006HD-J7; Tue, 11 Jun 2019 04:04:36 +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 1haY0s-0005h8-2M for linux-mediatek@lists.infradead.org; Tue, 11 Jun 2019 04:03:59 +0000 Received: by mail-pf1-x442.google.com with SMTP id r7so651878pfl.3 for ; Mon, 10 Jun 2019 21:03:58 -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=NpIiYZAZ293e5siqen5Oz27pVJuQEiqx/skxzzgF9MmBRxj1DCy5igwLq3xQY5fLt4 6ijSQMHl5nqD2CEkVoKO7bNwFt2FMABbPicsIoQ+6XGy1CrK43ONHRMIiygoP/GBi1Tx mpT3cNIEtjV+ei2btpQJ+tOS5TF+m8OjwvjZ4= 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=SRxa0FpKbBMfh9ih2wRlHqcfC3LA2DouNnkTLEGOE7MEoUlizGmrepNU6l3aNNxCd2 wLKcjJBTjoMzx3oKyJEpPlt/ahBWZ+zP6BlW25mgIkvfsIBK2KMWjuBcjBBLFYUt9uRB qkF9oavL9D7IcRK+ApOjfPOzxsP0BWG/hb2e+6PgcToiJg9bwD26tR04wd46BiOq0sEf 1GJFEdtxZxgT98PkI54W+CP1IY/0uSeapMbYJvisIxe47nuZKnEzNc43KOEmLub2PHrd DerUg0BOqWUXxxzALk7S9tkKRW8Zrz8Yh/3LewGzBfug5WgqYENRxOsLYf4BkLfBDuhD qPOA== X-Gm-Message-State: APjAAAUA8YzKxyiQkZqYKbaK7ZzFE+CTgcfjztoFHKkRlLDn57HgMxGt u6vquC9476c66VAAtlTnQ9L07Q== X-Google-Smtp-Source: APXvYqztkWgDwmpShVmNY3JX/yoLvhlQG+pv1dg44RWOiGpLZ5kd7o3wLJ474CqYq7S74tPbVuKsCw== X-Received: by 2002:aa7:825a:: with SMTP id e26mr79303252pfn.255.1560225837698; Mon, 10 Jun 2019 21:03:57 -0700 (PDT) Received: from exogeni.mtv.corp.google.com ([2620:15c:202:1:5be8:f2a6:fd7b:7459]) by smtp.gmail.com with ESMTPSA id y133sm13301185pfb.28.2019.06.10.21.03.56 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 10 Jun 2019 21:03:57 -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 21:03:47 -0700 Message-Id: <20190611040350.90064-3-dbasehore@chromium.org> X-Mailer: git-send-email 2.22.0.rc2.383.gf4fbbf30c2-goog In-Reply-To: <20190611040350.90064-1-dbasehore@chromium.org> References: <20190611040350.90064-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_210358_115573_4AF81F43 X-CRM114-Status: GOOD ( 11.27 ) 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: Mark Rutland , devicetree@vger.kernel.org, Derek Basehore , Philipp Zabel , David Airlie , Sean Paul , intel-gfx@lists.freedesktop.org, Joonas Lahtinen , Maarten Lankhorst , Jani Nikula , Maxime Ripard , Rob Herring , Thierry Reding , dri-devel@lists.freedesktop.org, Daniel Vetter , Rodrigo Vivi , CK Hu , linux-mediatek@lists.infradead.org, Sam Ravnborg , linux-arm-kernel@lists.infradead.org, Matthias Brugger 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 04:03:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Basehore X-Patchwork-Id: 10985863 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 20B6D1515 for ; Tue, 11 Jun 2019 04:05:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FE3A27F54 for ; Tue, 11 Jun 2019 04:05:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0270328682; Tue, 11 Jun 2019 04:05:25 +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 974DD27F54 for ; Tue, 11 Jun 2019 04:05:25 +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=pU0gl9hsRm5pKX SZ3zbKBpETQHTRQ62k6Dul9XGs8+AQlEwQ3uYMVy2WMdwZrayuvj/mU5VSHqhK6Q3Irymd7pCacmS CJwMs5Gm5me28gjvRzBhSq2+X+7jnRNfqabXI/vaE9JtK4eGyyjUftCqfmS+sHhoH1X+X9WUunS9p xvvcf82S8kEUyslPWtRsjHCfJ6xpdwl9jv6+FZQZiq3sYPGRVm6kciaXrKlenuUPhPFgS1ypEyD7d A9ftddi/uQeeWX4yASzwNui0DfNMA9cJKPlITR757pFCsofOCVAsRlUExUcSCa99fnn70f0XSiOgV SgnTBJX66X6OaU2gz/MQ==; 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 1haY2G-000820-Ry; Tue, 11 Jun 2019 04:05:24 +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 1haY0u-0005iC-1W for linux-mediatek@lists.infradead.org; Tue, 11 Jun 2019 04:04:01 +0000 Received: by mail-pg1-x542.google.com with SMTP id n2so6144464pgp.11 for ; Mon, 10 Jun 2019 21:03:59 -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=LeWcjnR+t+om64koZ6/R7cE71bujGm69PJfYXHwBJFGIEBgWa3nQCcjJskR2SOqfDx 8FfVoU3o/Q7/B8eVi0j0M5VdkxdYsRjGxHm1O2i+Ynte0IiaoGGgyiP7Srs/0VHfY8pZ GoyR+VQn83u0DFekQcp1z2sEX3Qkb7x/WEOsw= 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=NIqGiBJ3pv+U0Dy5CWrGT0sH39kjwYPuiE8Sm6QaOBRTv9OLaOI/7MXjBFXpDhH3/N ajXi9akO7SyYMa5lmThRnU966Hp6g2jlditeUx90MbDi1T2d4+Euc2L98nvrAtYNjG7i m1I6aIHYwiptnoyz7NQMMMt7BNu5Hm5Na8+37evs3y4xhE+CVUJMpNu2OwJCqZaK6tDM g1m+SNthVM+nFCfaSktRNkWoe+NgzG9CYbyAuA1rS64ywFJX7lD67uj557B1zU6SoGYy 2YIe9VJywmfCAIFFvEc3unRBKucpCs4Zdb+smmWukwvX8fy+wif4W2y1Ga+Rv6x31E2Q KXNQ== X-Gm-Message-State: APjAAAVXp6+F0rv5KN0fkGwuNz+S5bmFwe47bvXdRB3hGf7SFMwqHtOR SStjK+OqOJueHlZfuTAMgCUBsA== X-Google-Smtp-Source: APXvYqy0yKQ/QJLsix4wmZz0w/0FdG7kg5sb5r7IYIEYAuT2TlsU8kQWgPqPuvCd1Bz2CLqyUw+bZA== X-Received: by 2002:a62:5883:: with SMTP id m125mr15522265pfb.248.1560225838902; Mon, 10 Jun 2019 21:03:58 -0700 (PDT) Received: from exogeni.mtv.corp.google.com ([2620:15c:202:1:5be8:f2a6:fd7b:7459]) by smtp.gmail.com with ESMTPSA id y133sm13301185pfb.28.2019.06.10.21.03.57 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 10 Jun 2019 21:03:58 -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 21:03:48 -0700 Message-Id: <20190611040350.90064-4-dbasehore@chromium.org> X-Mailer: git-send-email 2.22.0.rc2.383.gf4fbbf30c2-goog In-Reply-To: <20190611040350.90064-1-dbasehore@chromium.org> References: <20190611040350.90064-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_210400_140890_B7A696A1 X-CRM114-Status: GOOD ( 13.77 ) 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: Mark Rutland , devicetree@vger.kernel.org, Derek Basehore , Philipp Zabel , David Airlie , Sean Paul , intel-gfx@lists.freedesktop.org, Joonas Lahtinen , Maarten Lankhorst , Jani Nikula , Maxime Ripard , Rob Herring , Thierry Reding , dri-devel@lists.freedesktop.org, Daniel Vetter , Rodrigo Vivi , CK Hu , linux-mediatek@lists.infradead.org, Sam Ravnborg , linux-arm-kernel@lists.infradead.org, Matthias Brugger 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 04:03:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Basehore X-Patchwork-Id: 10985867 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 E3A0E13AF for ; Tue, 11 Jun 2019 04:05:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D108127F54 for ; Tue, 11 Jun 2019 04:05:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C389F28682; Tue, 11 Jun 2019 04:05:31 +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 4006327F54 for ; Tue, 11 Jun 2019 04:05:31 +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=7VWdEJhfrpUnEaiShQxQFpcASr8j0n4ZMz8N2cly8fs=; b=NQ1oHHvCmMyR1M HozEQN7hsIPPH7n+JVa18LzTIc5tIZD71NC6SXsqdoypUoQUGYvlgnbPMMm/QzzUS0ZwLuD5WAKrv CWLHSdYD5K5LTdwpIvq+hE6qvuz9n+sC0tjPe4VGBujyD19J3Ba+m7Ebz8C1IqvA41fRQ6pq42pHC pvpXIhAC9AdUI7DLzhvrGgYJfOWG6wt84Im/fYcFldxI1lIMv6kXyWBVWz7mmMjsBqvXFd2Vk/b87 2Sj9Yrqlhc2sRGZcbQLYd3zN2sIZNiorLM2kClWYC5gkajEeOBhvyM8KyobtG0n8bQ31S+oO+Zqof EUZySt7vVC/THlucZxKA==; 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 1haY2M-00086F-RN; Tue, 11 Jun 2019 04:05:30 +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 1haY0u-0005jy-JR for linux-mediatek@lists.infradead.org; Tue, 11 Jun 2019 04:04:04 +0000 Received: by mail-pg1-x543.google.com with SMTP id l19so3555982pgh.9 for ; Mon, 10 Jun 2019 21:04:00 -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=PRf5zwh2omhJlMBygQXOHV94QlDCvtVP6qLo6sclvew=; b=hBI5kWhyOvyp1E+jRaOMnfLP/satVRSFRP8f6NRNyVUCGpgshs8WxNVYT2q0NV/2gj wPweK/9YAhTa7JtVa4YtP2wEqtfpY4oObASG+1jPXLuAcs6ScW9XvYt1hu3mmb1W4mC3 qnv5BgzYpqfI2qcra266da1Q0lOBymxK6SKqU= 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=PRf5zwh2omhJlMBygQXOHV94QlDCvtVP6qLo6sclvew=; b=WV1FZXYxxLhMrYAo861ONsZ9QxvJMchH+COLtLC2FwYHIbsLUzUbL1vba/gozALUNA EPlHRI6P1/a22wzqdVY88iVEqL9Gqa/ei76BqQS8fL1A60+5z+v1v0cXPtkJOzhsOkav BfeGjkROErspztMbhDu2NLWFwY6HR4rFDBGZJ6s7bDpwoA3Zj5JOxpx+qCNc0wXTIorW sP7PVaOLJIB1y2qxn2q6VtAMI8ob3HhDhS4wYr9kGJZN6YJYhtb1P5a1UXi34QxUEYVA Rg6SeOSYb7lDmliwVZLkTs7JcSnlI6ymk21P338tgmxoKTNxKuxPQ0MpppDZoEP8qIeF qoow== X-Gm-Message-State: APjAAAXS+2ZtBBZKvjaNlmt6mqOiP21nL/Irw+GvOyFqTjdedIAmfAbA o43bQ79hXCQkretRfZpdWk01mg== X-Google-Smtp-Source: APXvYqzw8Zl9pN/Pa5y81l8eb8hfV6D4yF7M05gc2/1u6/QOO7gYQ1T3DU+QBeRduFts4YBZE+xKeg== X-Received: by 2002:a62:6303:: with SMTP id x3mr62758208pfb.261.1560225840106; Mon, 10 Jun 2019 21:04:00 -0700 (PDT) Received: from exogeni.mtv.corp.google.com ([2620:15c:202:1:5be8:f2a6:fd7b:7459]) by smtp.gmail.com with ESMTPSA id y133sm13301185pfb.28.2019.06.10.21.03.58 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 10 Jun 2019 21:03:59 -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 21:03:49 -0700 Message-Id: <20190611040350.90064-5-dbasehore@chromium.org> X-Mailer: git-send-email 2.22.0.rc2.383.gf4fbbf30c2-goog In-Reply-To: <20190611040350.90064-1-dbasehore@chromium.org> References: <20190611040350.90064-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_210400_713144_8D43F501 X-CRM114-Status: GOOD ( 17.06 ) 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: Mark Rutland , devicetree@vger.kernel.org, Derek Basehore , Philipp Zabel , David Airlie , Sean Paul , intel-gfx@lists.freedesktop.org, Joonas Lahtinen , Maarten Lankhorst , Jani Nikula , Maxime Ripard , Rob Herring , Thierry Reding , dri-devel@lists.freedesktop.org, Daniel Vetter , Rodrigo Vivi , CK Hu , linux-mediatek@lists.infradead.org, Sam Ravnborg , linux-arm-kernel@lists.infradead.org, Matthias Brugger 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 devicetree 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/intel_dp.c | 14 +++++++++++--- drivers/gpu/drm/i915/vlv_dsi.c | 14 ++++++++++---- include/drm/drm_connector.h | 2 +- 4 files changed, 26 insertions(+), 20 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/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index b099a9dc28fd..72ab090ea97a 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include "i915_debugfs.h" @@ -7281,9 +7282,16 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, intel_connector->panel.backlight.power = intel_edp_backlight_power; intel_panel_setup_backlight(connector, pipe); - if (fixed_mode) - drm_connector_init_panel_orientation_property( - connector, fixed_mode->hdisplay, fixed_mode->vdisplay); + if (fixed_mode) { + int orientation = drm_get_panel_orientation_quirk( + fixed_mode->hdisplay, fixed_mode->vdisplay); + + if (orientation != DRM_MODE_PANEL_ORIENTATION_UNKNOWN) + connector->display_info.panel_orientation = + orientation; + + drm_connector_init_panel_orientation_property(connector); + } return true; diff --git a/drivers/gpu/drm/i915/vlv_dsi.c b/drivers/gpu/drm/i915/vlv_dsi.c index bfe2891eac37..27f86a787f60 100644 --- a/drivers/gpu/drm/i915/vlv_dsi.c +++ b/drivers/gpu/drm/i915/vlv_dsi.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "i915_drv.h" #include "intel_atomic.h" @@ -1650,6 +1651,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 +1662,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->base.display_info.panel_orientation = orientation; + else + connector->base.display_info.panel_orientation = + vlv_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 04:03:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Basehore X-Patchwork-Id: 10985865 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 B4C6B14C0 for ; Tue, 11 Jun 2019 04:05:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A609C27F54 for ; Tue, 11 Jun 2019 04:05:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9961728682; Tue, 11 Jun 2019 04:05:29 +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 4E22D27F54 for ; Tue, 11 Jun 2019 04:05:29 +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=mYYa56ihJTb5sZ wPY2lo5sEq4b3Jt2HbgByHzVqY5a348m4yi7FL1aI0adRIgUjQPWRsc4I4E8NExE2me7z9WfhnvNo OgLDMysLAsSgQfV+B9uobnPxNI+yGqqT6bXErvqb/623hq9qLsT89gRRLOBE+AliHJlPHQQTAfUXy BX5FAW5dzpKy+ipQULjIjvf3Uzs4XbRWr92XT8RKv5biD8WkfaZ49ROJm89zvxGF6cG/qPnBg3AFl N8DjP+KczCw8lYAyKnBGzZwxabi7VnQ2jYvZRQPAOu5BOn1rPG7PRdbD1CoQcpShIRAkpsHhhg2SC almcSVq0K11y1xtdY1kw==; 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 1haY2K-00084M-Ps; Tue, 11 Jun 2019 04:05:28 +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 1haY0w-0005lT-1p for linux-mediatek@lists.infradead.org; Tue, 11 Jun 2019 04:04:04 +0000 Received: by mail-pg1-x541.google.com with SMTP id p10so308780pgn.1 for ; Mon, 10 Jun 2019 21:04:01 -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=CcUYJwRYFPcbjY4eu0n/t203Kb6yWjUPmTkt3aooyO0UUZofpy4cpboC6TwF076Ios ZWILIMTCOWl4KnH2TWGccw1JJqig6+YYtxMUTrG3nlZqucwadYAgNXi6pGreSG31TIXb RJFX+AUwh7s4gdYWU+Ew7z54dQtjsrzL7NH6c= 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=KRR1oirRNB2KvgNDiImJMxCMd+9si3Pgo+Vh7CcojKh2tpBfABMeirXCjuFhFb54O3 utlkNV77/LdYZBtFVOewWomn9WMJir9+Mx0q8y/bSm5Zbn9OTKBB6wl2Gbtwp0z5qLtn kXi2uhbLppHHu4nSXwCXrzg5R8BF555yD258hmCoSqOT1bgnITzvBEZhsp6qGlxqdMe1 /HHsyHxY1wQvY+2uSSm9VsP47QWUKQ040qJUmtL2C3pgteFnO54xR9mSAsLUmp1t9yac UmsMQeH8+ea8njR/Mo2yHborkCyQcbS8FiQJ9rebM9PocexHXGvhI/9DUD5MJ8mceZ0M cRLA== X-Gm-Message-State: APjAAAU7ObploLEdZq+Wf5qQBP0AUe7dtT+bjUOgh5FH2V8UlnQWExz8 jKM0FbeNuGPyK3jhn9aWjZyBjQ== X-Google-Smtp-Source: APXvYqzfYIuckJzyOvuDvYV3JLxaoW5r0AK9O0deBBd8fMs6LODhYT7Aj2K7vKmQFzwpcjHKS1s46A== X-Received: by 2002:aa7:804c:: with SMTP id y12mr76278547pfm.94.1560225841344; Mon, 10 Jun 2019 21:04:01 -0700 (PDT) Received: from exogeni.mtv.corp.google.com ([2620:15c:202:1:5be8:f2a6:fd7b:7459]) by smtp.gmail.com with ESMTPSA id y133sm13301185pfb.28.2019.06.10.21.04.00 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 10 Jun 2019 21:04:00 -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 21:03:50 -0700 Message-Id: <20190611040350.90064-6-dbasehore@chromium.org> X-Mailer: git-send-email 2.22.0.rc2.383.gf4fbbf30c2-goog In-Reply-To: <20190611040350.90064-1-dbasehore@chromium.org> References: <20190611040350.90064-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_210402_448521_AEC13309 X-CRM114-Status: GOOD ( 11.23 ) 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: Mark Rutland , devicetree@vger.kernel.org, Derek Basehore , Philipp Zabel , David Airlie , Sean Paul , intel-gfx@lists.freedesktop.org, Joonas Lahtinen , Maarten Lankhorst , Jani Nikula , Maxime Ripard , Rob Herring , Thierry Reding , dri-devel@lists.freedesktop.org, Daniel Vetter , Rodrigo Vivi , CK Hu , linux-mediatek@lists.infradead.org, Sam Ravnborg , linux-arm-kernel@lists.infradead.org, Matthias Brugger 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 --- 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;