Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp355962pxk; Thu, 3 Sep 2020 01:11:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxU0yTU0OhPtMCiNXS9xbZsbIDTcOP5ffrt3wBkqiy6osc7Jgi3B55A59FHVADBMpNLi2jl X-Received: by 2002:a17:906:1b:: with SMTP id 27mr876765eja.169.1599120692308; Thu, 03 Sep 2020 01:11:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599120692; cv=none; d=google.com; s=arc-20160816; b=X2RiekGW21g49OOrNwtMSJ38UEU9lqA+LoMcZtGHffjof30hjNXRCOWqaOVHNdzTys YwJ+F7qCq+63EwHwTp4fosBzie2bcF9liQ5WareuXo7iFq0ci0JOwYdsAkEye6O3Jz3v 3urYW8o3igWzSluyIlDwQdpgw0f67O3FAyojwwP7jfjUE3tEhWnLblt/mHrdw3X4epRN AYssCQY8VOnQ4Gl5ecNECMZkGx6ZXJyfOr0GNPq5ezeqcVGSEjQq5DjJNMGRdG4KxdA6 444J4qg16i1eC2LVb+xdwaJiRLtIR06bBsA9uQyqNNeyR0U0mSy5Waun2bXkemY2yIGh CE2w== 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:dkim-signature; bh=drJ+BFJBQYiQbDPjeCt0XCzj5cTedbAvqWxxXhWZ8EE=; b=nA30yAd1+5npy7cSNKeHMsWStpofU/qIPAY83V/eL4Jn8WrLMxqBR4g0eAxEy7ggZa AJvwZsenEOhQvBkno7WEN6kEYuz8Vm6v1OFoSWM8CROypmofWGjp0IJXtW/gV2yuiiU9 x3+ZGUZnDq47YVTZIX1QJTdz1PJoONZ/X4UYPOIISq1T2Vozsaf9DDJ+FJ35XeXnJnvg PQW4KYYXFe0VCOTuPqn8TfA5xYXgTWm4tPNZL2ybBWKIaY22KuHhqWwFjjD74Ktegme2 op3EjmdwYh4gbTLioIWD7+YGj1/iE/nl8LtP7Qys/GesgxtDXGoJQBoVLQsRZqCrkQdp v+1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=gCCzoAdC; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=CZqFk8Zl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t5si1367505edi.523.2020.09.03.01.11.08; Thu, 03 Sep 2020 01:11:32 -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=pass header.i=@cerno.tech header.s=fm3 header.b=gCCzoAdC; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=CZqFk8Zl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728775AbgICIHk (ORCPT + 99 others); Thu, 3 Sep 2020 04:07:40 -0400 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:50575 "EHLO wnew4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728536AbgICIDs (ORCPT ); Thu, 3 Sep 2020 04:03:48 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id E3329B44; Thu, 3 Sep 2020 04:03:45 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 03 Sep 2020 04:03:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=drJ+BFJBQYiQb DPjeCt0XCzj5cTedbAvqWxxXhWZ8EE=; b=gCCzoAdCYyGXvRsdqASjO73QpOwQJ zQjppC7iedvkdUtYOqNlCAFxeHw8BJUQ5TmvzO/uSPOcb0LoDyY35tFB2gAGI+5E eexqW+uT844t4SF+FFj3+KLkpz1achXpUWrgeWRpntG3enU865Lh6OQ6p0C8Ner3 tkl8s8DWPr08bi1eFEorjdWYA/HPPW1q31I3oKU1UGXiD7RHeo3Cggut+lriOgf6 CcA6YtFoeWZB2s1bLHGo1uwuC1sPQXnP6MQbE6BAw4vl2ImPnx1NgveqgihAc/7Y hNwnz8yMTfwJ4dlDW29bktf+qLi2ryo6iQ/eRVk+GYl2gIqdtvabdln4w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=drJ+BFJBQYiQbDPjeCt0XCzj5cTedbAvqWxxXhWZ8EE=; b=CZqFk8Zl zXDbmjhIjGht5eOI4Jwu6VTkDhFErkBCMsLoIe3fJ4ERSF9c16cMujrcRJB1RRZI s7LPlCoB+C7NPPNCRWVae9dNUv3UADpc8kiZstXQAF/PP+F94JjIU5rAvs5Ci8cc 7QLhaspp87Mm4MRJBzbOHckgIuLlRDxoRrsYqxF+Xl31nOO2oS8moKlSCkpQyPnJ ijL5TWgfi8f++4GyqWt7U6iDQlbfGmy/OtSmZU9viw3oZCw62dHE/sSCjuZrMy9A SdCGBYBbzxbtEFQIVFQk9WsCcvqKVdc5nSjBYiwOL8QW1hng728F65oGsiA//O0q LGsLAbYn46D5ig== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudegtddguddviecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveev heehvdenucfkphepledtrdekledrieekrdejieenucevlhhushhtvghrufhiiigvpeejvd enucfrrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 2A1B4306005F; Thu, 3 Sep 2020 04:03:45 -0400 (EDT) From: Maxime Ripard To: Nicolas Saenz Julienne , Eric Anholt Cc: dri-devel@lists.freedesktop.org, linux-rpi-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dave Stevenson , Tim Gover , Phil Elwell , Maxime Ripard , Chanwoo Choi , Hoegeun Kwon , Stefan Wahren Subject: [PATCH v5 79/80] drm/vc4: drv: Support BCM2711 Date: Thu, 3 Sep 2020 10:01:51 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: 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 The BCM2711 has a reworked display pipeline, and the load tracker needs some adjustment to operate properly. Let's add a compatible for BCM2711 and disable the load tracker until properly supported. Tested-by: Chanwoo Choi Tested-by: Hoegeun Kwon Tested-by: Stefan Wahren Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_drv.c | 1 +- drivers/gpu/drm/vc4/vc4_drv.h | 3 ++- drivers/gpu/drm/vc4/vc4_kms.c | 44 +++++++++++++++++++++++----------- drivers/gpu/drm/vc4/vc4_plane.c | 5 ++++- 4 files changed, 40 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 9567d1019212..f1a5fd5dab6f 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -372,6 +372,7 @@ static int vc4_platform_drm_remove(struct platform_device *pdev) } static const struct of_device_id vc4_of_match[] = { + { .compatible = "brcm,bcm2711-vc5", }, { .compatible = "brcm,bcm2835-vc4", }, { .compatible = "brcm,cygnus-vc4", }, {}, diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index 501a48a714d3..8c8d96b6289f 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h @@ -200,6 +200,9 @@ struct vc4_dev { int power_refcount; + /* Set to true when the load tracker is supported. */ + bool load_tracker_available; + /* Set to true when the load tracker is active. */ bool load_tracker_enabled; diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index bfc7ddd49ac5..16e233e1406e 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -536,6 +536,9 @@ static int vc4_load_tracker_atomic_check(struct drm_atomic_state *state) struct drm_plane *plane; int i; + if (!vc4->load_tracker_available) + return 0; + priv_state = drm_atomic_get_private_obj_state(state, &vc4->load_tracker); if (IS_ERR(priv_state)) @@ -683,12 +686,18 @@ int vc4_kms_load(struct drm_device *dev) struct vc4_dev *vc4 = to_vc4_dev(dev); struct vc4_ctm_state *ctm_state; struct vc4_load_tracker_state *load_state; + bool is_vc5 = of_device_is_compatible(dev->dev->of_node, + "brcm,bcm2711-vc5"); int ret; - /* Start with the load tracker enabled. Can be disabled through the - * debugfs load_tracker file. - */ - vc4->load_tracker_enabled = true; + if (!is_vc5) { + vc4->load_tracker_available = true; + + /* Start with the load tracker enabled. Can be + * disabled through the debugfs load_tracker file. + */ + vc4->load_tracker_enabled = true; + } sema_init(&vc4->async_modeset, 1); @@ -702,8 +711,14 @@ int vc4_kms_load(struct drm_device *dev) return ret; } - dev->mode_config.max_width = 2048; - dev->mode_config.max_height = 2048; + if (is_vc5) { + dev->mode_config.max_width = 7680; + dev->mode_config.max_height = 7680; + } else { + dev->mode_config.max_width = 2048; + dev->mode_config.max_height = 2048; + } + dev->mode_config.funcs = &vc4_mode_funcs; dev->mode_config.preferred_depth = 24; dev->mode_config.async_page_flip = true; @@ -718,14 +733,17 @@ int vc4_kms_load(struct drm_device *dev) drm_atomic_private_obj_init(dev, &vc4->ctm_manager, &ctm_state->base, &vc4_ctm_state_funcs); - load_state = kzalloc(sizeof(*load_state), GFP_KERNEL); - if (!load_state) { - drm_atomic_private_obj_fini(&vc4->ctm_manager); - return -ENOMEM; - } + if (vc4->load_tracker_available) { + load_state = kzalloc(sizeof(*load_state), GFP_KERNEL); + if (!load_state) { + drm_atomic_private_obj_fini(&vc4->ctm_manager); + return -ENOMEM; + } - drm_atomic_private_obj_init(dev, &vc4->load_tracker, &load_state->base, - &vc4_load_tracker_state_funcs); + drm_atomic_private_obj_init(dev, &vc4->load_tracker, + &load_state->base, + &vc4_load_tracker_state_funcs); + } drm_mode_config_reset(dev); diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index 1e38e603f83b..24d7e6db6fdd 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -516,6 +516,11 @@ static void vc4_plane_calc_load(struct drm_plane_state *state) struct vc4_plane_state *vc4_state; struct drm_crtc_state *crtc_state; unsigned int vscale_factor; + struct vc4_dev *vc4; + + vc4 = to_vc4_dev(state->plane->dev); + if (!vc4->load_tracker_available) + return; vc4_state = to_vc4_plane_state(state); crtc_state = drm_atomic_get_existing_crtc_state(state->state, -- git-series 0.9.1