From patchwork Mon Oct 18 15:58:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1542784 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=XNj28Vyq; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HY1lQ6YZgz9sRR for ; Tue, 19 Oct 2021 02:59:14 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1mcV2Y-00032C-Es; Mon, 18 Oct 2021 15:59:06 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mcV2P-0002vX-Lj for kernel-team@lists.ubuntu.com; Mon, 18 Oct 2021 15:58:57 +0000 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 0E7283FFE2 for ; Mon, 18 Oct 2021 15:58:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1634572737; bh=Qc0lsBRXwBtDN4EJKvRPYBcFAs86F3VSu/qXLaicvXQ=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XNj28Vyq0gEsow2FwkhieQeCr3tfvwAe6bSrMWj0M8CILEMucIFMEwieZUj4kK7I9 8vPczbTDowAfKf+wf9cYgRdFUunoz+2+6BbvrXfUrUfP/DljwjmBebWzZMEkBz3Ats 80NV+Sf15bkk4w1K7JHAm0CNU/yVFpcZV2I8y0fxwND/+3zXXXMaqrQG6Cyrt7PiVP fEs9/4hBvhWG953cISwd8NzBha7/WOabUxBKY8levDrk+eC+AiRNulAcjHe1vW85Q4 LEZOP8ipmj6BoJsZxwNTRE7J17B7FdieBIqzKy7rWobNnWBzr5FkEHRJTUI+QRts3x W+2ZA7iiNASjQ== Received: by mail-ed1-f69.google.com with SMTP id u10-20020a50d94a000000b003dc51565894so8120594edj.21 for ; Mon, 18 Oct 2021 08:58:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Qc0lsBRXwBtDN4EJKvRPYBcFAs86F3VSu/qXLaicvXQ=; b=b7hJGnlt8bY/sCT1ssRwC3x1S22Zg7WcqQSANYcrQnyEwWEKJzty/7bi4oAxMqM7FZ BgDnDBAXm0YPSou7csKiJz3yXkDL6oD8Qbhj/TBZ2W/DqvqWUSareK/RA6MeAetcjMyz I8EsfyDPal0i8WxxPXYJPG/wh6cC5mtMNZgt+OVhDbAnTY2ZzgBHVDpNlWJpq1JynP+3 G2fHEs3+oqpTDY7gfo0p1IJxpajl7G7tuZJIIuxkQYnzTp+YAsMgmz6JuObH3F7AZ9Vn HZoQEr55KP2n+2ikKbBgo/0uexMQbVAZ/DobHPu2+jlIOjg4ocTL9XYfCWYQtKx+bDzM Mh6Q== X-Gm-Message-State: AOAM530wBxlKUIb/ebMqdMqA/G7Cf07hzJ6ILkJHvrjFmnSA1kUobq7J 7MkaB17hapGXoFBRCFKNp5IwfjWPZonqDIICitC8af/4mw2uVc1ua8ypOdfkC8DIVur5WBx2Fr1 odY0orYZGfCrW5M/l4nqSqc8H/D8tSqx7OalTfjqwug== X-Received: by 2002:a05:6402:16d8:: with SMTP id r24mr45327625edx.47.1634572736770; Mon, 18 Oct 2021 08:58:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtdLhtOBc88uuEYLlbevKQJ6uAsftlycJB6l7aS4pP6n9herEDBrPX9ZjQ8d9gaTvW9K7utg== X-Received: by 2002:a05:6402:16d8:: with SMTP id r24mr45327607edx.47.1634572736607; Mon, 18 Oct 2021 08:58:56 -0700 (PDT) Received: from gollum.fritz.box ([194.191.244.86]) by smtp.gmail.com with ESMTPSA id r22sm9078623ejd.109.2021.10.18.08.58.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 08:58:56 -0700 (PDT) From: Juerg Haefliger X-Google-Original-From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [SRU][I/raspi][PATCH 10/10] drm/vc4: Increase the core clock to a minimum of 500MHz Date: Mon, 18 Oct 2021 17:58:48 +0200 Message-Id: <20211018155848.334053-11-juergh@canonical.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211018155848.334053-1-juergh@canonical.com> References: <20211018155848.334053-1-juergh@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Maxime Ripard BugLink: https://bugs.launchpad.net/bugs/1946368 The core clock needs to be raised temporarily during a modeset to 500MHz. However, the HVS core clock requirement might be higher than 500MHz. This rate will be enforced at the end of the mode setting, meaning that might might end up with a core clock rate lower than planned on the first mode set. Use the maximum value of 500MHz and the HVS core clock rate for our temporary boost to fix this issue. Signed-off-by: Maxime Ripard (forward ported from commit 0a7c2180876d9c7748e055091be21efb959934e2 rpi-5.10.y) [juergh: new_hvs_state -> hvs_state.] Signed-off-by: Juerg Haefliger --- drivers/gpu/drm/vc4/vc4_kms.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index 10990d7cc285..fb2465964d46 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -348,11 +348,17 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) } if (vc4->hvs && vc4->hvs->hvs5) { + unsigned long core_rate = max_t(unsigned long, + 500000000, + hvs_state->core_clock_rate); + + drm_dbg(dev, "Raising the core clock at %lu Hz\n", core_rate); + /* * Do a temporary request on the core clock during the * modeset. */ - core_req = clk_request_start(hvs->core_clk, 500000000); + core_req = clk_request_start(hvs->core_clk, core_rate); /* * And remove the previous one based on the HVS