Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5560395pxb; Mon, 14 Feb 2022 01:57:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJyVM7yK8dp5/+CCY1McqaIkodFksxOKIP2Sfg3g5qv/hYAoPAbg6RhdOj6M2xTfe8326LO7 X-Received: by 2002:a05:6402:5c9:: with SMTP id n9mr14258036edx.207.1644832645214; Mon, 14 Feb 2022 01:57:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644832645; cv=none; d=google.com; s=arc-20160816; b=kNcE8Ue0pzMu1ZWliGFnrhGYukl2NAOtZ+/WuiKEaf+IXg33ipnmX+0NbDJ+sh/eMh mkniyeB1NK8DBmXbNTZsVX6lnpJbs67B4O842xFhq27e7JnIYirc5r/csx9bibuw6C4H UyZ+NDCoivceDKLc8bGFh+wpPa5UMT0Oo8bQ89ppPmeTWKdS/ZxXrcZYEf7x4rPC/ZTA mtOhk13xa7r6q1zjDuFo8/Kv/QCJ6AJCP0toOQvOFMBa1oRUePtb/PoG0owlqWVlMRbd eIFG13OXUzqNoLrfaPDevh4095Snmq+JYxqyhuqX9sQBnX3fit1EpU7yBvxcmiutgvwR Yk/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zCXgJblTF+rQHVFbLwGtG0urpFfPwR+Q4AYo+sbdsy4=; b=HOuRuw9CSSrfI+V9xjsUZwbOSTyMqQigfMihMkdfvLEtnnt9QkOxDGW5cJ4Lt6/GCs FQJ71kpkSjMY+Qw0DnizP2iufCO/ZfpmFi13ZXKjptqVc5j9VjatNK3gEDo49neKgLQr 3v69pqvq+lQx/V1//x2x+RqLQU78fITaM8XpTE47twViCXV78Iol+wztlrtIftw9nQm6 PDg/7oqkJ7BUavlsurFODwkXesLAn4EzVvSh9kEEPLG0SSYJUjk+LY4ZW2sw2etS6PhT ME1cwtL4RtoLdVSZYfmc0kBArL5+NXpe9U2PYqOo5fg/ZiZ4KfKBDE5rBfuavFY4nMxG hrJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=Tnvpyhca; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb3si14530898ejc.441.2022.02.14.01.57.01; Mon, 14 Feb 2022 01:57:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=Tnvpyhca; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236660AbiBLPv1 (ORCPT + 99 others); Sat, 12 Feb 2022 10:51:27 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236586AbiBLPvN (ORCPT ); Sat, 12 Feb 2022 10:51:13 -0500 Received: from mo4-p04-ob.smtp.rzone.de (mo4-p04-ob.smtp.rzone.de [81.169.146.223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA89524584; Sat, 12 Feb 2022 07:51:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1644681059; s=strato-dkim-0002; d=goldelico.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=zCXgJblTF+rQHVFbLwGtG0urpFfPwR+Q4AYo+sbdsy4=; b=Tnvpyhcaqr7gO81LE15meAOPLo7jocbovw18AxrBAViz8pJsiqqn7IJwCWrdFZ0uID 3qFM62+GrVIc7UBGviJAWX2oGistG7DmSKeIiZLkVvTkPZmT54zfHbbqK6we15Xsptzx fTZ27ZhrXGhw7VQnvS5jLUD626MEQASeaVprgksjhnJ+8sHqokWsptwb6+CLm1VErLKI GuDwjw6CSHF2ZARtyIY2a35u66q1suLBqjPUsSj+ba1moegiId3uMCHuCh8/mCaEKP2T en5HoB+u9WtcuCvwONNVYHHTe9HU3TLGpPbg5m4Ac3OyZ7bc4b/Id5LQigXXRr/Jt967 3AeA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMhflhwDubTJ9o1OAA2UMf2MwPVblcdY=" X-RZG-CLASS-ID: mo00 Received: from iMac.fritz.box by smtp.strato.de (RZmta 47.39.0 DYNA|AUTH) with ESMTPSA id L29417y1CFoxswu (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Sat, 12 Feb 2022 16:50:59 +0100 (CET) From: "H. Nikolaus Schaller" To: Andrzej Hajda , Neil Armstrong , Robert Foss , Paul Boddie , Laurent Pinchart , Jernej Skrabec , David Airlie , Daniel Vetter , Paul Cercueil , Maxime Ripard , Harry Wentland , "H. Nikolaus Schaller" , Kieran Bingham Cc: Jonas Karlman , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mips@vger.kernel.org, letux-kernel@openphoenux.org Subject: [PATCH v15 7/7] [RFC] drm/ingenic: add some more features specific to jz4780 Date: Sat, 12 Feb 2022 16:50:55 +0100 Message-Id: X-Mailer: git-send-email 2.33.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paul Boddie The jz4780 has some more features which should be initialized according to the vendor kernel. Signed-off-by: Paul Boddie Signed-off-by: H. Nikolaus Schaller --- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index dcf44cb00821f..fb2cdb188b993 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -66,6 +66,9 @@ struct jz_soc_info { bool needs_dev_clk; bool has_osd; bool has_alpha; + bool has_pcfg; + bool has_recover; + bool has_rgbc; bool map_noncoherent; bool use_extended_hwdesc; bool plane_f0_not_working; @@ -732,6 +735,9 @@ static void ingenic_drm_encoder_atomic_mode_set(struct drm_encoder *encoder, | JZ_LCD_CFG_SPL_DISABLE | JZ_LCD_CFG_REV_DISABLE; } + if (priv->soc_info->has_recover) + cfg |= JZ_LCD_CFG_RECOVER_FIFO_UNDERRUN; + if (priv->soc_info->use_extended_hwdesc) cfg |= JZ_LCD_CFG_DESCRIPTOR_8; @@ -1320,6 +1326,22 @@ static int ingenic_drm_bind(struct device *dev, bool has_components) osdc |= JZ_LCD_OSDC_ALPHAEN; regmap_write(priv->map, JZ_REG_LCD_OSDC, osdc); + /* Magic values from the vendor kernel for the priority thresholds. */ + if (soc_info->has_pcfg) + regmap_write(priv->map, JZ_REG_LCD_PCFG, + JZ_LCD_PCFG_PRI_MODE | + JZ_LCD_PCFG_HP_BST_16 | + (511 << JZ_LCD_PCFG_THRESHOLD2_OFFSET) | + (400 << JZ_LCD_PCFG_THRESHOLD1_OFFSET) | + (256 << JZ_LCD_PCFG_THRESHOLD0_OFFSET)); + + /* RGB output control may be superfluous. */ + if (soc_info->has_rgbc) + regmap_write(priv->map, JZ_REG_LCD_RGBC, + JZ_LCD_RGBC_RGB_FORMAT_ENABLE | + JZ_LCD_RGBC_ODD_RGB | + JZ_LCD_RGBC_EVEN_RGB); + mutex_init(&priv->clk_mutex); priv->clock_nb.notifier_call = ingenic_drm_update_pixclk; @@ -1483,6 +1505,9 @@ static const struct jz_soc_info jz4740_soc_info = { .needs_dev_clk = true, .has_osd = false, .map_noncoherent = false, + .has_pcfg = false, + .has_recover = false, + .has_rgbc = false, .max_width = 800, .max_height = 600, .formats_f1 = jz4740_formats, @@ -1494,6 +1519,9 @@ static const struct jz_soc_info jz4725b_soc_info = { .needs_dev_clk = false, .has_osd = true, .map_noncoherent = false, + .has_pcfg = false, + .has_recover = true, + .has_rgbc = true, .max_width = 800, .max_height = 600, .formats_f1 = jz4725b_formats_f1, @@ -1506,6 +1534,9 @@ static const struct jz_soc_info jz4770_soc_info = { .needs_dev_clk = false, .has_osd = true, .map_noncoherent = true, + .has_pcfg = false, + .has_recover = true, + .has_rgbc = true, .max_width = 1280, .max_height = 720, .formats_f1 = jz4770_formats_f1, @@ -1518,6 +1549,9 @@ static const struct jz_soc_info jz4780_soc_info = { .needs_dev_clk = true, .has_osd = true, .has_alpha = true, + .has_pcfg = true, + .has_recover = true, + .has_rgbc = true, .use_extended_hwdesc = true, .plane_f0_not_working = true, /* REVISIT */ .max_width = 4096, -- 2.33.0