From patchwork Mon Feb 12 09:44:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 127969 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3040727ljc; Mon, 12 Feb 2018 01:46:33 -0800 (PST) X-Google-Smtp-Source: AH8x226v6/HsXBXCSQaRN5RH7dUhUT80bsMC9rwc0MAcMc6p6revoVcm0g6br5tPmA3uMbEpSAr6 X-Received: by 10.98.212.6 with SMTP id a6mr10654282pfh.104.1518428793252; Mon, 12 Feb 2018 01:46:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518428793; cv=none; d=google.com; s=arc-20160816; b=EudWUrcF7ARxRn5z8KfaSu4mdBIoYAR9JxXHoAYEEqPMvdZ6sGFkPfneRdizEA4cmw oBH8/T2AncO8Vvv14XXOSH4sSwsnw1de5zn1CYP7tkVVdKU1n0bfHLw2AyYNis86RQnO vhUraLesdMbqmtl2MkkQ3x9lyWjOPgDq7nZoBcPzDjWI1+Dn4VKvxORa3fMBSX/SpqLD 24Eo1jtzWP3OmLOCaiB/Ayn7k/4Fodh8TCPu0SremRQGusMD5RoEnAs6XrdRAZZZMFMC tLG0MyNgZ8tacEvPS9MChhsDzrkauYM6Hazmv2cl3QtCtGsS4K1PKU5zVR8chQufhhPe ASSg== 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=+XGTb34rEBJaNnvWTf0qHrjA1Ne1SljsXmG1sE5Qpks=; b=uAGiEGsmLK8GwrxWXnX4UrLaaQaIOICMkzjJKW6ftIQX0tblIqAhkrDPZfVw/8loaz W8z2E4Gj+Q+hMFZl5Q5l13OCuNLCKrTrxL4AzH2EcfFxck5jDgoW17tFqBxZFgdyI04A mMeXzdHFpL0aoT7bw1bgpZGcirZs69Hl3SCLEK252JYbfsrRPi8sq46EkxrciN0bz/1i DD1z9yfwKg7kjIRscmopcikGZpIs7Kf5JbtrTUqgAmG1XNI/Kbb6bHxjH4RahLgl7aDT OtrSQFE7SHIlbXHuPdoGmlFx/NrCT3Lmx+aoUlcuDuCPhZXn6jxzZG5io87Y4igavfsl mo6g== 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=S7UY7Nwm; 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 37-v6si1661670ple.491.2018.02.12.01.46.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Feb 2018 01:46:33 -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=S7UY7Nwm; 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 DBF986E0EA; Mon, 12 Feb 2018 09:45:40 +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 655AB6E0EA for ; Mon, 12 Feb 2018 09:45:40 +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 w1C9jcgT009905; Mon, 12 Feb 2018 03:45:38 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1518428738; bh=Usxvbx2OEa6rC1aBG9Uc3mC044d9PenrqqXmwzG1NB0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=S7UY7Nwm6ERLudegVuL0Yz2kgsMFLli5KzrFqUpjDzD0rRd6uGjs19uUG51cRFUaN aphQZcNiQ9MAIKmOWTpOe8c3cn0k1ic9BBGmXM1aZi8npBfI/M5bcudgKqBezKMSix mI2TuhsyolC4PV0H5cLRg8NSsnRBmyifntfbKcb8= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w1C9jcnN019501; Mon, 12 Feb 2018 03:45:38 -0600 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Mon, 12 Feb 2018 03:45:37 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Mon, 12 Feb 2018 03:45:37 -0600 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w1C9j0NG003439; Mon, 12 Feb 2018 03:45:36 -0600 From: Tomi Valkeinen To: , Laurent Pinchart , Peter Ujfalusi , Jyri Sarha , Benoit Parrot Subject: [PATCH 19/24] drm/omap: fix WB height with interlace Date: Mon, 12 Feb 2018 11:44:49 +0200 Message-ID: <1518428694-18018-20-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518428694-18018-1-git-send-email-tomi.valkeinen@ti.com> References: <1518428694-18018-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: Tomi Valkeinen 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 99bbc97d0de4..3d804187df13 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -2496,18 +2496,19 @@ static int dispc_ovl_setup_common(enum omap_plane_id plane, 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(plane, fourcc)) @@ -2667,6 +2668,9 @@ int dispc_wb_setup(const struct omap_dss_writeback_info *wi, 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);