From patchwork Thu Feb 21 10:31:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 10823583 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7664D6C2 for ; Thu, 21 Feb 2019 10:32:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6429730670 for ; Thu, 21 Feb 2019 10:32:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57E3830785; Thu, 21 Feb 2019 10:32:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0AE7930670 for ; Thu, 21 Feb 2019 10:32:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 32E1289183; Thu, 21 Feb 2019 10:32:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id DC0E68916F for ; Thu, 21 Feb 2019 10:32:24 +0000 (UTC) Received: from pendragon.bb.dnainternet.fi (dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 19637F8D; Thu, 21 Feb 2019 11:32:22 +0100 (CET) From: Laurent Pinchart To: dri-devel@lists.freedesktop.org Subject: [PATCH v5 02/19] media: vsp1: wpf: Fix partition configuration for display pipelines Date: Thu, 21 Feb 2019 12:31:55 +0200 Message-Id: <20190221103212.28764-3-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190221103212.28764-1-laurent.pinchart+renesas@ideasonboard.com> References: <20190221103212.28764-1-laurent.pinchart+renesas@ideasonboard.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1550745142; bh=2j8OdR+H6+aPQbIwq6Sj0C4PAxEcp3yjTvTbiQB0rfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RwHTyHaHb/dCa/YZdtaHuTC05XIbtw0ZAssinRDcOI8Da0eSJBKLLonLGX3+Yg0mU e1x4aKGuXKneLYDxrTCtxw6hGcfkkJF/kCK6OX8SgEXQN9sWeIY+okiRpEAt9DJfXt Ut9ulbKPEMeUDgZE5fKE20GWv2AXbtoLQcdb3VRg= 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: Liviu Dudau , James Qian Wang , Kieran Bingham Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP When configuring partitions for memory-to-memory pipelines, the WPF accesses data of the current partition through pipe->partition. Writeback support will require full configuration of the WPF while not providing a valid pipe->partition. Rework the configuration code to fall back to the full image width in that case, as is already done for the part of the configuration currently relevant for display pipelines. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- drivers/media/platform/vsp1/vsp1_wpf.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/vsp1/vsp1_wpf.c b/drivers/media/platform/vsp1/vsp1_wpf.c index 32bb207b2007..a07c5944b598 100644 --- a/drivers/media/platform/vsp1/vsp1_wpf.c +++ b/drivers/media/platform/vsp1/vsp1_wpf.c @@ -362,6 +362,7 @@ static void wpf_configure_partition(struct vsp1_entity *entity, const struct vsp1_format_info *fmtinfo = wpf->fmtinfo; unsigned int width; unsigned int height; + unsigned int left; unsigned int offset; unsigned int flip; unsigned int i; @@ -371,13 +372,16 @@ static void wpf_configure_partition(struct vsp1_entity *entity, RWPF_PAD_SINK); width = sink_format->width; height = sink_format->height; + left = 0; /* * Cropping. The partition algorithm can split the image into * multiple slices. */ - if (pipe->partitions > 1) + if (pipe->partitions > 1) { width = pipe->partition->wpf.width; + left = pipe->partition->wpf.left; + } vsp1_wpf_write(wpf, dlb, VI6_WPF_HSZCLIP, VI6_WPF_SZCLIP_EN | (0 << VI6_WPF_SZCLIP_OFST_SHIFT) | @@ -408,13 +412,11 @@ static void wpf_configure_partition(struct vsp1_entity *entity, flip = wpf->flip.active; if (flip & BIT(WPF_CTRL_HFLIP) && !wpf->flip.rotate) - offset = format->width - pipe->partition->wpf.left - - pipe->partition->wpf.width; + offset = format->width - left - width; else if (flip & BIT(WPF_CTRL_VFLIP) && wpf->flip.rotate) - offset = format->height - pipe->partition->wpf.left - - pipe->partition->wpf.width; + offset = format->height - left - width; else - offset = pipe->partition->wpf.left; + offset = left; for (i = 0; i < format->num_planes; ++i) { unsigned int hsub = i > 0 ? fmtinfo->hsub : 1; @@ -436,7 +438,7 @@ static void wpf_configure_partition(struct vsp1_entity *entity, * image height. */ if (wpf->flip.rotate) - height = pipe->partition->wpf.width; + height = width; else height = format->height;