Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4378077ybl; Tue, 20 Aug 2019 10:59:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqx425lVfzO2U9BxqRujg10Mc4kyGP+xdF5baSXqaK5XeHgJN++ppo2/fx+7xNXRmowcv+FP X-Received: by 2002:a63:e54f:: with SMTP id z15mr25700746pgj.4.1566323948466; Tue, 20 Aug 2019 10:59:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566323948; cv=none; d=google.com; s=arc-20160816; b=Biymw4M7gkcC9pRDMIL34azk0peP8InVoO5m9+1e39zAuFyB8VTNV5k6E/OuqV5Ixs P8hz93tPeV/pHSfjvdcqiEbiLd+yJsNducsFJ8JzND7bJXI1Z0CPjzpTvaXqVcR+ZBG0 9CT4wJUmbhJSLh2c46093hbmPMqMAmtuRmAInXXnGuLcBQjTikzBakpKvV4XrKeKn5Dv 27G98aVry36+cbeig5Ad3RXjZdZAQ2DIs0WsWidzfMiTWJ0ZLUmvpDXmil4Dzi6anLK1 nWjNFqpHLu+/P7cszLcKO2LfD41wsm9PGxfq0T049mfBH4AtFwy7LcNSBmODm14nfamy 3epQ== 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; bh=E3AIQeRbBtyWdiip4qk9q6zTSQYdoxJGwudURGh8H1M=; b=J89qFXZFH0BDdcgBKNXIIOkY2tSF2x87PuVKN36cn7kZgY7iNnaAupe62GUgkl1G6x iECIHPsiiK0FmTkV1Qd/UhB40F2P8aw4yz9E/HFmydcg4w/35kDv2CVeBY+g33CQlX6K hw1IV+vZF1OxntujKYgyyysZ5cIWmwyjlO2sDfaVgkuiR5gYOpkqBTZOyuYPRP7yVDi1 EywEB6YoWsrxGQKXhpZvSJntZSGcliAKlMDnfqYaH9xIAsVXoQt9RZhWwTQreZIJSGxR TszfYnNkLZNuL3cEoJZB2QL1oJUD5zaGBArZqOfePfSxlZrBaKr3xA6GvazIpwwEwC6o zs0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=IIuxCgp6; 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 y187si12416371pgd.66.2019.08.20.10.58.53; Tue, 20 Aug 2019 10:59:08 -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; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=IIuxCgp6; 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 S1730423AbfHTR57 (ORCPT + 99 others); Tue, 20 Aug 2019 13:57:59 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:42474 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730006AbfHTR57 (ORCPT ); Tue, 20 Aug 2019 13:57:59 -0400 Received: from pendragon.ideasonboard.com (dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4DF0A33D; Tue, 20 Aug 2019 19:57:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1566323877; bh=miwUknVhgQ902Gs6x9av3rDFGsRLFeuwfvd/ATk1ig4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IIuxCgp6pjKozIyoaL1KdTmIfqLNZ3uX5U1uM+/Koth6YaneTR5c26mTi5JQ6a7VF b57ZzT3tL7ouufOM4z80S30st774FPGYBBE33YSnl1f/fE2Qmf6J/gZBS7xbT5Z+RJ O/ROFuTT9YPvYG8uNIZREDbIlDGzVgAdKGBTTlW8= Date: Tue, 20 Aug 2019 20:57:51 +0300 From: Laurent Pinchart To: Jacopo Mondi Cc: kieran.bingham+renesas@ideasonboard.com, airlied@linux.ie, daniel@ffwll.ch, koji.matsuoka.xm@renesas.com, muroya@ksk.co.jp, VenkataRajesh.Kalakodima@in.bosch.com, Harsha.ManjulaMallikarjun@in.bosch.com, linux-renesas-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 17/19] drm: rcar-du: crtc: Enable and disable CMMs Message-ID: <20190820175751.GK10820@pendragon.ideasonboard.com> References: <20190706140746.29132-1-jacopo+renesas@jmondi.org> <20190706140746.29132-18-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190706140746.29132-18-jacopo+renesas@jmondi.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jacopo, Thank you for the patch. On Sat, Jul 06, 2019 at 04:07:44PM +0200, Jacopo Mondi wrote: > Enable/disable the CMM associated with a CRTC at crtc start and stop s/crtc/CRTC/ > time and enable the CMM unit through the Display Extensional Functions > register at group setup time. > > Signed-off-by: Jacopo Mondi > --- > drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 7 +++++++ > drivers/gpu/drm/rcar-du/rcar_du_group.c | 8 ++++++++ > drivers/gpu/drm/rcar-du/rcar_du_regs.h | 5 +++++ > 3 files changed, 20 insertions(+) > > diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c > index 23f1d6cc1719..3dac605c3a67 100644 > --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c > +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c > @@ -21,6 +21,7 @@ > #include > #include > > +#include "rcar_cmm.h" > #include "rcar_du_crtc.h" > #include "rcar_du_drv.h" > #include "rcar_du_encoder.h" > @@ -619,6 +620,9 @@ static void rcar_du_crtc_stop(struct rcar_du_crtc *rcrtc) > if (rcar_du_has(rcrtc->dev, RCAR_DU_FEATURE_VSP1_SOURCE)) > rcar_du_vsp_disable(rcrtc); > > + if (rcrtc->cmm) > + rcar_cmm_disable(rcrtc->cmm); > + > /* > * Select switch sync mode. This stops display operation and configures > * the HSYNC and VSYNC signals as inputs. > @@ -686,6 +690,9 @@ static void rcar_du_crtc_atomic_enable(struct drm_crtc *crtc, > } > > rcar_du_crtc_start(rcrtc); > + > + if (rcrtc->cmm) > + rcar_cmm_enable(rcrtc->cmm); > } > > static void rcar_du_crtc_atomic_disable(struct drm_crtc *crtc, > diff --git a/drivers/gpu/drm/rcar-du/rcar_du_group.c b/drivers/gpu/drm/rcar-du/rcar_du_group.c > index 9eee47969e77..d252c9bb9809 100644 > --- a/drivers/gpu/drm/rcar-du/rcar_du_group.c > +++ b/drivers/gpu/drm/rcar-du/rcar_du_group.c > @@ -147,6 +147,14 @@ static void rcar_du_group_setup(struct rcar_du_group *rgrp) > > rcar_du_group_setup_pins(rgrp); > > + if (rcar_du_has(rcdu, RCAR_DU_FEATURE_CMM)) { > + u32 defr7 = DEFR7_CODE | > + (rgrp->cmms_mask & BIT(1) ? DEFR7_CMME1 : 0) | > + (rgrp->cmms_mask & BIT(0) ? DEFR7_CMME0 : 0); Nitpicking, the DU driver usually puts the | at the beginning of the next line for such assignments. u32 defr7 = DEFR7_CODE | (rgrp->cmms_mask & BIT(1) ? DEFR7_CMME1 : 0) | (rgrp->cmms_mask & BIT(0) ? DEFR7_CMME0 : 0); Apart from that, Reviewed-by: Laurent Pinchart > + > + rcar_du_group_write(rgrp, DEFR7, defr7); > + } > + > if (rcdu->info->gen >= 2) { > rcar_du_group_setup_defr8(rgrp); > rcar_du_group_setup_didsr(rgrp); > diff --git a/drivers/gpu/drm/rcar-du/rcar_du_regs.h b/drivers/gpu/drm/rcar-du/rcar_du_regs.h > index bc87f080b170..fb9964949368 100644 > --- a/drivers/gpu/drm/rcar-du/rcar_du_regs.h > +++ b/drivers/gpu/drm/rcar-du/rcar_du_regs.h > @@ -197,6 +197,11 @@ > #define DEFR6_MLOS1 (1 << 2) > #define DEFR6_DEFAULT (DEFR6_CODE | DEFR6_TCNE1) > > +#define DEFR7 0x000ec > +#define DEFR7_CODE (0x7779 << 16) > +#define DEFR7_CMME1 BIT(6) > +#define DEFR7_CMME0 BIT(4) > + > /* ----------------------------------------------------------------------------- > * R8A7790-only Control Registers > */ -- Regards, Laurent Pinchart