From patchwork Wed Feb 28 11:26:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 129955 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp908914lja; Wed, 28 Feb 2018 03:28:04 -0800 (PST) X-Google-Smtp-Source: AH8x225Kmsjsn02y+TRTpZum4kaqOnBD1mkhcvyCF468nFHd58JAh5QaQ/UulBN71jNpDFlN9HF7 X-Received: by 2002:a17:902:8d81:: with SMTP id v1-v6mr17546515plo.430.1519817284500; Wed, 28 Feb 2018 03:28:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519817284; cv=none; d=google.com; s=arc-20160816; b=T+NSIdENJFOc07o7cv/ZeeIzavdui8ejeQD7rXhLowguUNVsjqTIG/rQr7a02zzjLN VPZKT74AMLDh+Kbtgf7TfW5kGBvTGTa9lCRj7DC90cAOnx8M8QT9CVZO0pwfCf1W1dQx wQRvgfMnW7K2pG171WMGh0jC5DWZAylMDq2Kce/H4drlBqbHz2DUCZpKFYebpX7DUmk/ l1Qkkyqgnlnw3ayg3hdGS8G4aFqVjBVJJ5EZO9DJ6PHokmJmL131BuR9drdQ2pocbzRH JZnyXd3on4JUklXWeRfMPjpHOEZft5VXhxtKxVfQ6jeDJ3g7Pq/jMXUIJVEhKf/EWW69 1E2A== 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=qCkxg+Osl3T/XnwvUix+6y5lHDZpCiFIZN4plHMdBtE=; b=jfEuAgEZl5Xvp7rxuzRLXxqcq1rZuOtXD3fu1WqfdREKaI5vSEiiCy4NrY1xzAtgrl AS3qLdzki4HicMBjRLScGAoXzl0Ki0WPtk2ZqVJmtRc9nWPAe4ECc87Kzn3UKN7w0sqN btP/JDDObSwOQlX95KGzykznQzqM99XNUE+Pe5g681aVM1JY1Ke789wYX17o8+gOe7ig YcmNvfJ/I9iW1G4qQQBWVhdgfKn9RtRKS7xEDUUATPjMdEerDwCkbfaeVwfraqbfaT7l PKSvJ/T+iDMSAMBY4h69t3fJNzB6uJnAGF69sSS4CKaP5SR2SV/vtZwu+KTifDj1JQGg gRuQ== 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=vwY9/NgG; 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 a7si1107452pfi.90.2018.02.28.03.28.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Feb 2018 03:28:04 -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=vwY9/NgG; 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 2B0CE6E96B; Wed, 28 Feb 2018 11:27:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lelnx193.ext.ti.com (lelnx193.ext.ti.com [198.47.27.77]) by gabe.freedesktop.org (Postfix) with ESMTPS id E021F6E96B for ; Wed, 28 Feb 2018 11:27:37 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id w1SBRZW7008399; Wed, 28 Feb 2018 05:27:35 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1519817255; bh=5DNMExndBShEYP08RCy2a0/k5QdEdD+JcW/zl9Z5jUM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=vwY9/NgG96cH3RCSwE5nmdkgFINmMS8EC/FX55IOE7m0qVYXWeguXYw3oWW/WqGsW 6Cst1q+JpHVaTNqGBIPiO/BtFX7OEchFX6XDyGb9mvb5zNtTFdcbxWN0ciOOg35tIH civHKlk8IJgMhcR8YQbOBq3HhXEAAS4MGiMu1fDk= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w1SBRZ2V021351; Wed, 28 Feb 2018 05:27:35 -0600 Received: from DLEE104.ent.ti.com (157.170.170.34) by DLEE100.ent.ti.com (157.170.170.30) 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:35 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE104.ent.ti.com (157.170.170.34) 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:35 -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 w1SBRAfV024563; Wed, 28 Feb 2018 05:27:33 -0600 From: Tomi Valkeinen To: , Laurent Pinchart Subject: [PATCHv2 12/17] drm/omap: fix WB height with interlace Date: Wed, 28 Feb 2018 13:26:09 +0200 Message-ID: <1519817174-20714-13-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" When using WB capture from interlaced source, we need to halve the picture heights correctly. Unfortunately the current dispc_ovl_setup_common() doesn't deal with interlace very neatly, so the end result is a bit messy. Signed-off-by: Tomi Valkeinen Acked-by: Benoit Parrot --- drivers/gpu/drm/omapdrm/dss/dispc.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index 000a3d4a27bf..72f00e8a1329 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -2597,18 +2597,19 @@ static int dispc_ovl_setup_common(struct dispc_device *dispc, out_width = out_width == 0 ? width : out_width; out_height = out_height == 0 ? height : out_height; - if (ilace && height == out_height) - fieldmode = true; - - if (ilace) { - if (fieldmode) - in_height /= 2; - pos_y /= 2; - out_height /= 2; - - DSSDBG("adjusting for ilace: height %d, pos_y %d, " - "out_height %d\n", in_height, pos_y, - out_height); + if (plane != OMAP_DSS_WB) { + if (ilace && height == out_height) + fieldmode = true; + + if (ilace) { + if (fieldmode) + in_height /= 2; + pos_y /= 2; + out_height /= 2; + + DSSDBG("adjusting for ilace: height %d, pos_y %d, out_height %d\n", + in_height, pos_y, out_height); + } } if (!dispc_ovl_color_mode_supported(dispc, plane, fourcc)) @@ -2771,6 +2772,9 @@ int dispc_wb_setup(struct dispc_device *dispc, enum omap_overlay_caps caps = OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA; + if (vm->flags & DISPLAY_FLAGS_INTERLACED) + in_height /= 2; + DSSDBG("dispc_wb_setup, pa %x, pa_uv %x, %d,%d -> %dx%d, cmode %x, " "rot %d\n", wi->paddr, wi->p_uv_addr, in_width, in_height, wi->width, wi->height, wi->fourcc, wi->rotation);