Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2642555ybk; Mon, 18 May 2020 04:29:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2rTP7hZKBCqfTuiVWfUJM14wPhGQwOJNIyH7J6ZFlMM7p320l1THwzS6fBMUgyzLgPrig X-Received: by 2002:a17:906:ece4:: with SMTP id qt4mr14855240ejb.162.1589801374338; Mon, 18 May 2020 04:29:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589801374; cv=none; d=google.com; s=arc-20160816; b=UAEl96AY56FHNFyig9A1g8NxgxIj2okXbXAQE4a5j+siQ5Igrud4lVkWPL1xQ5/2+Y Xdyjs8GK1/3BFjtW9c3hcLODDnCGOTQlOGeyoEVXsKUyPj8BZzCBadJZGnOi4u4n1sTw FaR46E1mDwfz8450vzCSFPi7UC2QMJd9FsWNVK51SBYZBYAtrbEm6MRaD5tPF/bSNwnr g/15ylY911s2lLgT2gdzbqXZDI5o9czhNXZIa+qo7qXPzKK4iyuhPCFuwRMwFKOUpVVP s770XKZweM8kY/qgS0SAJmepACd9vOVgZxtsPFZIm6xNgnN+0xzFefnqq/mTolBpcpq7 3+PA== 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:cc:to:subject:from:date :dkim-signature; bh=Tvn5nLaWGrzfShxUOvOGAY+B3v9oKV0REWchgAjg+ps=; b=jIarvnt9gH3KJ0cG+6JTKGQ0qawQVVjzGqhLf5LxWzO0afnukpHDwYmrICC5IW8gwu xiCKmXbs2hsYpOe8A2xPNR7c1d8Yvlm/6r25+49K/oaTO7vnqBRDomvShGXesbDw3l+t yena1MQhSkpqSq0Z9OQv69QHe0l/oo8oND0X6oyX1V73i9n3BcSnwNN7WuQPSQuBEdO4 HPVC6q6eK8KTMr3TnGQSmDX55mbbgiAcK5Z8IeULXYNq5pyNXF+1QkRjrTFAzHplwLK6 1KhKiTxsFjBG+bunVQWvljEUY6IRNiihS6rixbNbqjzcSBIu83VhlHxKo5wke3wrai1E 1j7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=qIFV6CKF; 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 w21si6244851ejz.276.2020.05.18.04.29.10; Mon, 18 May 2020 04:29:34 -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=qIFV6CKF; 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 S1726585AbgERL1O (ORCPT + 99 others); Mon, 18 May 2020 07:27:14 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:53178 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726557AbgERL1O (ORCPT ); Mon, 18 May 2020 07:27:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1589801230; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Tvn5nLaWGrzfShxUOvOGAY+B3v9oKV0REWchgAjg+ps=; b=qIFV6CKF52U3yd4k3ke3sIOnyAJmRhauaGV3FzX3WGiZNmRDhflWKDE0YQRdC5VuFgGyyE 31fwL2ACyG91ZYgJ+yMID+k6fILOmdHEnYO+ZsoSFU9aI1lwZyt6tpLWMuEwvj6yTy5NUt aFjUKd/YRQCXMKn4IrMIFDDnuBl89vE= Date: Mon, 18 May 2020 13:26:58 +0200 From: Paul Cercueil Subject: Re: [PATCH 11/12] gpu/drm: Ingenic: Add support for the IPU To: Emil Velikov Cc: David Airlie , Daniel Vetter , Rob Herring , Greg Kroah-Hartman , "Rafael J . Wysocki" , devicetree , od@zcrc.me, linux-kernel@vger.kernel.org, ML dri-devel Message-Id: In-Reply-To: References: <20200516215057.392609-1-paul@crapouillou.net> <20200516215057.392609-11-paul@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Emil, Le lun. 18 mai 2020 =E0 11:48, Emil Velikov a=20 =E9crit : > Hi Paul, >=20 > Disclaimer: I don't know much about the hardware :-P >=20 > On Sun, 17 May 2020 at 00:31, Paul Cercueil =20 > wrote: >>=20 >> Add support for the Image Processing Unit (IPU) found in all Ingenic >> SoCs. >>=20 > Since the IPU is present on all devices supported, does it make sense > to have it as separate module? > Didn't check closely although I suspect doing that will remove the > need for the component patch. It makes sense to me; you may not want to enable the IPU on platforms=20 where it doesn't add much, e.g. on the JZ4725B where it only handles=20 YUV and not RGB. Besides, while the older JZ4740 SoC has a IPU, it's mem-to-mem and=20 cannot output directly to the CRTC, so it cannot be represented as a=20 plane. On this SoC the current IPU code cannot be used. So the Ingenic=20 DRM driver must still be able to probe with zero components. >> --- a/drivers/gpu/drm/ingenic/ingenic-drm.c >> +++ b/drivers/gpu/drm/ingenic/ingenic-drm.c >> @@ -50,7 +50,7 @@ struct jz_soc_info { >>=20 >> struct ingenic_drm { >> struct drm_device drm; >> - struct drm_plane f0, f1; >> + struct drm_plane f0, f1, *ipu_plane; >> struct drm_crtc crtc; >> struct drm_encoder encoder; >>=20 >> @@ -186,13 +186,16 @@ static void=20 >> ingenic_drm_crtc_update_timings(struct ingenic_drm *priv, >> regmap_update_bits(priv->map, JZ_REG_LCD_CTRL, >> JZ_LCD_CTRL_OFUP | JZ_LCD_CTRL_BURST_16, >> JZ_LCD_CTRL_OFUP | JZ_LCD_CTRL_BURST_16); >> + >> + regmap_write(priv->map, JZ_REG_LCD_IPUR, JZ_LCD_IPUR_IPUREN=20 >> | >> + (ht * vpe / 3) << JZ_LCD_IPUR_IPUR_LSB); >=20 > This hunk also indicates that it may be better to merge the IPU within > the existing driver. This writes the IPUR register of the CRTC, nothing wrong here. -Paul