From patchwork Wed Feb 28 11:26:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 129956 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp908980lja; Wed, 28 Feb 2018 03:28:09 -0800 (PST) X-Google-Smtp-Source: AH8x226oDxug/MbJQreWXQwHodzb5CZJavTMIw1BY0FJKNjWhSlAqX/DpxNqiw2DMwCCaqtHnCqz X-Received: by 10.98.135.76 with SMTP id i73mr17395046pfe.140.1519817289447; Wed, 28 Feb 2018 03:28:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519817289; cv=none; d=google.com; s=arc-20160816; b=fuMdSal74F0IwA1ddox6wCH+RasCRYRjOzqjZQRWEN12hfumT5y3l/2QiqDueXVw8X QP95Hsi9TXIIDbL1sGXw/HyvJ5i2w79jVWyw1C3V/yOSdfxqM31kPkNTzi/qU5wQSEyF 7kFlAn7K7bPhi9uUuEDSzlQanewEXEfYkfRa1/t8KTcdArPTBnMu+kgKsSSV0k/4lnUb DFNm0VaDjjm1fbSls86FA5TIm+qWW3isQJb+W5sPeoGK2tGINmXFYvHci1nmL1vOpT61 5GVAajK5SmrDv5kD20LS1iyBhTGTKNqtFkLDuf9oB5JIWS82508PVs3kthXoUcH8BVVG meBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=/yrCb1Y2txjPniU1SdDiCUkgPEDo649rqd68gcaMISg=; b=qtNxa7ew7vpe2sWubl4hpOVoVVkJMCtRLPJyHtABeug/gHjroeOYz9SBm9B8LqMVu0 IcRX3vlaboDNgS5OKSLqDO+4n+SJ4gitH4xUgXRXaOC6gQ4DRnqVGsgOipbfG8Kys5W4 MHJ5nO8ZLv1uyaZc1TuYyoel8u2KUgQSf61FlTCN4C90aPALbDe6GHv7rvTjH9jW6Lny AL215kb3k75q3cIG5e2azXF8paKJWfvlkDXb6R/tWE2017WaKZTYBqXIKAU8Vf6wZ9LQ 2IGuyCkTtNccJb4pGNeKd6Zir0Tf6IYmy+awfLJHZ5KmrzNkDdpj9IJeZ3/SgzyzQsF/ pd+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=hjFsUjhz; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id j6-v6si1123334pll.799.2018.02.28.03.28.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Feb 2018 03:28:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=hjFsUjhz; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 44F186E96E; Wed, 28 Feb 2018 11:27:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllnx210.ext.ti.com (fllnx210.ext.ti.com [198.47.19.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id 04B036E962 for ; Wed, 28 Feb 2018 11:27:35 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w1SBRXov022869; Wed, 28 Feb 2018 05:27:33 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1519817253; bh=eThkBCXxndqFYhMMJL4aI0d9RrheZ38s3utY1ystu1Y=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=hjFsUjhzLeeeZP84AwKAVQlSAHo4nY9+MmI3FNK81r2E6iH8czHfmBL/aSH1GvQ0Z iQywhQ4/kWrQ7NsYq8LLVPsNn8dEEwNsM/irCA+bmTPP9yBSZBt44VnNwP4JtO/SaQ PshOC7FF1IGq1xE1Y/OFgDka58fiIsYYPmy7rDIQ= Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w1SBRX69031520; Wed, 28 Feb 2018 05:27:33 -0600 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Wed, 28 Feb 2018 05:27:33 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Wed, 28 Feb 2018 05:27:33 -0600 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w1SBRAfU024563; Wed, 28 Feb 2018 05:27:31 -0600 From: Tomi Valkeinen To: , Laurent Pinchart Subject: [PATCHv2 11/17] drm/omap: fix WBDELAYCOUNT with interlace Date: Wed, 28 Feb 2018 13:26:08 +0200 Message-ID: <1519817174-20714-12-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519817174-20714-1-git-send-email-tomi.valkeinen@ti.com> References: <1519817174-20714-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Ujfalusi , Tomi Valkeinen , Jyri Sarha Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Vertical blanking needs to be halved on interlace modes. WBDELAYCOUNT was calculated without such halving, resulting in WBUNCOMPLETE errors. Signed-off-by: Tomi Valkeinen Acked-by: Benoit Parrot --- drivers/gpu/drm/omapdrm/dss/dispc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index 7398039954a5..000a3d4a27bf 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -2814,14 +2814,18 @@ int dispc_wb_setup(struct dispc_device *dispc, /* WBDELAYCOUNT */ REG_FLD_MOD(dispc, DISPC_OVL_ATTRIBUTES2(plane), 0, 7, 0); } else { - int wbdelay; + u32 wbdelay; if (channel_in == DSS_WB_TV_MGR) - wbdelay = min(vm->vsync_len + vm->vback_porch, - (u32)255); + wbdelay = vm->vsync_len + vm->vback_porch; else - wbdelay = min(vm->vfront_porch + - vm->vsync_len + vm->vback_porch, (u32)255); + wbdelay = vm->vfront_porch + vm->vsync_len + + vm->vback_porch; + + if (vm->flags & DISPLAY_FLAGS_INTERLACED) + wbdelay /= 2; + + wbdelay = min(wbdelay, 255u); /* WBDELAYCOUNT */ REG_FLD_MOD(dispc, DISPC_OVL_ATTRIBUTES2(plane), wbdelay, 7, 0);