Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3216142imu; Sat, 24 Nov 2018 00:18:43 -0800 (PST) X-Google-Smtp-Source: AFSGD/VK2+175XjzDHgfob96DYkP4If2osro8CEyldqlBFBJYpJ0fERB6lDEQ0Vu1RlvZsP8a/x7 X-Received: by 2002:a17:902:1e3:: with SMTP id b90-v6mr18842489plb.117.1543047523336; Sat, 24 Nov 2018 00:18:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543047523; cv=none; d=google.com; s=arc-20160816; b=JcNiD321Mc5MAZmTK5dhvV7dpR1a8FrTXm6Fdy1hqJNWhWiIVvVizhvUL9djV4Rxih iAx2Xk09CGy1xBmXTS6GqgaJRLr6Xuol1i4AVMjMeFakgCMHWfpU/TWtIHyI8AOycVPr Uf0cwPHjCqrEuX6RSu+sAbnoDiFyO4sE79K5oD5HjZO7a5upwk+q2xKUiGicC2vLN72o ikc+0FrfOotdCf1DC2NRbZXguELikuQ/3tLI/CL/nXoKnPPQTKxF+6Z1YK3b4K4Wy5GV 3w961jtb3Fo61Ffvd5M5GTQe6rB7ynZruCFWz1cWd3YonxB+NmaxzhCKDwE+FlkP2HkR GL1A== 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; bh=cISrFZj6RMtTwppKhx73vAI5cinezlGt4CRYVqp7CfQ=; b=tNW8bFiAfCNUoaHYuNbDuHEdgiQj4JVugpuzt6obzccvCt0DIY2uDsCerEVtIBjqlh 6odZz+J2SNwF7T21Bkka1ySPsVIVuuBLGsuZFtIz8kuapWdd6VLKKRTZoA097kyRr9+4 K9hfqhGOYi233Ueox837aq2nw08w7i/MqnN9BoPE6nPfBhGDEcSPC7dcKdzhn7aeRer5 XKGJKp51Cz++Fv10dcP26eBffDcpgFO+iD0g+cWpOYuw/fazPWCb+7R8ymL9KX1fXBPv /y736SFsQ9HE+G2mMMr47q1I/gda/SiD8EKubgJJXObETTazBZBJhZupyyM4qOE/0YWC W9hQ== ARC-Authentication-Results: i=1; mx.google.com; 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 f4si8572363pgg.492.2018.11.24.00.18.29; Sat, 24 Nov 2018 00:18:43 -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; 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 S2409065AbeKWUKi (ORCPT + 99 others); Fri, 23 Nov 2018 15:10:38 -0500 Received: from mail.bootlin.com ([62.4.15.54]:49514 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2409042AbeKWUKh (ORCPT ); Fri, 23 Nov 2018 15:10:37 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 554D621668; Fri, 23 Nov 2018 10:27:08 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.2 Received: from localhost.localdomain (aaubervilliers-681-1-94-205.w90-88.abo.wanadoo.fr [90.88.35.205]) by mail.bootlin.com (Postfix) with ESMTPSA id 78451207BB; Fri, 23 Nov 2018 10:26:38 +0100 (CET) From: Paul Kocialkowski To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Cc: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Chen-Yu Tsai , Thomas Petazzoni , linux-sunxi@googlegroups.com, Daniel Vetter Subject: [PATCH v2 42/43] drm/sun4i: frontend: Move the FIR filter phases to our quirks Date: Fri, 23 Nov 2018 10:25:14 +0100 Message-Id: <20181123092515.2511-43-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181123092515.2511-1-paul.kocialkowski@bootlin.com> References: <20181123092515.2511-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maxime Ripard The FIR filters phase depend on the SoC, so let's move it to our quirks structure instead of removing them. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_frontend.c | 28 ++++++++++++++++++++------ drivers/gpu/drm/sun4i/sun4i_frontend.h | 5 +++++ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_frontend.c b/drivers/gpu/drm/sun4i/sun4i_frontend.c index f50507ee6d75..427c51029a9c 100644 --- a/drivers/gpu/drm/sun4i/sun4i_frontend.c +++ b/drivers/gpu/drm/sun4i/sun4i_frontend.c @@ -438,12 +438,18 @@ int sun4i_frontend_update_formats(struct sun4i_frontend *frontend, * I have no idea what this does exactly, but it seems to be * related to the scaler FIR filter phase parameters. */ - regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_HORZPHASE_REG, 0x400); - regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_HORZPHASE_REG, 0x400); - regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_VERTPHASE0_REG, 0x400); - regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_VERTPHASE0_REG, 0x400); - regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_VERTPHASE1_REG, 0x400); - regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_VERTPHASE1_REG, 0x400); + regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_HORZPHASE_REG, + frontend->data->ch_phase[0].horzphase); + regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_HORZPHASE_REG, + frontend->data->ch_phase[1].horzphase); + regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_VERTPHASE0_REG, + frontend->data->ch_phase[0].vertphase[0]); + regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_VERTPHASE0_REG, + frontend->data->ch_phase[1].vertphase[0]); + regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_VERTPHASE1_REG, + frontend->data->ch_phase[0].vertphase[1]); + regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_VERTPHASE1_REG, + frontend->data->ch_phase[1].vertphase[1]); if (fb->format->is_yuv && !drm_format_is_yuv(out_fmt)) { /* Setup the CSC engine for YUV to RGB conversion. */ @@ -671,6 +677,16 @@ static const struct dev_pm_ops sun4i_frontend_pm_ops = { }; static const struct sun4i_frontend_data sun8i_a33_frontend = { + .ch_phase = { + { + .horzphase = 0x400, + .vertphase = { 0x400, 0x400 }, + }, + { + .horzphase = 0x400, + .vertphase = { 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 3618993f8e49..45f5f4f3d06f 100644 --- a/drivers/gpu/drm/sun4i/sun4i_frontend.h +++ b/drivers/gpu/drm/sun4i/sun4i_frontend.h @@ -103,6 +103,11 @@ 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]; }; struct sun4i_frontend { -- 2.19.1