Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1992246ybg; Thu, 30 Jul 2020 07:49:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpinqhK/c1ReBniUeroPjKuFkk5Xa548yKsK0j4iXWQws0q6i3LBqYwG3SdEwnstNsfoyM X-Received: by 2002:a17:906:17c1:: with SMTP id u1mr2917456eje.536.1596120577206; Thu, 30 Jul 2020 07:49:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596120577; cv=none; d=google.com; s=arc-20160816; b=UtLQnZeaBzvyWjxWnWvk0Aa48cBtvnuXsZKhgFbawdMB/KJQJTq+4zh/KtxqDFPdYd DzHL2fvKdKnilz1P+etTnbNh/FEaHVJJaClaM8eqVNWtiyqRme1xvti8rOWVeGHH3zR0 NXmrkUrD+qeNJiwlGwpeP+K/WsvhP67mBfokx9rqaA2a1w6ShTlU6jFp9KB79X5ctVL+ 6BQ3mVKxGxPrxERGik+FKUN+HR/HERBrQxiiidJQIEKTShLppM8BvE5zPTBr9xvBISqJ s6x7jknzXc6vMv5iENxfQk7fznmiiwcEjn2fZRVR46ZoFhoxqokhRnKnVWxLmQ53djub 3fuA== 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 :dkim-signature; bh=FdoE1nkLDPbTG7FoC1IHhp8tIhNRgkzWtzI0H+/zMgQ=; b=nGzohdo8sPKayBGNfFFrnPujVwx00X3UCp4ltyjtrXAdJsWc+3qbnArohH1e1JN2Ib d3x//WkTCmm8oIgHndOfagf2VOPyEc3kz3EfEosmnQHeWjf41k8r8KmGhx2wxOG4tvRt 9RGYqJ4up8RyuYHDjeFP0pKciVv0Un+q2BbQB7VXMtMTPqRQAbISOHZyK1PEhWy9PSKt 6wBJ5kxs9I9HC6GPXCsGTOjjux5pFOOUtqXLVFqX5EtLH4WuhPtISSLwEsryujz0n2ok yM/siqibaENP1c5R1UbHkwECwFRipW+x6X2pqLQuQNf350mAgOEQfrVe9kG9tWT9YSsf f1jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=KC3TWDmn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h22si3527558ejf.75.2020.07.30.07.49.14; Thu, 30 Jul 2020 07:49:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=KC3TWDmn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729482AbgG3Osq (ORCPT + 99 others); Thu, 30 Jul 2020 10:48:46 -0400 Received: from crapouillou.net ([89.234.176.41]:35518 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726275AbgG3Osp (ORCPT ); Thu, 30 Jul 2020 10:48:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1596120516; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FdoE1nkLDPbTG7FoC1IHhp8tIhNRgkzWtzI0H+/zMgQ=; b=KC3TWDmn1K7+LRoLXGczHqEpdLlgf0dZ/d9rTADan7xOdnYeqYhPcBLLYFkzwyFBVin8aE tMLvBhYZX7m4SZAiBwfjsI4MbjqTwhhApqK21WmODvvyX5AlDKwtm4Hj/nziIaccY8OKNq XLlRe5/RYoIehupCk5crTM7mg5VesCo= From: Paul Cercueil To: David Airlie , Daniel Vetter Cc: Sam Ravnborg , od@zcrc.me, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH v2 1/3] drm/ingenic: ipu: Only restart manually on older SoCs Date: Thu, 30 Jul 2020 16:48:28 +0200 Message-Id: <20200730144830.10479-2-paul@crapouillou.net> In-Reply-To: <20200730144830.10479-1-paul@crapouillou.net> References: <20200730144830.10479-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On older SoCs, it is necessary to restart manually the IPU when a frame is done processing. Doing so on newer SoCs (JZ4760/70) kinds of work too, until the input or output resolutions or the framerate are too high. Make it work properly on newer SoCs by letting the LCD controller trigger the IPU frame restart signal. Reviewed-by: Sam Ravnborg Signed-off-by: Paul Cercueil --- drivers/gpu/drm/ingenic/ingenic-ipu.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ingenic/ingenic-ipu.c b/drivers/gpu/drm/ingenic/ingenic-ipu.c index 7a0a8bd865d3..7eae56fa92ea 100644 --- a/drivers/gpu/drm/ingenic/ingenic-ipu.c +++ b/drivers/gpu/drm/ingenic/ingenic-ipu.c @@ -35,6 +35,7 @@ struct soc_info { const u32 *formats; size_t num_formats; bool has_bicubic; + bool manual_restart; void (*set_coefs)(struct ingenic_ipu *ipu, unsigned int reg, unsigned int sharpness, bool downscale, @@ -645,7 +646,8 @@ static irqreturn_t ingenic_ipu_irq_handler(int irq, void *arg) unsigned int dummy; /* dummy read allows CPU to reconfigure IPU */ - regmap_read(ipu->map, JZ_REG_IPU_STATUS, &dummy); + if (ipu->soc_info->manual_restart) + regmap_read(ipu->map, JZ_REG_IPU_STATUS, &dummy); /* ACK interrupt */ regmap_write(ipu->map, JZ_REG_IPU_STATUS, 0); @@ -656,7 +658,8 @@ static irqreturn_t ingenic_ipu_irq_handler(int irq, void *arg) regmap_write(ipu->map, JZ_REG_IPU_V_ADDR, ipu->addr_v); /* Run IPU for the new frame */ - regmap_set_bits(ipu->map, JZ_REG_IPU_CTRL, JZ_IPU_CTRL_RUN); + if (ipu->soc_info->manual_restart) + regmap_set_bits(ipu->map, JZ_REG_IPU_CTRL, JZ_IPU_CTRL_RUN); drm_crtc_handle_vblank(crtc); @@ -806,6 +809,7 @@ static const struct soc_info jz4725b_soc_info = { .formats = jz4725b_ipu_formats, .num_formats = ARRAY_SIZE(jz4725b_ipu_formats), .has_bicubic = false, + .manual_restart = true, .set_coefs = jz4725b_set_coefs, }; @@ -831,6 +835,7 @@ static const struct soc_info jz4760_soc_info = { .formats = jz4760_ipu_formats, .num_formats = ARRAY_SIZE(jz4760_ipu_formats), .has_bicubic = true, + .manual_restart = false, .set_coefs = jz4760_set_coefs, }; -- 2.27.0