Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3973205pxb; Tue, 2 Mar 2021 03:32:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2ttVnusfkipgectnm3YK+dCdixSQ9MCPtp+MSLFhN4C+NlS6cBR7jdfgMhnC4Omu0dk5F X-Received: by 2002:a05:6402:b70:: with SMTP id cb16mr18864249edb.11.1614684746251; Tue, 02 Mar 2021 03:32:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614684746; cv=none; d=google.com; s=arc-20160816; b=iyUriC1bQ0Zol+rYC+hS2AgeDkLma0GyMxILqqVeCkCXmd6bxO8TT7CBIuHWS4wA0/ wQZ8Zve2zXSIRp7SnXurafmGHov2JUaNiUwM4fvbM0T9zW5pZ22PGlKxc6Dddb6xC8jD za0OGsYlKGhIvqzTCwZRF2i0WiQA++TklaahzJHuHsXQMZl4jfxRtfHDg7AOLJI/tsHX SXKOXzqrhohR1k4+P/9Id8hXhkLnvbwMq6CXKkhJWhLNbjvDE+3HHi+/ZENhUa8iTwxi lqzijIDpc064JsFOo7HPtwwBk6ocvGa1s/6UbH/U/cZiDQWK0+sWjIlHzRAJqo7ws5qk 1k1A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dWH/E6UFsiorm6DnYEsMET4HukKlhpCWJVpFGhBP6xQ=; b=ttSNfNlqH5vQZSIPG5m17CurnZoJ23Ghyf7Si5M459he1xc3yawSrQWTlWy7P3HC+p lCO7GK+AfYdqkEodQV+6CjcGc4X8N8a5xkfauFcAA7IttNKB0oQTknxiO2Qy1d9B348u EmerugoRTLt/fqUasDBukHTGubgu27J3BS6fczD0vXJrm5i4K2/ieBYU/0X6bQUrEgv0 OQO1ehT027sKEQ4pTSYT9O/8/oJoeJ7t65pBaLj8l+NvvrLlJoP9IBFmXEC58ifRPzd0 y3XIEmoK4cuJgvSVx9Tfxi5oS6v3z7uIuKzcu3ub4y9CrwOXm339ABOqS2LQ/Ff0U5RE gfXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FZXYaqvN; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r21si13266707ejo.142.2021.03.02.03.32.03; Tue, 02 Mar 2021 03:32:26 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=FZXYaqvN; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380982AbhCBB5C (ORCPT + 99 others); Mon, 1 Mar 2021 20:57:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:50722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241610AbhCATcu (ORCPT ); Mon, 1 Mar 2021 14:32:50 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1601D6517F; Mon, 1 Mar 2021 17:09:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614618590; bh=DX675dF+c7aBs0VPMu0flNiJY7T+22HCjl74IRur11U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FZXYaqvNbehkmdLTVp3lKZvOJKOpG7aMYRqphuDcwNbvMvrUcdJWsC0KDL0TV0ofO 9UvMO2eo59wvdawwAjyTfcsnviaIhFWELqDAr0BSUgRCgAimFuMVfoHwKHgy6SIQAm vyq+i/qrSyQGA3HuJpaTD7YzylIHLJUBQdj8DI5w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Zimmermann , Dave Stevenson , Maxime Ripard , Sasha Levin Subject: [PATCH 5.10 143/663] drm/vc4: hdmi: Take into account the clock doubling flag in atomic_check Date: Mon, 1 Mar 2021 17:06:31 +0100 Message-Id: <20210301161148.843440907@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maxime Ripard [ Upstream commit 320e84dc6111ecc1c957e2b186d4d2bafee6bde2 ] Commit 63495f6b4aed ("drm/vc4: hdmi: Make sure our clock rate is within limits") was intended to compute the pixel rate to make sure we remain within the boundaries of what the hardware can provide. However, unlike what mode_valid was checking for, we forgot to take into account the clock doubling flag that can be set for modes. Let's honor that flag if it's there. Acked-by: Thomas Zimmermann Reported-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Fixes: 63495f6b4aed ("drm/vc4: hdmi: Make sure our clock rate is within limits") Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20201215154243.540115-4-maxime@cerno.tech Signed-off-by: Sasha Levin --- drivers/gpu/drm/vc4/vc4_hdmi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index eaba98e15de46..db06f52de9d91 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -791,6 +791,9 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder, pixel_rate = mode->clock * 1000; } + if (mode->flags & DRM_MODE_FLAG_DBLCLK) + pixel_rate = pixel_rate * 2; + if (pixel_rate > vc4_hdmi->variant->max_pixel_clock) return -EINVAL; -- 2.27.0