Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1060522pxk; Mon, 31 Aug 2020 08:45:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwL6y3J5pm1FV+ZYRkiDkyJiBEyNs+5YRH9+3JOR/zh4xqxfqDYHVuRUrtPEPXZIO9NrL5F X-Received: by 2002:aa7:d805:: with SMTP id v5mr1784525edq.29.1598888719817; Mon, 31 Aug 2020 08:45:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598888719; cv=none; d=google.com; s=arc-20160816; b=UyqNW8f+GHCYA7v10tQ84opBrXILADpEFVsxxtUILueN2YROFjFMRgctnnjBimbGqo fLoZSKRG6DruxgU+i1w1nhwQy4YzjxGKz+5lC7y5iF1zfTweRmj9CBWl8qIpssGcg7BS nO7uho12a+DIkEdTwlGCaHjPtfdOR+iAZc3/MtI2qOwI8ng91UXZK0Axnd1bvUeesJXG /TTKaR/bkk8bhxllDick3EzbdmfTPKHk6Xofi4a6kILV2OICbM6kXzBtq39uF6ntGdIv VYpJKk0lJhHs0aT66XCVAw8cq1u9WlEajiaI+ofp1qLkDahtusc47FDCxILRafgbsB07 rPTg== 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; bh=3eEquM5Sgdu2zikjM0rCRe3Cv5DVXMBXU+6Cu0vIH8o=; b=kIrvDN7R56GduSW+ZkfZmcLu5PQUB62L71F8unK8zZKpXlf9LehScv5AtirM8g0tVJ L2eGuvk5JeJX2EKSNRSp9FhvK+zc6zTs8NcNRPoSoFhT/fpwX62zIOBwUNHTVcjxkPIH HAnOBxu7cTe9CDz2J6jTDrmLueVJPmwKwPcxNQ4c3CEsoJhEfX7zKOAVuxVwoH+xD29U HJEs7FlaLE092x6AWS3iyMJiGSAQZq+mXtVC6mb3jLRIwi1lCigG0/AWaMFx/nHJMZnQ l8+U8kdEdE/EsJAgwyt8bwLJHaJxjvkffC114jhvgtJIBDIRGGcvvHRxN9ac468Hqggt 8vlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rTCYaOD+; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gz7si3542259ejb.441.2020.08.31.08.44.57; Mon, 31 Aug 2020 08:45:19 -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=@kernel.org header.s=default header.b=rTCYaOD+; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728408AbgHaP3q (ORCPT + 99 others); Mon, 31 Aug 2020 11:29:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:38334 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726755AbgHaP3o (ORCPT ); Mon, 31 Aug 2020 11:29:44 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 383BA20936; Mon, 31 Aug 2020 15:29:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598887783; bh=VJ0G36w4AwGdWcGN89VVM6vkew7+G4ceTdRs1y5VBhs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rTCYaOD+E4TXIVTHBLu3t6ghmtVmEeDFVu50klulLG0fmuUDdJeMpI58nLps2uphO x2VwfoaSmunnDvKDcfhCg1QDd47ykD9l/R0yc0fB8Jn/T1GyMRlgHpi70Zmrz/BJg6 PiFtARASpyRr4tWffLj3gRqEIketWh+ia6voXvd4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Kalyan Thota , "Kristian H . Kristensen" , Rob Clark , Sasha Levin , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.8 05/42] drm/msm/dpu: Fix scale params in plane validation Date: Mon, 31 Aug 2020 11:28:57 -0400 Message-Id: <20200831152934.1023912-5-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200831152934.1023912-1-sashal@kernel.org> References: <20200831152934.1023912-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kalyan Thota [ Upstream commit 4c978caf08aa155bdeadd9e2d4b026d4ce97ebd0 ] Plane validation uses an API drm_calc_scale which will return src/dst value as a scale ratio. when viewing the range on a scale the values should fall in as Upscale ratio < Unity scale < Downscale ratio for src/dst formula Fix the min and max scale ratios to suit the API accordingly. Signed-off-by: Kalyan Thota Tested-by: Kristian H. Kristensen Reviewed-by: Kristian H. Kristensen Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index 3b9c33e694bf4..994d23bad3870 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -866,9 +866,9 @@ static int dpu_plane_atomic_check(struct drm_plane *plane, crtc_state = drm_atomic_get_new_crtc_state(state->state, state->crtc); - min_scale = FRAC_16_16(1, pdpu->pipe_sblk->maxdwnscale); + min_scale = FRAC_16_16(1, pdpu->pipe_sblk->maxupscale); ret = drm_atomic_helper_check_plane_state(state, crtc_state, min_scale, - pdpu->pipe_sblk->maxupscale << 16, + pdpu->pipe_sblk->maxdwnscale << 16, true, true); if (ret) { DPU_DEBUG_PLANE(pdpu, "Check plane state failed (%d)\n", ret); -- 2.25.1