From patchwork Fri Aug 31 14:40:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10583941 X-Patchwork-Delegate: geert@linux-m68k.org 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 8A4E714E1 for ; Fri, 31 Aug 2018 14:41:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A9482BA7B for ; Fri, 31 Aug 2018 14:41:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6EED72BF3B; Fri, 31 Aug 2018 14:41:25 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 19C842BA7B for ; Fri, 31 Aug 2018 14:41:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728750AbeHaSsj (ORCPT ); Fri, 31 Aug 2018 14:48:39 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:44516 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727724AbeHaSsj (ORCPT ); Fri, 31 Aug 2018 14:48:39 -0400 Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 59800158B; Fri, 31 Aug 2018 16:40:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1535726449; bh=Dlnp2XqV2L66jvacBjz+iCTxpHBPB2fV6Cu4HMpP4pU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UjaOLdBAQ6uvWYU4lqvR2B8qggdzb/GH4SXBrBXIdL+EFYPj9b4nXMAyqw/Etw7jp h+Ntu+qrotk0oESTt6Mhpc2LxoP3TnzhM5DFKwV/T6Af5GXvYV0dWz5TVUrk7vkDho mTLHTuv1wvZl8Mb6P6cJwhjDdlN+Ka1SJa1bFP44= From: Kieran Bingham To: Laurent Pinchart , mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Kieran Bingham Subject: [PATCH 1/6] media: vsp1: Remove artificial pixel limitation Date: Fri, 31 Aug 2018 15:40:39 +0100 Message-Id: <20180831144044.31713-2-kieran.bingham+renesas@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180831144044.31713-1-kieran.bingham+renesas@ideasonboard.com> References: <20180831144044.31713-1-kieran.bingham+renesas@ideasonboard.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The VSP1 has a minimum width and height of a single pixel, with the exception of pixel formats with sub-sampling. Remove the artificial minimum width and minimum height limitation, and instead clamp the minimum dimensions based upon the sub-sampling parameter of that dimension. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- drivers/media/platform/vsp1/vsp1_video.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c index 81d47a09d7bc..e78eadd0295b 100644 --- a/drivers/media/platform/vsp1/vsp1_video.c +++ b/drivers/media/platform/vsp1/vsp1_video.c @@ -38,9 +38,7 @@ #define VSP1_VIDEO_DEF_WIDTH 1024 #define VSP1_VIDEO_DEF_HEIGHT 768 -#define VSP1_VIDEO_MIN_WIDTH 2U #define VSP1_VIDEO_MAX_WIDTH 8190U -#define VSP1_VIDEO_MIN_HEIGHT 2U #define VSP1_VIDEO_MAX_HEIGHT 8190U /* ----------------------------------------------------------------------------- @@ -136,9 +134,8 @@ static int __vsp1_video_try_format(struct vsp1_video *video, height = round_down(height, info->vsub); /* Clamp the width and height. */ - pix->width = clamp(width, VSP1_VIDEO_MIN_WIDTH, VSP1_VIDEO_MAX_WIDTH); - pix->height = clamp(height, VSP1_VIDEO_MIN_HEIGHT, - VSP1_VIDEO_MAX_HEIGHT); + pix->width = clamp(width, info->hsub, VSP1_VIDEO_MAX_WIDTH); + pix->height = clamp(height, info->vsub, VSP1_VIDEO_MAX_HEIGHT); /* * Compute and clamp the stride and image size. While not documented in From patchwork Fri Aug 31 14:40:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10583939 X-Patchwork-Delegate: geert@linux-m68k.org 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 2BE27174C for ; Fri, 31 Aug 2018 14:41:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E42C2BA8E for ; Fri, 31 Aug 2018 14:41:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 124F12BF3B; Fri, 31 Aug 2018 14:41:25 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 BCBAB2BA7B for ; Fri, 31 Aug 2018 14:41:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728370AbeHaSsk (ORCPT ); Fri, 31 Aug 2018 14:48:40 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:44524 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727573AbeHaSsk (ORCPT ); Fri, 31 Aug 2018 14:48:40 -0400 Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C901B1A8D; Fri, 31 Aug 2018 16:40:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1535726450; bh=4j1chr/qnHmRgnaCZZnSKXZl9lYKmysazAxTrdbubno=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LHFx+VwLaBL9T6JPinYQuGvp37q2qUwQVgYyGRnULKkpGk+I4xgJWYmQ7p8YThl21 WwCYp7O+sjDkK0mVdEBtMPwlq1D766peKLYASu5C9mhyEtXZUIPWsYP8Rkbj63ASvJ 8LTCJ4ipdHfQb9rWWtbILFMyVz7Hivix/bNmgsjA= From: Kieran Bingham To: Laurent Pinchart , mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Kieran Bingham Subject: [PATCH 2/6] media: vsp1: Correct the pitch on multiplanar formats Date: Fri, 31 Aug 2018 15:40:40 +0100 Message-Id: <20180831144044.31713-3-kieran.bingham+renesas@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180831144044.31713-1-kieran.bingham+renesas@ideasonboard.com> References: <20180831144044.31713-1-kieran.bingham+renesas@ideasonboard.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP DRM pipelines now support tri-planar as well as packed formats with YCbCr, however the pitch calculation was not updated to support this. Correct this by adjusting the bytesperline accordingly when 3 planes are used. Fixes: 7863ac504bc5 ("drm: rcar-du: Add tri-planar memory formats support") Signed-off-by: Kieran Bingham Reviewed-by: Kieran Bingham --- drivers/media/platform/vsp1/vsp1_drm.c | 10 ++++++++++ include/media/vsp1.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c index b9c0f695d002..b9afd98f6867 100644 --- a/drivers/media/platform/vsp1/vsp1_drm.c +++ b/drivers/media/platform/vsp1/vsp1_drm.c @@ -814,6 +814,16 @@ int vsp1_du_atomic_update(struct device *dev, unsigned int pipe_index, rpf->format.num_planes = fmtinfo->planes; rpf->format.plane_fmt[0].bytesperline = cfg->pitch; rpf->format.plane_fmt[1].bytesperline = cfg->pitch; + + /* + * Packed YUV formats are subsampled, but the packing of two components + * into a single plane compensates for this leaving the bytesperline + * to be the correct value. For multiplanar formats we must adjust the + * pitch accordingly. + */ + if (fmtinfo->planes == 3) + rpf->format.plane_fmt[1].bytesperline /= fmtinfo->hsub; + rpf->alpha = cfg->alpha; rpf->mem.addr[0] = cfg->mem[0]; diff --git a/include/media/vsp1.h b/include/media/vsp1.h index 3093b9cb9067..0ce19b595cc7 100644 --- a/include/media/vsp1.h +++ b/include/media/vsp1.h @@ -46,7 +46,7 @@ int vsp1_du_setup_lif(struct device *dev, unsigned int pipe_index, /** * struct vsp1_du_atomic_config - VSP atomic configuration parameters * @pixelformat: plane pixel format (V4L2 4CC) - * @pitch: line pitch in bytes, for all planes + * @pitch: line pitch in bytes * @mem: DMA memory address for each plane of the frame buffer * @src: source rectangle in the frame buffer (integer coordinates) * @dst: destination rectangle on the display (integer coordinates) From patchwork Fri Aug 31 14:40:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10583931 X-Patchwork-Delegate: geert@linux-m68k.org 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 64DD81709 for ; Fri, 31 Aug 2018 14:41:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5555E2BA7B for ; Fri, 31 Aug 2018 14:41:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 483822BF3B; Fri, 31 Aug 2018 14:41:17 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 396E82BA7B for ; Fri, 31 Aug 2018 14:41:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728799AbeHaSsl (ORCPT ); Fri, 31 Aug 2018 14:48:41 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:44534 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727724AbeHaSsl (ORCPT ); Fri, 31 Aug 2018 14:48:41 -0400 Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 43A3E1A9D; Fri, 31 Aug 2018 16:40:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1535726450; bh=oDlo32gU7dsXCFXCXyqjfszrBJhrg7JIK1caa6fVnzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rA188Kx/h+4YxrA8Ze8vMc1dZ3HnseIYmr5HhB603LkHS19iQa6URz6SWkjP2NBHS RofNv1fuS/sT8i/yPaeuPRIG053ENGeEmirBJKFS8WndEeQgMAFZvg+5cxnVzbnSVh e9/OlTc3A2EDU0xUe+ard/ZLvdCVP96XmNu2576E= From: Kieran Bingham To: Laurent Pinchart , mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Kieran Bingham Subject: [PATCH 3/6] media: vsp1: Implement partition algorithm restrictions Date: Fri, 31 Aug 2018 15:40:41 +0100 Message-Id: <20180831144044.31713-4-kieran.bingham+renesas@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180831144044.31713-1-kieran.bingham+renesas@ideasonboard.com> References: <20180831144044.31713-1-kieran.bingham+renesas@ideasonboard.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The partition algorithm introduced to support scaling, and rotation on Gen3 hardware has some restrictions on pipeline configuration. The UDS must not be connected after the SRU in a pipeline, and whilst an SRU can be connected after the UDS, it can only do so in identity mode. A pipeline with an SRU connected after the UDS will disable any scaling features of the SRU. Signed-off-by: Kieran Bingham --- drivers/media/platform/vsp1/vsp1_sru.c | 7 ++++-- drivers/media/platform/vsp1/vsp1_sru.h | 1 + drivers/media/platform/vsp1/vsp1_video.c | 29 +++++++++++++++++++++++- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/vsp1/vsp1_sru.c b/drivers/media/platform/vsp1/vsp1_sru.c index 04e4e05af6ae..f277700e5cc2 100644 --- a/drivers/media/platform/vsp1/vsp1_sru.c +++ b/drivers/media/platform/vsp1/vsp1_sru.c @@ -149,7 +149,8 @@ static int sru_enum_frame_size(struct v4l2_subdev *subdev, fse->min_width = format->width; fse->min_height = format->height; if (format->width <= SRU_MAX_SIZE / 2 && - format->height <= SRU_MAX_SIZE / 2) { + format->height <= SRU_MAX_SIZE / 2 && + sru->force_identity_mode == false) { fse->max_width = format->width * 2; fse->max_height = format->height * 2; } else { @@ -201,7 +202,8 @@ static void sru_try_format(struct vsp1_sru *sru, if (fmt->width <= SRU_MAX_SIZE / 2 && fmt->height <= SRU_MAX_SIZE / 2 && - output_area > input_area * 9 / 4) { + output_area > input_area * 9 / 4 && + sru->force_identity_mode == false) { fmt->width = format->width * 2; fmt->height = format->height * 2; } else { @@ -374,6 +376,7 @@ struct vsp1_sru *vsp1_sru_create(struct vsp1_device *vsp1) v4l2_ctrl_new_custom(&sru->ctrls, &sru_intensity_control, NULL); sru->intensity = 1; + sru->force_identity_mode = false; sru->entity.subdev.ctrl_handler = &sru->ctrls; diff --git a/drivers/media/platform/vsp1/vsp1_sru.h b/drivers/media/platform/vsp1/vsp1_sru.h index ddb00eadd1ea..28da98d86366 100644 --- a/drivers/media/platform/vsp1/vsp1_sru.h +++ b/drivers/media/platform/vsp1/vsp1_sru.h @@ -26,6 +26,7 @@ struct vsp1_sru { struct v4l2_ctrl_handler ctrls; unsigned int intensity; + bool force_identity_mode; }; static inline struct vsp1_sru *to_sru(struct v4l2_subdev *subdev) diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c index e78eadd0295b..9404d7968371 100644 --- a/drivers/media/platform/vsp1/vsp1_video.c +++ b/drivers/media/platform/vsp1/vsp1_video.c @@ -31,6 +31,7 @@ #include "vsp1_hgt.h" #include "vsp1_pipe.h" #include "vsp1_rwpf.h" +#include "vsp1_sru.h" #include "vsp1_uds.h" #include "vsp1_video.h" @@ -480,10 +481,12 @@ static int vsp1_video_pipeline_build_branch(struct vsp1_pipeline *pipe, struct vsp1_rwpf *input, struct vsp1_rwpf *output) { + struct vsp1_device *vsp1 = output->entity.vsp1; struct media_entity_enum ent_enum; struct vsp1_entity *entity; struct media_pad *pad; struct vsp1_brx *brx = NULL; + bool sru_found = false; int ret; ret = media_entity_enum_init(&ent_enum, &input->entity.vsp1->media_dev); @@ -540,13 +543,37 @@ static int vsp1_video_pipeline_build_branch(struct vsp1_pipeline *pipe, goto out; } - /* UDS can't be chained. */ + if (entity->type == VSP1_ENTITY_SRU) { + struct vsp1_sru *sru = to_sru(&entity->subdev); + + /* + * Gen3 partition algorithm restricts SRU double-scaled + * resolution if it is connected after a UDS entity. + */ + if (vsp1->info->gen == 3 && pipe->uds) + sru->force_identity_mode = true; + + sru_found = true; + } + if (entity->type == VSP1_ENTITY_UDS) { + /* UDS can't be chained. */ if (pipe->uds) { ret = -EPIPE; goto out; } + /* + * On Gen3 hardware using the partition algorithm, the + * UDS must not be connected after the SRU. Using the + * SRU on Gen3 will always engage the partition + * algorithm. + */ + if (vsp1->info->gen == 3 && sru_found) { + ret = -EPIPE; + goto out; + } + pipe->uds = entity; pipe->uds_input = brx ? &brx->entity : &input->entity; } From patchwork Fri Aug 31 14:40:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10583927 X-Patchwork-Delegate: geert@linux-m68k.org 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 B9D0B14E1 for ; Fri, 31 Aug 2018 14:41:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA21A2BA7B for ; Fri, 31 Aug 2018 14:41:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D62E2BF3B; Fri, 31 Aug 2018 14:41:12 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 54CCC2BA7B for ; Fri, 31 Aug 2018 14:41:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728821AbeHaSsm (ORCPT ); Fri, 31 Aug 2018 14:48:42 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:44524 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728760AbeHaSsl (ORCPT ); Fri, 31 Aug 2018 14:48:41 -0400 Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B48841AA2; Fri, 31 Aug 2018 16:40:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1535726451; bh=2bSgBlD5BczKXo2QNEk9M3an9MenpcPj9DQhEYcxIfE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IUVd+AgpRGZWPPaqcOOeaKkM1eMGMFlWRP74LguOV8wNm3sm2UJkrUbBRz6B15WsR JJ3oPVglObKQTIjOevfW3hi1m/HQN7pMR7JkBMWJ6WKuaCDr+LYZUp3di/2FQKbHO8 /BXkMs2LK6+nK0iLzRGqs873gkHoD9A5n8PQF6xQ= From: Kieran Bingham To: Laurent Pinchart , mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Kieran Bingham Subject: [PATCH 4/6] media: vsp1: Document max_width restriction on SRU Date: Fri, 31 Aug 2018 15:40:42 +0100 Message-Id: <20180831144044.31713-5-kieran.bingham+renesas@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180831144044.31713-1-kieran.bingham+renesas@ideasonboard.com> References: <20180831144044.31713-1-kieran.bingham+renesas@ideasonboard.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The SRU is currently restricted to 256 pixels as part of the current partition algorithm. Document that the actual capability of this component is 288 pixels, but don't increase the implementation. The extended partition algorithm may later choose to utilise a larger input to support overlapping partitions. Signed-off-by: Kieran Bingham --- drivers/media/platform/vsp1/vsp1_sru.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/platform/vsp1/vsp1_sru.c b/drivers/media/platform/vsp1/vsp1_sru.c index f277700e5cc2..2a40e09b9aa7 100644 --- a/drivers/media/platform/vsp1/vsp1_sru.c +++ b/drivers/media/platform/vsp1/vsp1_sru.c @@ -314,6 +314,10 @@ static unsigned int sru_max_width(struct vsp1_entity *entity, output = vsp1_entity_get_pad_format(&sru->entity, sru->entity.config, SRU_PAD_SOURCE); + /* + * The maximum width of the SRU is 288 input pixels, but to support the + * partition algorithm, this is currently kept at 256. + */ if (input->width != output->width) return 512; else From patchwork Fri Aug 31 14:40:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10583925 X-Patchwork-Delegate: geert@linux-m68k.org 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 B3B311709 for ; Fri, 31 Aug 2018 14:41:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A648A2BA7B for ; Fri, 31 Aug 2018 14:41:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A8062BA8E; Fri, 31 Aug 2018 14:41:09 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 5BFB82BF9E for ; Fri, 31 Aug 2018 14:41:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728760AbeHaSso (ORCPT ); Fri, 31 Aug 2018 14:48:44 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:44534 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728800AbeHaSsm (ORCPT ); Fri, 31 Aug 2018 14:48:42 -0400 Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2C9F81AA9; Fri, 31 Aug 2018 16:40:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1535726451; bh=UGBLCimnQAziXokWCQkuQUoE0LzCXqg+DstUlEdNYz8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=edGM6VuSvXmysK88dpiID8+BpiLvy2paQ9rLjyZkN7MExtu9rUV31CQ6T9UAPfMlb PS4SAUYdaxpL9KlNMWfOEv50llLkh4Eh4pdeXnkDPT2BNC12ONkeqBlL4VEEY2Ul8u 1MFQOUVLnWuCKHfilai4qKSi5XLCUtEQhf/4/UaY= From: Kieran Bingham To: Laurent Pinchart , mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Kieran Bingham Subject: [PATCH 5/6] media: vsp1: Document max_width restriction on UDS Date: Fri, 31 Aug 2018 15:40:43 +0100 Message-Id: <20180831144044.31713-6-kieran.bingham+renesas@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180831144044.31713-1-kieran.bingham+renesas@ideasonboard.com> References: <20180831144044.31713-1-kieran.bingham+renesas@ideasonboard.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The UDS is currently restricted based on a partition size of 256 pixels. Document the actual restrictions, but don't increase the implementation. The extended partition algorithm may later choose to utilise a larger partition size to support overlapping partitions. Signed-off-by: Kieran Bingham --- drivers/media/platform/vsp1/vsp1_uds.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/media/platform/vsp1/vsp1_uds.c b/drivers/media/platform/vsp1/vsp1_uds.c index c20c84b54936..7c11651db5d4 100644 --- a/drivers/media/platform/vsp1/vsp1_uds.c +++ b/drivers/media/platform/vsp1/vsp1_uds.c @@ -342,6 +342,14 @@ static unsigned int uds_max_width(struct vsp1_entity *entity, UDS_PAD_SOURCE); hscale = output->width / input->width; + /* + * The maximum width of the UDS is 304 pixels. These are input pixels + * in the event of up-scaling, and output pixels in the event of + * downscaling. + * + * To support the current parition algorithm, we clamp at units of 256. + */ + if (hscale <= 2) return 256; else if (hscale <= 4) From patchwork Fri Aug 31 14:40:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10583921 X-Patchwork-Delegate: geert@linux-m68k.org 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 79F3514E1 for ; Fri, 31 Aug 2018 14:41:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67D5F2BA7B for ; Fri, 31 Aug 2018 14:41:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B8762BA98; Fri, 31 Aug 2018 14:41:05 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 D33052BA8E for ; Fri, 31 Aug 2018 14:41:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728800AbeHaSsp (ORCPT ); Fri, 31 Aug 2018 14:48:45 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:44524 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728812AbeHaSso (ORCPT ); Fri, 31 Aug 2018 14:48:44 -0400 Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 973E71AAA; Fri, 31 Aug 2018 16:40:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1535726451; bh=6FMyxksbiAPbZkmrOWGq1rRGBdXHxKcmQ1W/2zsubXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RTq5d9WJJoG1ukE82fOZpy/0ZPgE5bKC1lKlzw+lffvqZAhCNWBNFSAmiRwJSmc5G BlvNqcCZCwOnLDMJo5lzjv5UDasp8JZJS38LGyxVUXyFGwrMZR8zLGbpivdvDT4Tcs CT2wTitK9JllqioyRuO5H4R7DzuQj1hdbj9/64D4= From: Kieran Bingham To: Laurent Pinchart , mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Kieran Bingham Subject: [PATCH 6/6] media: vsp1: use periods at the end of comment sentences Date: Fri, 31 Aug 2018 15:40:44 +0100 Message-Id: <20180831144044.31713-7-kieran.bingham+renesas@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180831144044.31713-1-kieran.bingham+renesas@ideasonboard.com> References: <20180831144044.31713-1-kieran.bingham+renesas@ideasonboard.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The style of this driver uses periods at the end of sentences in comments, but it is applied inconsitently. Update a selection of comments which were discovered to be missing their period. Also fix the spelling of one usage of 'instantiate' Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- drivers/media/platform/vsp1/vsp1_brx.c | 4 ++-- drivers/media/platform/vsp1/vsp1_drv.c | 6 +++--- drivers/media/platform/vsp1/vsp1_entity.c | 2 +- drivers/media/platform/vsp1/vsp1_rpf.c | 4 ++-- drivers/media/platform/vsp1/vsp1_sru.c | 2 +- drivers/media/platform/vsp1/vsp1_uds.c | 6 +++--- drivers/media/platform/vsp1/vsp1_video.c | 2 +- drivers/media/platform/vsp1/vsp1_wpf.c | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/media/platform/vsp1/vsp1_brx.c b/drivers/media/platform/vsp1/vsp1_brx.c index 359917b5d842..5e50178b057d 100644 --- a/drivers/media/platform/vsp1/vsp1_brx.c +++ b/drivers/media/platform/vsp1/vsp1_brx.c @@ -153,7 +153,7 @@ static int brx_set_format(struct v4l2_subdev *subdev, format = vsp1_entity_get_pad_format(&brx->entity, config, fmt->pad); *format = fmt->format; - /* Reset the compose rectangle */ + /* Reset the compose rectangle. */ if (fmt->pad != brx->entity.source_pad) { struct v4l2_rect *compose; @@ -164,7 +164,7 @@ static int brx_set_format(struct v4l2_subdev *subdev, compose->height = format->height; } - /* Propagate the format code to all pads */ + /* Propagate the format code to all pads. */ if (fmt->pad == BRX_PAD_SINK(0)) { unsigned int i; diff --git a/drivers/media/platform/vsp1/vsp1_drv.c b/drivers/media/platform/vsp1/vsp1_drv.c index b6619c9c18bb..249963cb2ec0 100644 --- a/drivers/media/platform/vsp1/vsp1_drv.c +++ b/drivers/media/platform/vsp1/vsp1_drv.c @@ -802,7 +802,7 @@ static int vsp1_probe(struct platform_device *pdev) platform_set_drvdata(pdev, vsp1); - /* I/O and IRQ resources (clock managed by the clock PM domain) */ + /* I/O and IRQ resources (clock managed by the clock PM domain). */ io = platform_get_resource(pdev, IORESOURCE_MEM, 0); vsp1->mmio = devm_ioremap_resource(&pdev->dev, io); if (IS_ERR(vsp1->mmio)) @@ -821,7 +821,7 @@ static int vsp1_probe(struct platform_device *pdev) return ret; } - /* FCP (optional) */ + /* FCP (optional). */ fcp_node = of_parse_phandle(pdev->dev.of_node, "renesas,fcp", 0); if (fcp_node) { vsp1->fcp = rcar_fcp_get(fcp_node); @@ -869,7 +869,7 @@ static int vsp1_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "IP version 0x%08x\n", vsp1->version); - /* Instanciate entities */ + /* Instantiate entities. */ ret = vsp1_create_entities(vsp1); if (ret < 0) { dev_err(&pdev->dev, "failed to create entities\n"); diff --git a/drivers/media/platform/vsp1/vsp1_entity.c b/drivers/media/platform/vsp1/vsp1_entity.c index 36a29e13109e..a54ab528b060 100644 --- a/drivers/media/platform/vsp1/vsp1_entity.c +++ b/drivers/media/platform/vsp1/vsp1_entity.c @@ -404,7 +404,7 @@ int vsp1_subdev_set_pad_format(struct v4l2_subdev *subdev, format = vsp1_entity_get_pad_format(entity, config, entity->source_pad); *format = fmt->format; - /* Reset the crop and compose rectangles */ + /* Reset the crop and compose rectangles. */ selection = vsp1_entity_get_pad_selection(entity, config, fmt->pad, V4L2_SEL_TGT_CROP); selection->left = 0; diff --git a/drivers/media/platform/vsp1/vsp1_rpf.c b/drivers/media/platform/vsp1/vsp1_rpf.c index f8005b60b9d2..616afa7e165f 100644 --- a/drivers/media/platform/vsp1/vsp1_rpf.c +++ b/drivers/media/platform/vsp1/vsp1_rpf.c @@ -108,7 +108,7 @@ static void rpf_configure_stream(struct vsp1_entity *entity, vsp1_rpf_write(rpf, dlb, VI6_RPF_INFMT, infmt); vsp1_rpf_write(rpf, dlb, VI6_RPF_DSWAP, fmtinfo->swap); - /* Output location */ + /* Output location. */ if (pipe->brx) { const struct v4l2_rect *compose; @@ -309,7 +309,7 @@ static void rpf_configure_partition(struct vsp1_entity *entity, /* * Interlaced pipelines will use the extended pre-cmd to process - * SRCM_ADDR_{Y,C0,C1} + * SRCM_ADDR_{Y,C0,C1}. */ if (pipe->interlaced) { vsp1_rpf_configure_autofld(rpf, dl); diff --git a/drivers/media/platform/vsp1/vsp1_sru.c b/drivers/media/platform/vsp1/vsp1_sru.c index 2a40e09b9aa7..f48b085b5b5e 100644 --- a/drivers/media/platform/vsp1/vsp1_sru.c +++ b/drivers/media/platform/vsp1/vsp1_sru.c @@ -339,7 +339,7 @@ static void sru_partition(struct vsp1_entity *entity, output = vsp1_entity_get_pad_format(&sru->entity, sru->entity.config, SRU_PAD_SOURCE); - /* Adapt if SRUx2 is enabled */ + /* Adapt if SRUx2 is enabled. */ if (input->width != output->width) { window->width /= 2; window->left /= 2; diff --git a/drivers/media/platform/vsp1/vsp1_uds.c b/drivers/media/platform/vsp1/vsp1_uds.c index 7c11651db5d4..c704bdaf4edc 100644 --- a/drivers/media/platform/vsp1/vsp1_uds.c +++ b/drivers/media/platform/vsp1/vsp1_uds.c @@ -314,13 +314,13 @@ static void uds_configure_partition(struct vsp1_entity *entity, output = vsp1_entity_get_pad_format(&uds->entity, uds->entity.config, UDS_PAD_SOURCE); - /* Input size clipping */ + /* Input size clipping. */ vsp1_uds_write(uds, dlb, VI6_UDS_HSZCLIP, VI6_UDS_HSZCLIP_HCEN | (0 << VI6_UDS_HSZCLIP_HCL_OFST_SHIFT) | (partition->uds_sink.width << VI6_UDS_HSZCLIP_HCL_SIZE_SHIFT)); - /* Output size clipping */ + /* Output size clipping. */ vsp1_uds_write(uds, dlb, VI6_UDS_CLIP_SIZE, (partition->uds_source.width << VI6_UDS_CLIP_SIZE_HSIZE_SHIFT) | @@ -374,7 +374,7 @@ static void uds_partition(struct vsp1_entity *entity, const struct v4l2_mbus_framefmt *output; const struct v4l2_mbus_framefmt *input; - /* Initialise the partition state */ + /* Initialise the partition state. */ partition->uds_sink = *window; partition->uds_source = *window; diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c index 9404d7968371..c114cc4d2349 100644 --- a/drivers/media/platform/vsp1/vsp1_video.c +++ b/drivers/media/platform/vsp1/vsp1_video.c @@ -891,7 +891,7 @@ static void vsp1_video_cleanup_pipeline(struct vsp1_pipeline *pipe) pipe->stream_config = NULL; pipe->configured = false; - /* Release our partition table allocation */ + /* Release our partition table allocation. */ kfree(pipe->part_table); pipe->part_table = NULL; } diff --git a/drivers/media/platform/vsp1/vsp1_wpf.c b/drivers/media/platform/vsp1/vsp1_wpf.c index c2a1a7f97e26..32bb207b2007 100644 --- a/drivers/media/platform/vsp1/vsp1_wpf.c +++ b/drivers/media/platform/vsp1/vsp1_wpf.c @@ -317,7 +317,7 @@ static void wpf_configure_stream(struct vsp1_entity *entity, vsp1_wpf_write(wpf, dlb, VI6_WPF_SRCRPF, srcrpf); - /* Enable interrupts */ + /* Enable interrupts. */ vsp1_dl_body_write(dlb, VI6_WPF_IRQ_STA(wpf->entity.index), 0); vsp1_dl_body_write(dlb, VI6_WPF_IRQ_ENB(wpf->entity.index), VI6_WFP_IRQ_ENB_DFEE);