Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5026913yba; Wed, 10 Apr 2019 09:44:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPFO1DN7pCTBl2DZ7a/hFTvpOmU3nSZREIyWTBNKkTG9Hg9xBmC5of6JPcL2jfgUhhNs1S X-Received: by 2002:aa7:8c13:: with SMTP id c19mr44011155pfd.225.1554914697291; Wed, 10 Apr 2019 09:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554914697; cv=none; d=google.com; s=arc-20160816; b=iad86aBlXkUIfLPBbGYVLZi1onwM1hpW9k6lL+OSBVlGH4gwlURH/kBW99iebbDjq1 4JB9/Qd4APlMwZUurW5XqbYBeHGWfQbgmZfOeBWYv3Rn7XsZzVMdt5qMumG8d19Vn+iD oamdxQNbRSfUXYOryvUZ/hNbjVLKHMVFa/WOrzFAuYrkR53m6vcVpArUUgXNYwp9PPF3 I8UWGsYEX2EV0ZTx7ntToF8IMNihD1czauKg2bj/YyLvGjWhTUYg1eeSh6KEFveK/Ps+ VAVKanVEXZDEFH748Ht29Qq47QkRDCB+927Hyq5rXoFslyXUqqPWY9+Xpm8EhSkijxDp shYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ViSGjHU+ULAMezB8B2AFrLCLmYLf4XzfvFlBIWqgtYw=; b=X+4zM+griNw01ueO1RhycL/bFiBRY7ce6ND8A1GbG6xxJuku57Y0IXy120e9TVlvWA Vsur7hXwc2XJZZ0pnwIG3Awvzk8OeXXKGSRcWljVpumfgU8eENDGIeNRrbEXafBr9sht p/wqHeZZ3SCHouW86NkRQ54JJ7G8sYJuJ3ZPeeMppxqwmxLiRJKS90Ak6kc+RBcWKjDU 5Vuv/RBL/4rukRyQ6zY+2NGKozrrg4n2fxyohGs1YbSMVeVYBQmaMTZd5pvg56ZCWHLy QYfknnEWxaKi9ADzJ9o+Y8vo9x1LILTCN+q59EG9331BMtXuWHZdPnySpPtuKeHlBDNn Yi+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12si26057507pgq.53.2019.04.10.09.44.41; Wed, 10 Apr 2019 09:44:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732784AbfDJOum (ORCPT + 99 others); Wed, 10 Apr 2019 10:50:42 -0400 Received: from gloria.sntech.de ([185.11.138.130]:50802 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728729AbfDJOum (ORCPT ); Wed, 10 Apr 2019 10:50:42 -0400 Received: from ip5f5a6320.dynamic.kabel-deutschland.de ([95.90.99.32] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hEEYZ-0002vv-PW; Wed, 10 Apr 2019 16:50:31 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Christoph Muellner Cc: Thierry Reding , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] drm: panel-simple: Add simple-panel driver. Date: Wed, 10 Apr 2019 16:50:30 +0200 Message-ID: <7915415.Bhcl4jWJiJ@diego> In-Reply-To: <20190410141045.58097-1-christoph.muellner@theobroma-systems.com> References: <20190410141045.58097-1-christoph.muellner@theobroma-systems.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christoph, Am Mittwoch, 10. April 2019, 16:10:44 CEST schrieb Christoph Muellner: > On our RK3399-Q7 EVK base board we have the option to connect an arbitrary > monitor via DP cable. The actual monitor is therefore not known in advance. > This means, we don't have any panel information besides the EDID > data from the device itself. Just so I understand correctly, you have a real dp-connector wired to the Analogix dp-controller, and therefore want to connect actual monitors to it. So the problem you're trying to work around is probably that the rockchip-driver of the analogix controller explictly expects a bridge to be present during probe, right? I think hacking up the panel-driver is not an ideal approach: (1) bridges/panels do expect to stay connected all the time and are meant for devices with actual hard-wired displays with specific power-sequence requirements (2) devicetree is expected to describe the real hardware, therefore the dt should not describe one thing while the actual hardware is really different So, I guess a more ideal approach could perhaps be to: (1) define a "dp-connector" devicetree binding, see Documentation/devicetree/bindings/display/connector/hdmi-connector.txt for a similar one (2) steal an idea from drivers/gpu/drm/mediatek/mtk_hdmi.c and check for that new compatible: if (!of_device_is_compatible(remote, "hdmi-connector")) { //move bridge handling here } and modify both the rockchip-part and the generic analogix bridge code to work with the connector declared instead of a panel? Heiko > The functionality for a 'simple-panel' has been remove a couple > of years ago with 81cf32b. This patch brings this feature back. > > Signed-off-by: Christoph Muellner > --- > drivers/gpu/drm/panel/panel-simple.c | 24 ++++++++++++++++-------- > 1 file changed, 16 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c > index 9e8218f6a3f2..1f69283f3e4b 100644 > --- a/drivers/gpu/drm/panel/panel-simple.c > +++ b/drivers/gpu/drm/panel/panel-simple.c > @@ -176,7 +176,7 @@ static int panel_simple_disable(struct drm_panel *panel) > backlight_update_status(p->backlight); > } > > - if (p->desc->delay.disable) > + if (p->desc && p->desc->delay.disable) > msleep(p->desc->delay.disable); > > p->enabled = false; > @@ -195,7 +195,7 @@ static int panel_simple_unprepare(struct drm_panel *panel) > > regulator_disable(p->supply); > > - if (p->desc->delay.unprepare) > + if (p->desc && p->desc->delay.unprepare) > msleep(p->desc->delay.unprepare); > > p->prepared = false; > @@ -220,11 +220,13 @@ static int panel_simple_prepare(struct drm_panel *panel) > > gpiod_set_value_cansleep(p->enable_gpio, 1); > > - delay = p->desc->delay.prepare; > - if (p->no_hpd) > - delay += p->desc->delay.hpd_absent_delay; > - if (delay) > - msleep(delay); > + if (p->desc) { > + delay = p->desc->delay.prepare; > + if (p->no_hpd) > + delay += p->desc->delay.hpd_absent_delay; > + if (delay) > + msleep(delay); > + } > > p->prepared = true; > > @@ -238,7 +240,7 @@ static int panel_simple_enable(struct drm_panel *panel) > if (p->enabled) > return 0; > > - if (p->desc->delay.enable) > + if (p->desc && p->desc->delay.enable) > msleep(p->desc->delay.enable); > > if (p->backlight) { > @@ -280,6 +282,9 @@ static int panel_simple_get_timings(struct drm_panel *panel, > struct panel_simple *p = to_panel_simple(panel); > unsigned int i; > > + if (!p->desc) > + return 0; > + > if (p->desc->num_timings < num_timings) > num_timings = p->desc->num_timings; > > @@ -2536,6 +2541,9 @@ static const struct panel_desc arm_rtsm = { > > static const struct of_device_id platform_of_match[] = { > { > + .compatible = "simple-panel", > + .data = NULL, > + }, { > .compatible = "ampire,am-480272h3tmqw-t01h", > .data = &ire_am_480272h3tmqw_t01h, > }, { >