Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2532688ybl; Sun, 11 Aug 2019 03:41:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqym5kGmrIfy5FIfa0KMpr2/tQP3V+FGTPwTVyF+jx5TaRhjApx1DnVCqxsJtU8EnUXDHpGZ X-Received: by 2002:a62:7890:: with SMTP id t138mr30287396pfc.238.1565520108051; Sun, 11 Aug 2019 03:41:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565520108; cv=none; d=google.com; s=arc-20160816; b=Jq0vwWGG3La82XUZKog+9gKmGpM6aoXCeM3Xl/OJGZqwr8EiZMgn+FCsoesMP5shty 0AhYY64WeL6uslf82GRVEzW9boIMjXuGvovcSlnP7ghGAotzXT46ScEMNo3++pF4Xxqi Zsy6sVpvtPa28CL1ywoYFpV87ADc/UUMZwl1G6SBw6n5uWMQ4yl8j0rMTF5RWxgkKK2m /O/cNr7xwD7yj1IeENXYxSPYs5ssclOSb+kEXxBtJL7e5OvhxIYUd95t8znqfx5dH1Hb sR8bHiRmjGeoA1HBha1mmpkq3bnZ4ocAB0EZatSSjwfRb0EHbjWvENWua+vVIk1PfNyL uXPw== 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=7GqL0oz1PX/3nwsQtQbUIrcQBEZzJ4+Psrh2h/TRPig=; b=Vk+krsCbcG5toP0lW7exjS/wUOcEiAxwhkegCSLEcEo64Sz5mfP0MNMTjXPdAlsJ5M 47OkXALgyJ0jJ5HPQHZ6xX10SoKep8cZSeCmo8o3pRB8uVsQBNrOPKjszvHRNEj6Fe/a TU9z7xr1BvYwmJAnKhPyWLrkp4TSbAL0dfZmx+igEpVFL/ZSszhT3cwpfhFz1jnwAYHr Hw/VJ7bxnQUtGn/iojpFPkqmWgk2cSgffYTTSTDNk5XqeICYGoQmVfk0IfUybzEWljB8 KhSF91Gc26SziJ5qBAheg9ctT7MI0YQJAEWs8oo0iqjnkryzufyb+eSsnHnZBWQhUsSi nDQg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l28si66855791pgm.311.2019.08.11.03.41.33; Sun, 11 Aug 2019 03:41:48 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726527AbfHKKkx (ORCPT + 99 others); Sun, 11 Aug 2019 06:40:53 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:43394 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725855AbfHKKkw (ORCPT ); Sun, 11 Aug 2019 06:40:52 -0400 X-UUID: 846e842ad79b493f9092eda858f065ba-20190811 X-UUID: 846e842ad79b493f9092eda858f065ba-20190811 Received: from mtkcas36.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 271601769; Sun, 11 Aug 2019 18:40:46 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS33N2.mediatek.inc (172.27.4.76) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sun, 11 Aug 2019 18:40:45 +0800 Received: from mszsdclx1018.gcn.mediatek.inc (172.27.4.253) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Sun, 11 Aug 2019 18:40:43 +0800 From: Jitao Shi To: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , , David Airlie , Matthias Brugger CC: Jitao Shi , Thierry Reding , Ajay Kumar , Inki Dae , Rahul Sharma , Sean Paul , Vincent Palatin , Andy Yan , Philipp Zabel , Russell King , , , , , , , Sascha Hauer , , , , , , Subject: [PATCH v6 4/7] drm/mediatek: add frame size control Date: Sun, 11 Aug 2019 18:40:05 +0800 Message-ID: <20190811104008.53372-5-jitao.shi@mediatek.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190811104008.53372-1-jitao.shi@mediatek.com> References: <20190811104008.53372-1-jitao.shi@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-TM-SNTS-SMTP: B6EA79DEAD4B04550E18400944F7175E9B421FE15135BB24C1CF7407D1104FF92000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Our new DSI chip has frame size control. So add the driver data to control for different chips. Signed-off-by: Jitao Shi Reviewed-by: CK Hu --- drivers/gpu/drm/mediatek/mtk_dsi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index 314bfb1c827b..68794edecf96 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -70,6 +70,7 @@ #define DSI_VBP_NL 0x24 #define DSI_VFP_NL 0x28 #define DSI_VACT_NL 0x2C +#define DSI_SIZE_CON 0x38 #define DSI_HSA_WC 0x50 #define DSI_HBP_WC 0x54 #define DSI_HFP_WC 0x58 @@ -154,6 +155,7 @@ struct phy; struct mtk_dsi_driver_data { const u32 reg_cmdq_off; bool has_shadow_ctl; + bool has_size_ctl; }; struct mtk_dsi { @@ -422,6 +424,10 @@ static void mtk_dsi_config_vdo_timing(struct mtk_dsi *dsi) writel(vm->vfront_porch, dsi->regs + DSI_VFP_NL); writel(vm->vactive, dsi->regs + DSI_VACT_NL); + if (dsi->driver_data->has_size_ctl) + writel(vm->vactive << 16 | vm->hactive, + dsi->regs + DSI_SIZE_CON); + horizontal_sync_active_byte = (vm->hsync_len * dsi_tmp_buf_bpp - 10); if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE) -- 2.21.0