From patchwork Mon Oct 29 11:46:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 149656 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4026013ljp; Mon, 29 Oct 2018 04:47:25 -0700 (PDT) X-Google-Smtp-Source: AJdET5frDKqL7LIj+kJxQu2hhRWsGNZ9W3Kij19tPSzPGbheP/0NpwHeaeXgMyNrpcPXUdmZnauO X-Received: by 2002:a63:df03:: with SMTP id u3-v6mr13071145pgg.362.1540813645223; Mon, 29 Oct 2018 04:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540813645; cv=none; d=google.com; s=arc-20160816; b=U0hTDqc94MmgMM1+kDeC0WYjgQkxtZUGKtV/UPzS4pgH5PdbY/iR/kdlpuoDREcWjN +9EPHutDL1DEUszlPhRZxdTeA62JM5Io+9ZcsCL0ntbBc9c5hFzMFDAcrECe+AGL3xVg PSwBTXee3p8apPVbx8lKB9CXOf58fAeQCNVVi00SStz2Ti466gRjeC4EkVPeHo6jDwca oIz9eUr7mlyZ4SEki8JoFFLRxxsaF908M+R7j6QQenHnldKGmZLr0n+ohsX4GRt7upD8 Wrfg2lCWAyOS9OSz3AgR+9X37q8K6wj2IiJVT3KU6EMS0LTjXQP6EUVmGmZ+E3wSGRad 23mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to; bh=RMzCTVTZJKBilxtnNZtI9FzLeuvntUgrINQWj1BoP3E=; b=RfprBiFQi3Xcbz40D5YlBinN18pesfIeuQ0O4Nyvn0bbr1u6LmYiWLQ2gz9swilzn3 v7ACGlWmotQC2lYqI6zIrsRZfODDZiZb9zB1HBiAKhpt4QVF3KRoTb4yNWiZJYiswpMN TWsogjsJUCyBEVFks1qV8os8fcR6qXYp60OiVdMe4ys8egSkHE/6QMPiy0LIPS8vQ+Yu RouzHRO6Wy0D5goo04UWMvSh3+DqCUAWFV+cd0kCKNcp6EB8wanu9NOpirWP8ZDbqKfk vmQoZtIsvSDkSGDiFAmzYctoyPy+WKb66+XwaPNlZbTG0gRDjyeSJngszNoM/NOUcUN0 6eOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id l11-v6si13641704pgm.102.2018.10.29.04.47.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Oct 2018 04:47:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5265F899A5; Mon, 29 Oct 2018 11:47:20 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by gabe.freedesktop.org (Postfix) with ESMTPS id 51BCB8996F for ; Mon, 29 Oct 2018 11:47:18 +0000 (UTC) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id w9TBlBxl091936; Mon, 29 Oct 2018 06:47:11 -0500 Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id w9TBlBKV093162 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 29 Oct 2018 06:47:11 -0500 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 29 Oct 2018 06:47:10 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Mon, 29 Oct 2018 06:47:10 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9TBl70E007729; Mon, 29 Oct 2018 06:47:09 -0500 From: Tomi Valkeinen To: Archit Taneja , Andrzej Hajda , , Andrey Gusakov Subject: [PATCH 1/7] drm/bridge: tc358767: add bus flags Date: Mon, 29 Oct 2018 13:46:55 +0200 Message-ID: <20181029114701.26409-2-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181029114701.26409-1-tomi.valkeinen@ti.com> References: <20181029114701.26409-1-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen , Laurent Pinchart Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" tc358767 driver does not set DRM bus_flags, even if it does configures the polarity settings into its registers. This means that the DPI source can't configure the polarities correctly. Add sync flags accordingly. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/tc358767.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 8e28e738cb52..29a7e33e8ae0 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1195,6 +1195,10 @@ static int tc_bridge_attach(struct drm_bridge *bridge) drm_display_info_set_bus_formats(&tc->connector.display_info, &bus_format, 1); + tc->connector.display_info.bus_flags = + DRM_BUS_FLAG_DE_HIGH | + DRM_BUS_FLAG_PIXDATA_NEGEDGE | + DRM_BUS_FLAG_SYNC_NEGEDGE; drm_connector_attach_encoder(&tc->connector, tc->bridge.encoder); return 0; From patchwork Mon Oct 29 11:46:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 149654 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4025937ljp; Mon, 29 Oct 2018 04:47:21 -0700 (PDT) X-Google-Smtp-Source: AJdET5fiYO8eLFOsT4ntee61DBOBh1EHlq3V5GLeBv49Jb2xA5CvgvWtE3Syr/CWBGh2H0Y+0t3K X-Received: by 2002:a17:902:6909:: with SMTP id j9-v6mr840929plk.221.1540813641107; Mon, 29 Oct 2018 04:47:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540813641; cv=none; d=google.com; s=arc-20160816; b=P4xdvjB0JibGu4Q0fZTR2Spf9PUzx64OmfDENIr5HpThHdL/ODqD+0HTdsASWWAFI3 JXz6xFgNwPnA4XsPdYo0rwfOPxYWzJHm8NYqPgZpvKE0MBYaO0eozyMhC1cG8I6m+sV7 oPe4jrTYXb2x8VKgfLkXZ3uh1PuB8yIk9WtDiwydcvqpW9tefWt8sNW2yGGRzGnEvN6H tT/44EQS7VkDcI1IOgo7PzUywgm8YIAjlIrMJk5HzGbs3NQWNy1/96hkhKXhISQjvIxK v3+w+SG94OoNyfjI7eJIl6rGYqUMRr4nVN8fJCthQqQgILTIw07rlCQzBqUZU61onV21 1DUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to; bh=ZehJ7gOHQAv5TJU0HxM/x0kWzpvf10ULRIuQWgsW+zE=; b=gtiUrWX/dTKdUeeieHZhGZg4F7tbFMZ1OX30fBadNNoJp99qwuO7gN6TY2cENeUOYb 2uOoh/WRZo9m8JFGTxpJclj11jMLBxqs9frCgWGfhcidXFOXQNKAci6MLUjtMArwuCwQ SPe0VZahnFNFUXv3IgQV+DW7MDS7k+YAbVELpiL7OpfCp2nNoe+nmYurxqUjlucATJYE CEflLJtQh82qdLqE8Gek5ADX/ei+gRyCDHCQQ60EplrAFP6PfcsjabIBnsOkFpIANVIm tILK9TFF7hHyjOJIQQ/1SbAm9aB98H97EBy9HuqP38/sVS7APNQAn18Lee1q8+pP5mGw IfpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id 62-v6si12958631plb.277.2018.10.29.04.47.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Oct 2018 04:47:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C4EC898F5; Mon, 29 Oct 2018 11:47:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2BCE6898F5 for ; Mon, 29 Oct 2018 11:47:18 +0000 (UTC) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id w9TBlD6o095202; Mon, 29 Oct 2018 06:47:13 -0500 Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id w9TBlDXQ057519 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 29 Oct 2018 06:47:13 -0500 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 29 Oct 2018 06:47:12 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Mon, 29 Oct 2018 06:47:12 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9TBl70F007729; Mon, 29 Oct 2018 06:47:11 -0500 From: Tomi Valkeinen To: Archit Taneja , Andrzej Hajda , , Andrey Gusakov Subject: [PATCH 2/7] drm/bridge: tc358767: add defines for DP1_SRCCTRL & PHY_2LANE Date: Mon, 29 Oct 2018 13:46:56 +0200 Message-ID: <20181029114701.26409-3-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181029114701.26409-1-tomi.valkeinen@ti.com> References: <20181029114701.26409-1-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen , Laurent Pinchart Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" DP1_SRCCTRL register and PHY_2LANE field did not have matching defines. Add these. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/tc358767.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 29a7e33e8ae0..5f0a666db2fd 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -142,6 +142,8 @@ #define DP0_LTLOOPCTRL 0x06d8 #define DP0_SNKLTCTRL 0x06e4 +#define DP1_SRCCTRL 0x07a0 + /* PHY */ #define DP_PHY_CTRL 0x0800 #define DP_PHY_RST BIT(28) /* DP PHY Global Soft Reset */ @@ -150,6 +152,7 @@ #define PHY_M1_RST BIT(12) /* Reset PHY1 Main Channel */ #define PHY_RDY BIT(16) /* PHY Main Channels Ready */ #define PHY_M0_RST BIT(8) /* Reset PHY0 Main Channel */ +#define PHY_2LANE BIT(2) /* PHY Enable 2 lanes */ #define PHY_A0_EN BIT(1) /* PHY Aux Channel0 Enable */ #define PHY_M0_EN BIT(0) /* PHY Main Channel0 Enable */ @@ -564,7 +567,7 @@ static int tc_aux_link_setup(struct tc_data *tc) value |= SYSCLK_SEL_LSCLK | LSCLK_DIV_2; tc_write(SYS_PLLPARAM, value); - tc_write(DP_PHY_CTRL, BGREN | PWR_SW_EN | BIT(2) | PHY_A0_EN); + tc_write(DP_PHY_CTRL, BGREN | PWR_SW_EN | PHY_2LANE | PHY_A0_EN); /* * Initially PLLs are in bypass. Force PLL parameter update, @@ -834,7 +837,7 @@ static int tc_main_link_setup(struct tc_data *tc) DP0_SRCCTRL_LANESKEW | DP0_SRCCTRL_LANES_2 | DP0_SRCCTRL_BW27 | DP0_SRCCTRL_AUTOCORRECT); /* from excel file - DP1_SrcCtrl */ - tc_write(0x07a0, 0x00003083); + tc_write(DP1_SRCCTRL, 0x00003083); rate = clk_get_rate(tc->refclk); switch (rate) { @@ -855,8 +858,9 @@ static int tc_main_link_setup(struct tc_data *tc) } value |= SYSCLK_SEL_LSCLK | LSCLK_DIV_2; tc_write(SYS_PLLPARAM, value); + /* Setup Main Link */ - dp_phy_ctrl = BGREN | PWR_SW_EN | BIT(2) | PHY_A0_EN | PHY_M0_EN; + dp_phy_ctrl = BGREN | PWR_SW_EN | PHY_2LANE | PHY_A0_EN | PHY_M0_EN; tc_write(DP_PHY_CTRL, dp_phy_ctrl); msleep(100); From patchwork Mon Oct 29 11:46:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 149659 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4026572ljp; Mon, 29 Oct 2018 04:47:57 -0700 (PDT) X-Google-Smtp-Source: AJdET5fluAa3Mm6ZUq2MOfvcg1F/kb2Mz0BSqErF9pPkYsM6IJOHcizeNZUYX4KdOqMlWXgReOM1 X-Received: by 2002:a17:902:7408:: with SMTP id g8-v6mr13624084pll.168.1540813677226; Mon, 29 Oct 2018 04:47:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540813677; cv=none; d=google.com; s=arc-20160816; b=gaKLEjKCLY/K9z1ELl3HX1Xnp08CDHXixbrSWYDEClpUE+N4AE6WcyJ1xWhOic6ORO dXvdb+NY87EWIhqiEmMjExk5Dsx7O5nBOXN1U6UMpmENUMwcH2OgPIqqMGXm/QWVKuJW tIprVMD+CpPqRZUHjAw8CmK/ROuDegt5sJfZA0kc89ClG3O3ciJCRLU+q8x2ekKaRdQT Y9+YphJ6TI6aHmVDPUu/i/2GaWZUdrAr6rxnf0ZFT6ZoUgx34MbZ2QVzyxQVvoHP2oGI 2HxfxQrEgYNYFmZgn2RG5Rt2SstIHVwT2TuvmcyQKx+druquIs+PYtw9y0a/IXwJ/ZcT FcJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to; bh=1pkFOujeUVXcGjRk27NtoGe+oznrznXQNLZPZ2MwVIk=; b=YN+smN1/vtPlzn/nFUji7m2LPuYFpAi6HAfPQDjuNSrsV3nVygvI6sUVwj2Wb3fJO/ 0nNTRa2co4Oe8uQc5G3Jtrm1iY5A/o8xZLdRo5qDjFB+Nwv7fLFspz/phfpl8SbIOIh8 MF4NjcsHiPZ14JKtAOTdtlxQDNgr85iocXpQE+RBHj43GfgVu+iY9BNHyBL5lYOoAlsy /MPmwy2HxGiiWvh+uTUTWZCVPYVa2dpyMsLPjd/kY9Q8cRfnEnlOu9iv6w5c52rcvT03 hGT1/Y3qqswiqP16zn9nyrSZCqNMudorMGSs9MMe7RjnYA7o01cD6Hwyb3dDFv3m+jCx RttQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id t14-v6si19512590plr.234.2018.10.29.04.47.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Oct 2018 04:47:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7476E89DB4; Mon, 29 Oct 2018 11:47:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4310A89DBD for ; Mon, 29 Oct 2018 11:47:21 +0000 (UTC) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id w9TBlEu8116970; Mon, 29 Oct 2018 06:47:14 -0500 Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id w9TBlEek093179 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 29 Oct 2018 06:47:14 -0500 Received: from DLEE100.ent.ti.com (157.170.170.30) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 29 Oct 2018 06:47:14 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Mon, 29 Oct 2018 06:47:14 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9TBl70G007729; Mon, 29 Oct 2018 06:47:12 -0500 From: Tomi Valkeinen To: Archit Taneja , Andrzej Hajda , , Andrey Gusakov Subject: [PATCH 3/7] drm/bridge: tc358767: fix single lane configuration Date: Mon, 29 Oct 2018 13:46:57 +0200 Message-ID: <20181029114701.26409-4-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181029114701.26409-1-tomi.valkeinen@ti.com> References: <20181029114701.26409-1-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen , Laurent Pinchart Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" PHY_2LANE bit is always set in DP_PHY_CTRL, breaking 1 lane use. Set PHY_2LANE only when 2 lanes are used. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/tc358767.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 5f0a666db2fd..fee53422c31f 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -543,6 +543,7 @@ static int tc_aux_link_setup(struct tc_data *tc) unsigned long rate; u32 value; int ret; + u32 dp_phy_ctrl; rate = clk_get_rate(tc->refclk); switch (rate) { @@ -567,7 +568,10 @@ static int tc_aux_link_setup(struct tc_data *tc) value |= SYSCLK_SEL_LSCLK | LSCLK_DIV_2; tc_write(SYS_PLLPARAM, value); - tc_write(DP_PHY_CTRL, BGREN | PWR_SW_EN | PHY_2LANE | PHY_A0_EN); + dp_phy_ctrl = BGREN | PWR_SW_EN | PHY_A0_EN; + if (tc->link.base.num_lanes == 2) + dp_phy_ctrl |= PHY_2LANE; + tc_write(DP_PHY_CTRL, dp_phy_ctrl); /* * Initially PLLs are in bypass. Force PLL parameter update, @@ -860,7 +864,9 @@ static int tc_main_link_setup(struct tc_data *tc) tc_write(SYS_PLLPARAM, value); /* Setup Main Link */ - dp_phy_ctrl = BGREN | PWR_SW_EN | PHY_2LANE | PHY_A0_EN | PHY_M0_EN; + dp_phy_ctrl = BGREN | PWR_SW_EN | PHY_A0_EN | PHY_M0_EN; + if (tc->link.base.num_lanes == 2) + dp_phy_ctrl |= PHY_2LANE; tc_write(DP_PHY_CTRL, dp_phy_ctrl); msleep(100); From patchwork Mon Oct 29 11:46:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 149660 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4026601ljp; Mon, 29 Oct 2018 04:47:59 -0700 (PDT) X-Google-Smtp-Source: AJdET5dSTQyfQ06AkRTxJihlaoEYyRyKsAR1RDe9AANOChoeKPEa4G2iCy7JicRXTAu7sk8v2LR2 X-Received: by 2002:a17:902:7d98:: with SMTP id a24-v6mr13985463plm.271.1540813679330; Mon, 29 Oct 2018 04:47:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540813679; cv=none; d=google.com; s=arc-20160816; b=YdqkmUCPXLf7EIt4jpqG+XyuLNQeQ1QmL104BzSFVmr/Xr7ETwA9TjUR2MWI25yZl0 YQsirzduG0HGe0/vnfGfeoXhIDxaGxXaA1ip21qM/qcI0lWU3J66aYWWvWKZIwgUOlC1 0L+/d4CXl2T7oxfXgpychcjPzRWSj4BnirUJS5pQ6rhpO7JaM+DT4ojUhW/KeC55EVtc PBPWbiyTkFQ+eSoptHdBn5ZxUFA/yuirmHVi6pOcHI9H1yu+nB9hONwuWT9T7PK6wGzU ZQW9IgK4S7wJQuJhX1DBZCGrY65hkqrtkNHcI3JhsRE4+EdKfKBUcBVCWzK8zg1nlE1O iYQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to; bh=p0+rBGNUQJVUo8SroiFMqSibYKHEUo6GdJQriuL0Psk=; b=fRW9WXOMDuVKP/xg3PNgAznVUQW98CuWOak3rKdA6cPUiN9RhhIajskNk5pVrrUknB Z+ROLkT1H5rz6u40CXzjT9yb7fdN76qCRKmHL3XYPNuCVxAoKz6L7PqciFAkJeGuZuI1 qGYIWx9NdC6x6GJliuqPXH82NWquFe3EORGgSlOK/ec/HDsrv7PM7++ThEV9nf3Zp46f Rj9oZOmJCvuxyxJMDCU7t8z8lcqhw4LLzfRcF6lSeuCb0sXGrNclayV4P1j78sc8We4j HzQvdd3kr4MU45+HwbwMSeSc3k/qTx0hLMUd2oRqZoxLGpJndot1fPMdQPXiV7ixfr/5 poxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id w185-v6si3440094pfd.55.2018.10.29.04.47.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Oct 2018 04:47:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8643489DBD; Mon, 29 Oct 2018 11:47:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by gabe.freedesktop.org (Postfix) with ESMTPS id 34C0889DB4 for ; Mon, 29 Oct 2018 11:47:21 +0000 (UTC) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id w9TBlGKb116976; Mon, 29 Oct 2018 06:47:16 -0500 Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id w9TBlGi8015101 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 29 Oct 2018 06:47:16 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 29 Oct 2018 06:47:15 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Mon, 29 Oct 2018 06:47:15 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9TBl70H007729; Mon, 29 Oct 2018 06:47:14 -0500 From: Tomi Valkeinen To: Archit Taneja , Andrzej Hajda , , Andrey Gusakov Subject: [PATCH 4/7] drm/bridge: tc358767: fix initial DP0/1_SRCCTRL value Date: Mon, 29 Oct 2018 13:46:58 +0200 Message-ID: <20181029114701.26409-5-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181029114701.26409-1-tomi.valkeinen@ti.com> References: <20181029114701.26409-1-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen , Laurent Pinchart Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Initially DP0_SRCCTRL is set to a static value which includes DP0_SRCCTRL_LANES_2 and DP0_SRCCTRL_BW27, even when only 1 lane of 1.62Gbps speed is used. DP1_SRCCTRL is configured to a magic number. This patch changes the configuration as follows: Configure DP0_SRCCTRL by using tc_srcctrl() which provides the correct value. DP1_SRCCTRL needs to bits to be set to the same value as DP0_SRCCTRL: SSCG and BW27. All other bits can be zero. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/tc358767.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index fee53422c31f..ab299f4debfa 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -836,12 +836,11 @@ static int tc_main_link_setup(struct tc_data *tc) if (!tc->mode) return -EINVAL; - /* from excel file - DP0_SrcCtrl */ - tc_write(DP0_SRCCTRL, DP0_SRCCTRL_SCRMBLDIS | DP0_SRCCTRL_EN810B | - DP0_SRCCTRL_LANESKEW | DP0_SRCCTRL_LANES_2 | - DP0_SRCCTRL_BW27 | DP0_SRCCTRL_AUTOCORRECT); - /* from excel file - DP1_SrcCtrl */ - tc_write(DP1_SRCCTRL, 0x00003083); + tc_write(DP0_SRCCTRL, tc_srcctrl(tc)); + /* SSCG and BW27 on DP1 must be set to the same as on DP0 */ + tc_write(DP1_SRCCTRL, + (tc->link.spread ? DP0_SRCCTRL_SSCG : 0) | + ((tc->link.base.rate != 162000) ? DP0_SRCCTRL_BW27 : 0)); rate = clk_get_rate(tc->refclk); switch (rate) { From patchwork Mon Oct 29 11:46:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 149658 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4026316ljp; Mon, 29 Oct 2018 04:47:42 -0700 (PDT) X-Google-Smtp-Source: AJdET5djGHmskA8K1EH3OYQnUKAQ4jCXM1kmJTpgCl+3XizRDXrN7q35lJEV6+nn5Xbmo8ccEsiL X-Received: by 2002:a65:60c9:: with SMTP id r9-v6mr13376668pgv.285.1540813662275; Mon, 29 Oct 2018 04:47:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540813662; cv=none; d=google.com; s=arc-20160816; b=YbeRTGUHMqqzm0Q91DqAqxSNV2jbKsWyYr8QisGfeye0AWdsxVD4K3tOKSh7gLpOYk 5/koPgWlGklrC8D7/2hMfJqZgRkZsm9nuNnhX4s8pkn/siO12vyn90LO5IcW5NBgVdGZ b5t5PLfHGvbnvQcWXJCwuReFcDLQmT0bo1rMIsA4fz2Ni1g+akA7Km5mc1X7yhmiV7CV TLo2E88GH0N9t1IjO4rjP+wLVT7kfICBSE4lieko2/hrrO6pcj/U0xrcUlSoyWI9IGUr wwtxrtnuu3lX3Xb8eLUf23KeQAjUiXtO3kN2kWViHTGJNYQFk5ocqkPR+nkbmelzTu4w cJjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to; bh=MBqO2mPukTsDZqPW2QSxXOX+HcsETss74ZSSZYnBbvc=; b=pDUFSsPoXLxf/tblRfU86+KUZDuu8utMhV9v2pWQFPptLtUCxlKMI85fP4gN/aw9e8 Uv7sSJi5CIG0+ZF4ktTq387OCswJI9kfXZkR4pISys6Q/H6Y9p5X4WP58a2QcM4Z4+gd Lrfs1oeFIe1/DOglFxzwLNvZPIYyWDvxLuKCLbIk1Vye+RYkCQdjOf+7aQai0YGMVyLx P1Surgca/eMIxo2/AXlqgA2fu4hK4Bg+Hc1NfMQPHyg+t6tvC1Y1IqvZ6Z1oT4K0aRH4 H0PrkcpLiTlGlwY7b3xUDcQmN+92pSxBJHMA/DkJIqWT1gwSsxDeRaUNknhF+WR6VcYH t3Uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id d8-v6si21103555pgh.45.2018.10.29.04.47.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Oct 2018 04:47:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 516F389E15; Mon, 29 Oct 2018 11:47:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by gabe.freedesktop.org (Postfix) with ESMTPS id D021289E05 for ; Mon, 29 Oct 2018 11:47:24 +0000 (UTC) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id w9TBlKU1016481; Mon, 29 Oct 2018 06:47:21 -0500 Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id w9TBlKI3093243 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 29 Oct 2018 06:47:20 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 29 Oct 2018 06:47:17 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Mon, 29 Oct 2018 06:47:17 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9TBl70I007729; Mon, 29 Oct 2018 06:47:16 -0500 From: Tomi Valkeinen To: Archit Taneja , Andrzej Hajda , , Andrey Gusakov Subject: [PATCH 5/7] drm/bridge: tc358767: reject modes which require too much BW Date: Mon, 29 Oct 2018 13:46:59 +0200 Message-ID: <20181029114701.26409-6-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181029114701.26409-1-tomi.valkeinen@ti.com> References: <20181029114701.26409-1-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen , Laurent Pinchart Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The current driver accepts any videomode with pclk < 154MHz. This is not correct, as with 1 lane and/or 1.62Mbps speed not all videomodes can be supported. Add code to reject modes that require more bandwidth that is available. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/tc358767.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index ab299f4debfa..b026b5ef7378 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1114,10 +1114,20 @@ static bool tc_bridge_mode_fixup(struct drm_bridge *bridge, static enum drm_mode_status tc_connector_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { + struct tc_data *tc = connector_to_tc(connector); + u32 req, avail; + u32 bits_per_pixel = 24; + /* DPI interface clock limitation: upto 154 MHz */ if (mode->clock > 154000) return MODE_CLOCK_HIGH; + req = mode->clock * bits_per_pixel / 8 / 1000; + avail = tc->link.base.num_lanes * tc->link.base.rate / 1000; + + if (req > avail) + return MODE_BAD; + return MODE_OK; } From patchwork Mon Oct 29 11:47:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 149657 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4026213ljp; Mon, 29 Oct 2018 04:47:36 -0700 (PDT) X-Google-Smtp-Source: AJdET5fFIa3e7AeM1c3ZGNBuOMUCRYOKTyi5ZJKOK5Hz4QiQBMw5WsTSn8yubtCfOV7G/xKpm4Qn X-Received: by 2002:a63:ed09:: with SMTP id d9-v6mr13284009pgi.305.1540813655997; Mon, 29 Oct 2018 04:47:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540813655; cv=none; d=google.com; s=arc-20160816; b=AUrsBBbvwsJCihjfUozw+0yR7IkTwkzRgtndpDv2hOYnJcs42zZUyJh7df1C5j6u6c q44ldHFA9F+NcwoJMrv+JKl96TeB1+zBbDII/YnEglDWEOzsnf1G2UYELrpHMx+ewQCx g097ICSC9aFcHLH1/XiY1Pw4aJAHk3Nd8kr5hmGe9to7jDrVAzJqW+M+hLunKOGsq8AA ERXbFPRbXydESViQrmKIX8lcG007mudlpGhlOpELJjblTlfEHrc9rnRReW7I5RreFvJt L4qk7MssvKsqQSPRlFONvB7Cp9DyhjYGNrJ59IySytf4v3PTzoRbxqxPIci5MXfGrIKN Pk6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to; bh=8vEaq9RWu3kKk06/5ngME5O2xRel9/9gjkinJiIkcUI=; b=ECXhwl4zr5FObdfgzRSHQOmzTANRAuw0fsoDK/7kq21MqqtpN/fFw0u0y/MEMNgJO/ WibmRwDTHOZRepvWIprXLc9xjmK3O1McD4ekB2tBrX8m8yQ+JUuj3aD7U36vdo55DQsi iwZIhYpe/O4Dj1w0ernme42YpF0om4FAodzLWhYNaAS7l2tIWGCac1yvFTHPN4Gx+SsC +yspfc1gKgs5Mvz5YZGnkcwJ015hPA08iNDqpuJ4bCo6+USewVxvLw/S0TmqSCBefnAD 9ziYqISmrpoJ6OW0sDR9sYBc6cCQil1g/84E3IIRkxg5ZGt4rsIghMOeGQnS7YHq8BZ5 Sj7Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id ca17-v6si20652511plb.406.2018.10.29.04.47.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Oct 2018 04:47:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4FB7C89E06; Mon, 29 Oct 2018 11:47:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by gabe.freedesktop.org (Postfix) with ESMTPS id 885D189E05 for ; Mon, 29 Oct 2018 11:47:24 +0000 (UTC) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id w9TBlLEe095249; Mon, 29 Oct 2018 06:47:21 -0500 Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id w9TBlLI6013826 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 29 Oct 2018 06:47:21 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 29 Oct 2018 06:47:19 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Mon, 29 Oct 2018 06:47:19 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9TBl70J007729; Mon, 29 Oct 2018 06:47:17 -0500 From: Tomi Valkeinen To: Archit Taneja , Andrzej Hajda , , Andrey Gusakov Subject: [PATCH 6/7] drm/bridge: tc358767: fix output H/V syncs Date: Mon, 29 Oct 2018 13:47:00 +0200 Message-ID: <20181029114701.26409-7-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181029114701.26409-1-tomi.valkeinen@ti.com> References: <20181029114701.26409-1-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen , Laurent Pinchart Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The H and V syncs of the DP output are always set to active high. This patch fixes the syncs by configuring them according to the videomode. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/tc358767.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index b026b5ef7378..be013bd7b30b 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -726,7 +726,9 @@ static int tc_set_video_mode(struct tc_data *tc, struct drm_display_mode *mode) tc_write(DP0_ACTIVEVAL, (mode->vdisplay << 16) | (mode->hdisplay)); - tc_write(DP0_SYNCVAL, (vsync_len << 16) | (hsync_len << 0)); + tc_write(DP0_SYNCVAL, (vsync_len << 16) | (hsync_len << 0) | + ((mode->flags & DRM_MODE_FLAG_NHSYNC) ? (1 << 15) : 0) | + ((mode->flags & DRM_MODE_FLAG_NVSYNC) ? (1 << 31) : 0)); tc_write(DPIPXLFMT, VS_POL_ACTIVE_LOW | HS_POL_ACTIVE_LOW | DE_POL_ACTIVE_HIGH | SUB_CFG_TYPE_CONFIG1 | DPI_BPP_RGB888); From patchwork Mon Oct 29 11:47:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 149661 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4026646ljp; Mon, 29 Oct 2018 04:48:02 -0700 (PDT) X-Google-Smtp-Source: AJdET5drgAcMnkQ7lWDLW/YPr6c5BZ2CTcq6on1y/In6XKIoCaYa/YBJ5Z4BkZQc7d86Rb/f4Yc8 X-Received: by 2002:a62:22c3:: with SMTP id p64-v6mr15147154pfj.9.1540813682360; Mon, 29 Oct 2018 04:48:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540813682; cv=none; d=google.com; s=arc-20160816; b=GfmOMYnOGt5Q2a/0NmGSsTyH3jf/tuCrn4/nzlisSZ1OnufAz+Z4rUxxX874LjAsMS pDvrzjEMtzWmhE7lpcYN6W7Aa3xueVuov2u4CwqrHvuynTQ3Q8RMFHSyyxmsnszCVXSM EhUgUsNJYLXjBnbbua6dltvtr54D9XaP59U6P7qe1zSzlnESqMJldkJNXzIjraa8wdvI 5ExauUZciDdeJgwQelSSClvRG99P0vTMXcLoIvH5ClybQC7tPIRDSCxWM6OueSM/BLCS PBkesumWu/8nYoSjyTkx7fWU03JvgFkBDtf7xjHtavJ/+XQ5SMv/qvyFItKkEanlCraI rfYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to; bh=6jYBacxxtzrd19La9gJmeXT0nwDHexksnZCTusIsXvo=; b=otaHY49sYHIwHevFmTDWbWICZJ8UE6DOcPC0ZIH7qAAt1VmAb+2Et0tfSvpYIJPbBf N4xZOBAS31KMkjTK70fSiKKvIFaN2MQNAaXT/5/G1yCCdg7Bmld3qGsKmYJKmYoIX9di 5romdtyWwOeLxaKkTlXQjBcQ3TSHKjdaH4js6h+5muVns+0rZrD6BGBYigUuAE4Q6nnw +WswQJqUQtF3haAZuo/reU8IOg/op5zIz744X5h+KLdPgetW92uQ2uZxMRLzWo8A42wA RVw9sdOYRE1ciA+QH8VzXdHMqh9bsIUEpw7cPi/NRBWx8VH7BBoLU4ehmONqcsnPmzxJ Efiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id r22-v6si23865922pfr.18.2018.10.29.04.48.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Oct 2018 04:48:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AECE989E05; Mon, 29 Oct 2018 11:47:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by gabe.freedesktop.org (Postfix) with ESMTPS id B2F0589E06 for ; Mon, 29 Oct 2018 11:47:24 +0000 (UTC) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id w9TBlLf3095245; Mon, 29 Oct 2018 06:47:21 -0500 Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id w9TBlLQ0057596 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 29 Oct 2018 06:47:21 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 29 Oct 2018 06:47:21 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Mon, 29 Oct 2018 06:47:20 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9TBl70K007729; Mon, 29 Oct 2018 06:47:19 -0500 From: Tomi Valkeinen To: Archit Taneja , Andrzej Hajda , , Andrey Gusakov Subject: [PATCH 7/7] drm/bridge: tc358767: use DP connector if no panel set Date: Mon, 29 Oct 2018 13:47:01 +0200 Message-ID: <20181029114701.26409-8-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181029114701.26409-1-tomi.valkeinen@ti.com> References: <20181029114701.26409-1-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen , Laurent Pinchart Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" tc358767 driver sets the connector type always to eDP. This patch sets the type to DP if there is no panel defined, which implies that there's a DP connector on the board. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/tc358767.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index be013bd7b30b..db93d927cb9a 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1207,7 +1207,8 @@ static int tc_bridge_attach(struct drm_bridge *bridge) /* Create eDP connector */ drm_connector_helper_add(&tc->connector, &tc_connector_helper_funcs); ret = drm_connector_init(drm, &tc->connector, &tc_connector_funcs, - DRM_MODE_CONNECTOR_eDP); + tc->panel ? DRM_MODE_CONNECTOR_eDP : + DRM_MODE_CONNECTOR_DisplayPort); if (ret) return ret;