Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp165361pxb; Mon, 2 Nov 2020 17:28:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJx49IW7nc6lBl/1wH4AyLyMZRguyCiiW38XcsJfHFomst8ZudHHYfnwPc/fHrPtRHNSrzZl X-Received: by 2002:aa7:dac4:: with SMTP id x4mr18960978eds.165.1604366926311; Mon, 02 Nov 2020 17:28:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604366926; cv=none; d=google.com; s=arc-20160816; b=FBneckxKc3xtvlUguNYnNHN65zO8kbZLuFxjhKeTBQlFA07XYedcjXq96xsj+NazRq EsvENrBVqA6kQ0/F3iRMTYrop5UeskSd8pyefQSZ0/PqbNeRI7AEi1mAHfaOuM1lNlgH tHouBovJcfpuq0VKSeGloc/3ev9nmvN51lZDNOSmLmZ/djzBiMZ9k4nLvhPLa32GyMy7 tSAS93ICK3SK80HrtPQQlPfuh+IXW2oODPRv5JRlGhOX2C1uYhxy3oCpb1//cjmGsPQ2 BBCYYwSUF0G4xSrzD9TFsL21GaRDnxAY6v7OqUb53cwCWzNxLh+CsgwZB+vWSNprmUPP E2rA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bmwUM4hTN2xBICMi8pB+5w1TH/+PX7CeE056YH48kAc=; b=RQVkg2YUfwWlh02RL9Q22lPo/Px7YbqGPTbq6iXtBelUTqZy1aSMqluKlW7DJgOV7C qHHEt2jmcp2bkCtHQfCwRL1MSucHTYGkWztA7dOWHIrX/NRbyCKo1tkoHQAw63sqAiUM Qmn3kEcvYrDlG1sY9USIQwbO+1+14Av6sGlER810oaZz2iCDIwHcIa1/bsQs24CxoSkE df9lyH05/7WYgKy8y5B8qD6uB3LvXth3MHouLOwLqg+eZr7MNGP6RBa/mgziwrjVb9Zq KyVx3gYHACS5U7SS3SFsIUBBN3rOdHD3/9Q62hac9TwBBzqMGXX0tPG3kS6P1wuRo212 eWNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RA+5XxcR; 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 f22si3531853edx.179.2020.11.02.17.28.24; Mon, 02 Nov 2020 17:28:46 -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=@kernel.org header.s=default header.b=RA+5XxcR; 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 S1728144AbgKCBY3 (ORCPT + 99 others); Mon, 2 Nov 2020 20:24:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:34936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728045AbgKCBUT (ORCPT ); Mon, 2 Nov 2020 20:20:19 -0500 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 DB7D122460; Tue, 3 Nov 2020 01:20:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604366418; bh=gdMGDMwySHdmXhfimYPXmMMVR+X1bgogAYC8Oh5fkF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RA+5XxcRymd8tFPGbw6CqA4gJ7mHc/odk4bzMSAS5w1dKxM3ljVMANRIsNd48e/7a W6x8Df795N6c+2QMDwGYvYFHXuAYAxPc7KtQi/i0wF1NXQXBnFgrxQhspp4STn3R9M zgh2hLic8pMGhH9gxdaprWhKxu7DRH3Tr3vkARI8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Maxime Ripard , Jernej Skrabec , Sasha Levin , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.4 08/24] drm/sun4i: frontend: Rework a bit the phase data Date: Mon, 2 Nov 2020 20:19:51 -0500 Message-Id: <20201103012007.183429-8-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201103012007.183429-1-sashal@kernel.org> References: <20201103012007.183429-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maxime Ripard [ Upstream commit 84c971b356379c621df595bd00c3114579dfa59f ] The scaler filter phase setup in the allwinner kernel has two different cases for setting up the scaler filter, the first one using different phase parameters for the two channels, and the second one reusing the first channel parameters on the second channel. The allwinner kernel has a third option where the horizontal phase of the second channel will be set to a different value than the vertical one (and seems like it's the same value than one used on the first channel). However, that code path seems to never be taken, so we can ignore it for now, and it's essentially what we're doing so far as well. Since we will have always the same values across each components of the filter setup for a given channel, we can simplify a bit our frontend structure by only storing the phase value we want to apply to a given channel. Signed-off-by: Maxime Ripard Acked-by: Jernej Skrabec Link: https://patchwork.freedesktop.org/patch/msgid/20201015093642.261440-1-maxime@cerno.tech Signed-off-by: Sasha Levin --- drivers/gpu/drm/sun4i/sun4i_frontend.c | 34 ++++++-------------------- drivers/gpu/drm/sun4i/sun4i_frontend.h | 6 +---- 2 files changed, 9 insertions(+), 31 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_frontend.c b/drivers/gpu/drm/sun4i/sun4i_frontend.c index ec2a032e07b97..7462801b1fa8e 100644 --- a/drivers/gpu/drm/sun4i/sun4i_frontend.c +++ b/drivers/gpu/drm/sun4i/sun4i_frontend.c @@ -443,17 +443,17 @@ int sun4i_frontend_update_formats(struct sun4i_frontend *frontend, * related to the scaler FIR filter phase parameters. */ regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_HORZPHASE_REG, - frontend->data->ch_phase[0].horzphase); + frontend->data->ch_phase[0]); regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_HORZPHASE_REG, - frontend->data->ch_phase[1].horzphase); + frontend->data->ch_phase[1]); regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_VERTPHASE0_REG, - frontend->data->ch_phase[0].vertphase[0]); + frontend->data->ch_phase[0]); regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_VERTPHASE0_REG, - frontend->data->ch_phase[1].vertphase[0]); + frontend->data->ch_phase[1]); regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_VERTPHASE1_REG, - frontend->data->ch_phase[0].vertphase[1]); + frontend->data->ch_phase[0]); regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_VERTPHASE1_REG, - frontend->data->ch_phase[1].vertphase[1]); + frontend->data->ch_phase[1]); /* * Checking the input format is sufficient since we currently only @@ -687,30 +687,12 @@ static const struct dev_pm_ops sun4i_frontend_pm_ops = { }; static const struct sun4i_frontend_data sun4i_a10_frontend = { - .ch_phase = { - { - .horzphase = 0, - .vertphase = { 0, 0 }, - }, - { - .horzphase = 0xfc000, - .vertphase = { 0xfc000, 0xfc000 }, - }, - }, + .ch_phase = { 0x000, 0xfc000 }, .has_coef_rdy = true, }; static const struct sun4i_frontend_data sun8i_a33_frontend = { - .ch_phase = { - { - .horzphase = 0x400, - .vertphase = { 0x400, 0x400 }, - }, - { - .horzphase = 0x400, - .vertphase = { 0x400, 0x400 }, - }, - }, + .ch_phase = { 0x400, 0x400 }, .has_coef_access_ctrl = true, }; diff --git a/drivers/gpu/drm/sun4i/sun4i_frontend.h b/drivers/gpu/drm/sun4i/sun4i_frontend.h index 0c382c1ddb0fe..2e7b76e50c2ba 100644 --- a/drivers/gpu/drm/sun4i/sun4i_frontend.h +++ b/drivers/gpu/drm/sun4i/sun4i_frontend.h @@ -115,11 +115,7 @@ struct reset_control; struct sun4i_frontend_data { bool has_coef_access_ctrl; bool has_coef_rdy; - - struct { - u32 horzphase; - u32 vertphase[2]; - } ch_phase[2]; + u32 ch_phase[2]; }; struct sun4i_frontend { -- 2.27.0