Received: by 10.223.185.116 with SMTP id b49csp902220wrg; Fri, 23 Feb 2018 08:33:32 -0800 (PST) X-Google-Smtp-Source: AH8x224oqAobDq6ax+2J43n+aeuRsJpuLUu9U37Ak72B39VFnthBGwxrCpDhRBWeND2mmQcqISt9 X-Received: by 10.98.242.65 with SMTP id y1mr2280337pfl.232.1519403612114; Fri, 23 Feb 2018 08:33:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519403612; cv=none; d=google.com; s=arc-20160816; b=uU61LSns+JsX442rTBHSzFbi40kx3TVMlu1Ajx51O4f2kC+7P9OjUIdOdLTFh3YNcP 8jzU9clKZzHjJzO4kG05XIqygR8uTRs4VvoRn0wHsUNozo+osZYg0knkLlH1nU4YN4bv xOO2+LSxOFU/6w3N8DJwhTIFnFws4IOqHoRjqT7AT30Uj59DfqVho0mDBdZF9jDJ4Quj Dbozd6k4o0fSUsFU+pgQ7YZoTxg+6wyqunq4OkQZnvt1NPK12IpwFoPyLY/0WTjo6+Ed eHMDZIdLQU108+3zZKAY/9cdBGHCvWg7zSbXH+mgeIsyDPkv2d8qaVbx00debWnAlbnN +/cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=FnhnALges/QzZC+Il06lG81aNAcmDaOtwDLfjgie2fo=; b=kIlsXaZVZ5systUp1W+BZCYpdt0CbQPWKaoZ83lBG0BNqq3OBvWSJctuIQA4dxpwfF UlIbtLC9CZ1pmOZJbdYLVmmU7QDh+peW+AnOjYxVKMqG/0GIIhsdRVAALp+NxSNrV5DI an5pn0Ond2aauChAICpGR8BWkiSAZLNhqsGpV3g+UTR2XkeyBJuaQauRJzfnNnikXUG+ 9hDl1nUtL9NyCYXtTvycAhGv5jsCxpZQ8+Fe6XGjYoBCfrBEtqil4osF17HIhfdVZHoC nh/Vsq4HrmFbHktz1rj3lo2nwUDPEh8sSR7MnNtfiRzq/DtQpJ6jfofdlbmunJ7RgG1o afFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=l7aWubja; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o14-v6si2014043pli.572.2018.02.23.08.33.17; Fri, 23 Feb 2018 08:33:32 -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=@chromium.org header.s=google header.b=l7aWubja; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751680AbeBWQcG (ORCPT + 99 others); Fri, 23 Feb 2018 11:32:06 -0500 Received: from mail-yw0-f195.google.com ([209.85.161.195]:37091 "EHLO mail-yw0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751405AbeBWQcE (ORCPT ); Fri, 23 Feb 2018 11:32:04 -0500 Received: by mail-yw0-f195.google.com with SMTP id j143so2970726ywb.4 for ; Fri, 23 Feb 2018 08:32:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=FnhnALges/QzZC+Il06lG81aNAcmDaOtwDLfjgie2fo=; b=l7aWubjazkDOIjels4o/CFvHCPUnIlnG14NpQkzDrLZ178ae8mqXqI6GmbP09Ph0xJ euaL8AkEY3MmDACas30LahgphKGKx1Ixgrisf7qvfeNCOYaHjELjeUtKaVEYxuy5rw5H bPok8rhN4pP79XnVA5Gcioh+16iglwZ/1wXxo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=FnhnALges/QzZC+Il06lG81aNAcmDaOtwDLfjgie2fo=; b=Gcb942SHsCvNa9CLaDLofMKGmY57dVm+xXax7q0EA+cLTaoSK8h0xTd1OvrBW08P7t Nhx7p6TI4KOO1UyWBS7Cp1pCXu+OB+ZPp4zdsst7pBvID2k+cWdOF/FnjhTxmO4bOQFK xiZNz2STbe22KWrJi6m+PRlmeu7NpRmuLk3tYY3RMpWREKXg8u1x3N/0lB3GEZIHnMlk eiIuROhEVcUS+gA66R7x1e/HBHojS1yF3W6s4lWSz6qMjTtsNblQ2nlj5jMtI1isIxaE xW7y4A4X01i8JX7MLpLn9LvIWDXSjLtgMPMK4wRIJ1SIozbkvkJk98yCLIvPiv/goI5d ye8Q== X-Gm-Message-State: APf1xPCYctnXqJHp8L5WRlq8B1EMRLnmE5ZuxoLAf4ICJ0rpRGWPqSaX vRrLVwNRDGASIfi4BHME3tPW6Q== X-Received: by 10.13.221.151 with SMTP id g145mr1462184ywe.504.1519403523364; Fri, 23 Feb 2018 08:32:03 -0800 (PST) Received: from localhost ([2620:0:1013:11:d3af:69ac:1964:28e8]) by smtp.gmail.com with ESMTPSA id l10sm1032923ywb.54.2018.02.23.08.32.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 23 Feb 2018 08:32:02 -0800 (PST) Date: Fri, 23 Feb 2018 11:32:02 -0500 From: Sean Paul To: Rob Clark Cc: dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Brian Starkey , Liviu Dudau , David Airlie , Sean Paul , Archit Taneja , Daniel Vetter , Neil Armstrong , Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , linux-kernel@vger.kernel.org Subject: Re: [RFC 3/4] drm/msm/mdp5: add config for writeback pipes Message-ID: <20180223163202.GM223881@art_vandelay> References: <20180223131758.18362-1-robdclark@gmail.com> <20180223131758.18362-4-robdclark@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180223131758.18362-4-robdclark@gmail.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 23, 2018 at 08:17:53AM -0500, Rob Clark wrote: > 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 I'm not familiar with the hw, but I don't see any programming errors, so: Reviewed-by: Sean Paul > --- > 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 > -- Sean Paul, Software Engineer, Google / Chromium OS