From patchwork Fri Feb 10 20:27:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 9567443 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A262E60572 for ; Fri, 10 Feb 2017 20:27:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92BAF285C5 for ; Fri, 10 Feb 2017 20:27:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85F19285C7; Fri, 10 Feb 2017 20:27:52 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 314BB2859A for ; Fri, 10 Feb 2017 20:27:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932105AbdBJU1v (ORCPT ); Fri, 10 Feb 2017 15:27:51 -0500 Received: from mail.kernel.org ([198.145.29.136]:45614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932082AbdBJU1u (ORCPT ); Fri, 10 Feb 2017 15:27:50 -0500 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DDCA520172; Fri, 10 Feb 2017 20:27:48 +0000 (UTC) Received: from CookieMonster.cookiemonster.local (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 02E6E2026C; Fri, 10 Feb 2017 20:27:46 +0000 (UTC) From: Kieran Bingham To: laurent.pinchart@ideasonboard.com, linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kieran.bingham@ideasonboard.com Cc: Kieran Bingham Subject: [PATCH 3/8] v4l: vsp1: Correct image partition parameters Date: Fri, 10 Feb 2017 20:27:31 +0000 Message-Id: <6d9f8e04ac314ef7a1ffdc10d079fcd30707a03a.1486758327.git-series.kieran.bingham+renesas@ideasonboard.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The image partition algorithm operates on the image dimensions as input into the WPF entity. Correct this in the code, and document what defines the properties for the algorithm in the section header Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- drivers/media/platform/vsp1/vsp1_video.c | 12 ++++++++++-- drivers/media/platform/vsp1/vsp1_wpf.c | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c index be9c860b1c04..4ade958a1c9e 100644 --- a/drivers/media/platform/vsp1/vsp1_video.c +++ b/drivers/media/platform/vsp1/vsp1_video.c @@ -176,6 +176,14 @@ static int __vsp1_video_try_format(struct vsp1_video *video, /* ----------------------------------------------------------------------------- * VSP1 Partition Algorithm support + * + * VSP hardware can have restrictions on image width dependent on the hardware + * configuration of the pipeline. Adapting for these restrictions is implemented + * via the partition algorithm. + * + * The partition windows and sizes are based on the output size of the WPF + * before rotation, which is represented by the input parameters to the WPF + * entity in our pipeline. */ /** @@ -196,7 +204,7 @@ static struct v4l2_rect vsp1_video_partition(struct vsp1_pipeline *pipe, format = vsp1_entity_get_pad_format(&pipe->output->entity, pipe->output->entity.config, - RWPF_PAD_SOURCE); + RWPF_PAD_SINK); /* A single partition simply processes the output size in full. */ if (pipe->partitions <= 1) { @@ -258,7 +266,7 @@ static void vsp1_video_pipeline_setup_partitions(struct vsp1_pipeline *pipe) format = vsp1_entity_get_pad_format(&pipe->output->entity, pipe->output->entity.config, - RWPF_PAD_SOURCE); + RWPF_PAD_SINK); div_size = format->width; /* Gen2 hardware doesn't require image partitioning. */ diff --git a/drivers/media/platform/vsp1/vsp1_wpf.c b/drivers/media/platform/vsp1/vsp1_wpf.c index 7c48f81cd5c1..ad67034e08e9 100644 --- a/drivers/media/platform/vsp1/vsp1_wpf.c +++ b/drivers/media/platform/vsp1/vsp1_wpf.c @@ -218,8 +218,8 @@ static void wpf_configure(struct vsp1_entity *entity, const struct v4l2_pix_format_mplane *format = &wpf->format; struct vsp1_rwpf_memory mem = wpf->mem; unsigned int flip = wpf->flip.active; - unsigned int width = source_format->width; - unsigned int height = source_format->height; + unsigned int width = sink_format->width; + unsigned int height = sink_format->height; unsigned int offset; /*