Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3705190ybv; Mon, 10 Feb 2020 05:03:14 -0800 (PST) X-Google-Smtp-Source: APXvYqzRJPD43jQpKLj/xizKNB1lNw54bQK6weHMAN1Ci3JeQOAqYJqA1SHGkPb0DAa7UMWR+JJx X-Received: by 2002:a9d:62d8:: with SMTP id z24mr931992otk.362.1581339794476; Mon, 10 Feb 2020 05:03:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581339794; cv=none; d=google.com; s=arc-20160816; b=qk3aAQk4QLpoWsJUnh4V8LNo1KENEEqrdqYvlaDv71f6Uz6OuqvChgc5xJNJpF39Z/ N8DV3386ARK+IiDrRZhIyVmlhOr3Fk3fyjXdEVFQUEWFOa55oQkWvPZ3r6TeTVOD1gco jYLmmGU8cBrayzqIcN1QSo42AvXUyVT3RE1SeG2tE29tBgg4hP0edU8p9NJuOv1udqWR +AXOxNPQlUg+nxuP2e+loZZc/HlMI3j5LEaEox2MCA5CtLNsjLhmj0TZJN7TntSeFOOa juJOyhB3sljkUSHozG4CSXUIxmtKpt8fV+r4lqfgRk56dwdmuPo/INTJR3MIdZMpYxVt hQVw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fOabqQ9W88oWPGnQ0JT3dOFCP700O2tlQZpQ70G/8gA=; b=iPr8Zlj3R6PLGoEG9ahsM8miUP6eKeFjh4c5eMjeIJsUCfKx7jP3W0kFIqfNK8bvhP Xkz+0ezL6q/eMBy/fHB+KSyVXqe2zE/C24TJXAkKjuRiFrsBOBh06naEpAmOjdM1vH4r 6c8VzQzWd86h97bsenTVOw06gJ1J3MS/z2V/OyvjwhHS6OqJ6wqHfbVC18DEd/MQar46 uXQNu7JBymFfmFB+q4rj9HvZo+TztgD1jc24tXFiTqEVmb/jX3T6pcxa5Rr//liG9UY7 2Y7PmpAZX9JSFcAnWSq+60X3MlSfO1/F3MwUMtuqwkkTxgCYseqJ6qd0cWD6S5K+Mm4c ryKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dEXMgB2D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d15si155366otl.82.2020.02.10.05.02.45; Mon, 10 Feb 2020 05:03:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dEXMgB2D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730050AbgBJNAp (ORCPT + 99 others); Mon, 10 Feb 2020 08:00:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:42070 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729852AbgBJMk6 (ORCPT ); Mon, 10 Feb 2020 07:40:58 -0500 Received: from localhost (unknown [209.37.97.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 040E320842; Mon, 10 Feb 2020 12:40:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338458; bh=IUxzkbV4y8t9RmxGGJIIkdoyBSZBfGfzwVwqW44vYy8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dEXMgB2Deg5rJcd+3dlvapR4kymziqUy0W8x5VGbxKKTJWCgti2S8K4HaGRMg9C+V a3JztG+YRIL1YsLTkMYpBCIu+eC2zQ0E7+9tsMNLJV4yOY2HqYWwB+bpVcTKVcvKXj RgoFsW9LHk/Qezs+JzBTieJpvkw1nr9nA89HbMk8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Claudiu Beznea , Sam Ravnborg , Boris Brezillon Subject: [PATCH 5.5 212/367] drm: atmel-hlcdc: use double rate for pixel clock only if supported Date: Mon, 10 Feb 2020 04:32:05 -0800 Message-Id: <20200210122443.877035490@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Claudiu Beznea commit 07acf4bafe81dd37eff3fbcfbbdbc48084bc202b upstream. Doubled system clock should be used as pixel cock source only if this is supported. This is emphasized by the value of atmel_hlcdc_crtc::dc::desc::fixed_clksrc. Fixes: a6eca2abdd42 ("drm: atmel-hlcdc: add config option for clock selection") Signed-off-by: Claudiu Beznea Signed-off-by: Sam Ravnborg Cc: Boris Brezillon Cc: # v5.3+ Link: https://patchwork.freedesktop.org/patch/msgid/1576672109-22707-2-git-send-email-claudiu.beznea@microchip.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c @@ -95,14 +95,14 @@ static void atmel_hlcdc_crtc_mode_set_no (adj->crtc_hdisplay - 1) | ((adj->crtc_vdisplay - 1) << 16)); + prate = clk_get_rate(crtc->dc->hlcdc->sys_clk); + mode_rate = adj->crtc_clock * 1000; if (!crtc->dc->desc->fixed_clksrc) { + prate *= 2; cfg |= ATMEL_HLCDC_CLKSEL; mask |= ATMEL_HLCDC_CLKSEL; } - prate = 2 * clk_get_rate(crtc->dc->hlcdc->sys_clk); - mode_rate = adj->crtc_clock * 1000; - div = DIV_ROUND_UP(prate, mode_rate); if (div < 2) { div = 2;