Received: by 10.223.185.116 with SMTP id b49csp690094wrg; Fri, 23 Feb 2018 05:22:11 -0800 (PST) X-Google-Smtp-Source: AH8x225yIZDn+d4KVNS4bxf/RrUn8c2j81PJsXw4rZK6BfN1ESPPJZfkFAEifO1+QPpS4MBGwliZ X-Received: by 2002:a17:902:7e4a:: with SMTP id a10-v6mr1708788pln.207.1519392131825; Fri, 23 Feb 2018 05:22:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519392131; cv=none; d=google.com; s=arc-20160816; b=s4vuJSuNDGuqhPtFH/hRZQAljjKfjvkX1Kh+q2LLC2Gu9LdPs6puaGT1TUl7Mu4gjw Wam1Kl1ZkGTLGqRTDn74gPXeoslvGFpFMEdZrV+3AZEIewKD6i2fVci1ngelfucHIFET 62dlZIOOQ1P9vyp9eK2qeuWyH3XDkDbAzyEanGt5djNVISx2vmJ58U26bDuDnXEm1Fxa +6sGQcRMQO1TuZjZu0khprQfApaEJfuDi3fVHnmh2qT446AXze5T+KMF0gDZO9klYFe6 pqvalaDkYZBJx66mYusQ8Hm+TBAbtCLb9lOcQBxwCuKAqFCsbFye1yEvOEzRs6UCIz4y NiIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=zyYMOk5XiP9DmnYrol8cVDDWepS/TotwsL8YpE5rgh8=; b=kDfGN/RV6ORduItLaVNIQrbz1eK8002P2YDn3EbazGZKO3djlTKdPiFpReB/i4UAg2 i7avJI1EkV1S3/Q0R4e+Av4FpRi3kefS+A08J+7zw76hOFxi608/6lq5HXCxmmVjKseC hCYYqzk0LLorgh7icXSsHyYSQf1mkYxDrGVxyWFgMNK6DdrsDqIAxX+GvkwIqxM5S9m/ sdrVmq6vtj2PgIu+O562RIn37OUi3pLbPl/dlFLqUENfdOQqxxE83t+JWeDJ7rcy/aMM owvkz5VYX/+/FbJQKN89QDb3WmJks4q7W4BUaaSrngOdv++dPro5dBfVQlWzlZEY6MgD eMxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sm0UTh60; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y9si1514343pgq.548.2018.02.23.05.21.56; Fri, 23 Feb 2018 05:22:11 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sm0UTh60; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751813AbeBWNUQ (ORCPT + 99 others); Fri, 23 Feb 2018 08:20:16 -0500 Received: from mail-qk0-f194.google.com ([209.85.220.194]:39620 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751724AbeBWNUM (ORCPT ); Fri, 23 Feb 2018 08:20:12 -0500 Received: by mail-qk0-f194.google.com with SMTP id z197so10688407qkb.6; Fri, 23 Feb 2018 05:20:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zyYMOk5XiP9DmnYrol8cVDDWepS/TotwsL8YpE5rgh8=; b=sm0UTh60/oatkPlt5W+hgrSRxUl5k2i/IJEYjP3oDA+QVm3yr9REYqdSJzDD0HqNg0 HTyAUd8bsCd28ViiKpmWavoIA2bPHE7S5YBELpW8pjof6widOKHLugDH4UtAoPNRdebc vH/7oLe2gRXl76NHOcE2yXxc7bz+aAD/40r2Q0z5ebiOTPGfr1N+sFl9B84GbpeMJeg0 ufE+AlsZimfbJJUI8e14h2wJMWf2JWcDLyYtqprggGh3XYS4jqOgA/tFV5a6phucOBUv d2Eo8xRv2cilIrzrp8l/+FdF29XcBuMiXU1svii8Xq3b1KlycjwWQA47tYyvjr5xZNpO SeCw== 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; bh=zyYMOk5XiP9DmnYrol8cVDDWepS/TotwsL8YpE5rgh8=; b=GH3tGRB4xUwJhGYmhpir8LwNkjEeZAE+hsggoiisTHC0JX2VKwrvMI/8VhKCLkI7Y/ WgekEdtAyX7ql/rHIhrmEycVg78H7+BOl8HJFiVL5CJ2fiji6fA3vlz8Sx5clFGbY7h3 lubtAvkAj2TB9C/l8xnyWiLIR6/AMeBCLaMr7CfdutUB2xgNFBD1/Dymis6TXsrm9VVv Ekjs7waPhIzN0CFee+67SGfQLYYlRC3vxPopKRmt18PgcwioQhhP+4oYOT07+vl558mg ZvGH6H2ihCgkyzIgjiljq5c/4/GPVk5cpKSNWaCJ91kxzR6t/I5M0q55LWdIWHY7TsBE qBbQ== X-Gm-Message-State: APf1xPA/pRuWoBRpbX6x1E6HhDc1scmXM/f9j2vCoA/bjJovJp41PweR G0mLioRKw+sp8DCkV6MzeMw= X-Received: by 10.55.73.7 with SMTP id w7mr2313368qka.317.1519392011419; Fri, 23 Feb 2018 05:20:11 -0800 (PST) Received: from localhost ([144.121.20.162]) by smtp.gmail.com with ESMTPSA id u37sm1543905qtj.33.2018.02.23.05.20.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 23 Feb 2018 05:20:10 -0800 (PST) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Brian Starkey , Liviu Dudau , Rob Clark , David Airlie , Sean Paul , Archit Taneja , Daniel Vetter , Neil Armstrong , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , linux-kernel@vger.kernel.org Subject: [RFC 3/4] drm/msm/mdp5: add config for writeback pipes Date: Fri, 23 Feb 2018 08:17:53 -0500 Message-Id: <20180223131758.18362-4-robdclark@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180223131758.18362-1-robdclark@gmail.com> References: <20180223131758.18362-1-robdclark@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Note there seems to be a slight disagreement between public 8x16 HRD (which claims WB2 has offset of 0x65000, relative to start of MDP), and reality (which claims WB2 has offset of 0x64800). I sided with reality. There should also be a WB0 attached to LM0 (which routes to DSI interface). It isn't clear if this can be used at the same time as output to DSI, which would be hugely useful. I was unable to get this to work (with HDMI bridge chip on db410c, so DSI in video mode). This will be needed to implement writeback support, but also useful to remove a manual hack to the generated headers (since rnndb register docs for WB had been merged long ago). Also fixes LM3 offset. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/disp/mdp5/mdp5.xml.h | 2 -- drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c | 17 +++++++++++------ drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.h | 11 +++++++++++ drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 1 + 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5.xml.h b/drivers/gpu/drm/msm/disp/mdp5/mdp5.xml.h index d9c10e02ee41..bebcbabb1fe4 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5.xml.h +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5.xml.h @@ -1391,13 +1391,11 @@ static inline uint32_t REG_MDP5_PP_FBC_LOSSY_MODE(uint32_t i0) { return 0x000000 static inline uint32_t __offset_WB(uint32_t idx) { switch (idx) { -#if 0 /* TEMPORARY until patch that adds wb.base[] is merged */ case 0: return (mdp5_cfg->wb.base[0]); case 1: return (mdp5_cfg->wb.base[1]); case 2: return (mdp5_cfg->wb.base[2]); case 3: return (mdp5_cfg->wb.base[3]); case 4: return (mdp5_cfg->wb.base[4]); -#endif default: return INVALID_IDX(idx); } } diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c index 824067d2d427..f92e68cdeeef 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c @@ -300,8 +300,8 @@ const struct mdp5_cfg_hw msm8x16_config = { }, }, .ctl = { - .count = 5, - .base = { 0x01000, 0x01200, 0x01400, 0x01600, 0x01800 }, + .count = 3, + .base = { 0x01000, 0x01200, 0x01400 }, .flush_hw_mask = 0x4003ffff, }, .pipe_vig = { @@ -324,7 +324,7 @@ const struct mdp5_cfg_hw msm8x16_config = { }, .lm = { .count = 2, /* LM0 and LM3 */ - .base = { 0x44000, 0x47000 }, + .base = { [0] = 0x44000, [3] = 0x47000 }, .instances = { { .id = 0, .pp = 0, .dspp = 0, .caps = MDP_LM_CAP_DISPLAY, }, @@ -338,12 +338,17 @@ const struct mdp5_cfg_hw msm8x16_config = { .dspp = { .count = 1, .base = { 0x54000 }, - + }, + .wb = { + .count = 1, + .base = { [0] = 0x64000, [2] = 0x64800 }, + .instances = { + { .id = 2, .lm = 3 }, + }, }, .intf = { - .base = { 0x00000, 0x6a800 }, + .base = { 0x6a000, 0x6a800, 0x6b000, 0x6b800 }, .connect = { - [0] = INTF_DISABLED, [1] = INTF_DSI, }, }, diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.h b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.h index 75910d0f2f4c..2e529fb2f9ee 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.h +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.h @@ -77,6 +77,16 @@ struct mdp5_mdp_block { uint32_t caps; /* MDP capabilities: MDP_CAP_xxx bits */ }; +struct mdp5_wb_instance { + int id; + int lm; +}; + +struct mdp5_wb_block { + MDP5_SUB_BLOCK_DEFINITION; + struct mdp5_wb_instance instances[MAX_BASES]; +}; + #define MDP5_INTF_NUM_MAX 5 struct mdp5_intf_block { @@ -100,6 +110,7 @@ struct mdp5_cfg_hw { struct mdp5_sub_block pp; struct mdp5_sub_block dsc; struct mdp5_sub_block cdm; + struct mdp5_wb_block wb; struct mdp5_intf_block intf; uint32_t max_clk; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c index 6d8e3a9a6fc0..1f44d8f15ce1 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c @@ -652,6 +652,7 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev) pm_runtime_get_sync(&pdev->dev); for (i = 0; i < MDP5_INTF_NUM_MAX; i++) { if (mdp5_cfg_intf_is_virtual(config->hw->intf.connect[i]) || + (config->hw->intf.connect[i] == INTF_DISABLED) || !config->hw->intf.base[i]) continue; mdp5_write(mdp5_kms, REG_MDP5_INTF_TIMING_ENGINE_EN(i), 0); -- 2.14.3