Received: by 10.213.65.68 with SMTP id h4csp257996imn; Tue, 13 Mar 2018 03:29:23 -0700 (PDT) X-Google-Smtp-Source: AG47ELsQApG5EySffbe6a1UoKtlTlujcDYJTDqWvIadBl830H0qp8qCMIsdaUao9V+VBtQxuJCNl X-Received: by 10.98.89.156 with SMTP id k28mr99381pfj.130.1520936962992; Tue, 13 Mar 2018 03:29:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520936962; cv=none; d=google.com; s=arc-20160816; b=Gw0dnyRC+jMyCYOoLACadH8xvZQ8rOP6eSlNefEunUQBTpIX+2Rg7OMnJFj8quQCc5 EnDt7Tnyr0mFNBHq1QzHihjtrPHUIWBBjISB4P5fz9zaXcqpW3dDjgUYOCsza4QnoWje ai4IZLkuHAryaVgGlru5uPoqV0RDIA5nXuStcn9WkhlDmsrIeTaixt0JeSuX3SZ0KL2D qfg52ia2H9SzcBxpyLpJNSZVA6hoOYEBjNfZIsb/JOujOaoWNIm1SdXEC4wjiNK6SVp7 pXoxWaV8qH97nl987R0uN8C7tONqerDKH3wKPSH5iwUbayK4CWevC/lYCa3L9zZxIj3W zmbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature:arc-authentication-results; bh=x98z/nYm3FgrjKD6hBVI3JvtA6VOH8HD5SHg1mxst1Y=; b=WE7FJcCtbZs8yD9i/TJtERB/FBjsxll5vvCtv6Xyho4Z9F6yupWtly+vMRDSR3ZaOk 0xpzmAWJMl+wMfBYzoKtx8eKD85PnTSG+KxX/e/+RUlEc2hAq1q+Mpvky0Xy/AegYfBo zOk/RSS8Ob44MXZJxh4plIFD2Sfz5Dexmj+KPUY7trRicr8z01cgmGN3K/iNwg7Lzvm1 sPJEYlmhsiQC5kvhxnnDLImCejlJDSUeGqdsjo3pkOoVkZ/C0pTlMDSjfJn2naU7inR4 nIAk47osikZc0YP5ovYQxM/iD9W8li5i2bEiOKXsD3RFSFEvhiU4S4K+bg8mQ7FTZaKD CELg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=nRv8nP2b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v2-v6si32466plp.113.2018.03.13.03.29.07; Tue, 13 Mar 2018 03:29:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=nRv8nP2b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932665AbeCMK14 (ORCPT + 99 others); Tue, 13 Mar 2018 06:27:56 -0400 Received: from galahad.ideasonboard.com ([185.26.127.97]:34527 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932521AbeCMK1y (ORCPT ); Tue, 13 Mar 2018 06:27:54 -0400 Received: from [192.168.43.222] (unknown [149.254.234.209]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id E7FD2202D7; Tue, 13 Mar 2018 11:25:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1520936742; bh=gcYZHB3GFrJ1qN40urORSLDCKVtZIGqJxWGl8xG3DOk=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=nRv8nP2b6RcSd/VWlv6PWQEOSKIOdEDZuXjA0Rv07Zx3+FrN+tIYpENjyQc1UqjTA YfqKm+Y1xN7HpiPMjxOT27VdsZHEm8l1koWkNVUlIjbWjHFxCI6YevkqMAoy2ZgSUD 7xzELoWnp3EPi+46mDfpWD6pfufQePos6DHz/964= Subject: Re: [PATCH 09/11] media: vsp1: Provide support for extended command pools To: jacopo mondi , Kieran Bingham Cc: Laurent Pinchart , linux-renesas-soc@vger.kernel.org, linux-media@vger.kernel.org, Mauro Carvalho Chehab , open list References: <02dcefdd58c734623b9caf2513316380feb9f993.1520632434.git-series.kieran.bingham+renesas@ideasonboard.com> <20180312163045.GE12967@w540> From: Kieran Bingham Organization: Ideas on Board Message-ID: <3ba8e871-5218-cac1-19d0-bdaaa182bf45@ideasonboard.com> Date: Tue, 13 Mar 2018 10:27:47 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180312163045.GE12967@w540> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jacopo, On 12/03/18 16:30, jacopo mondi wrote: > Hi Kieran, > just one small thing I noticed below... > > On Fri, Mar 09, 2018 at 10:04:07PM +0000, Kieran Bingham wrote: >> VSPD and VSP-DL devices can provide extended display lists supporting >> extended command display list objects. >> >> These extended commands require their own dma memory areas for a header >> and body specific to the command type. >> >> Implement a command pool to allocate all necessary memory in a single >> DMA allocation to reduce pressure on the TLB, and provide convenvient >> re-usable command objects for the entities to utilise. >> >> Signed-off-by: Kieran Bingham >> --- >> drivers/media/platform/vsp1/vsp1_dl.c | 189 +++++++++++++++++++++++++++- >> drivers/media/platform/vsp1/vsp1_dl.h | 3 +- >> 2 files changed, 192 insertions(+) >> >> diff --git a/drivers/media/platform/vsp1/vsp1_dl.c b/drivers/media/platform/vsp1/vsp1_dl.c >> index 36440a2a2c8b..6d17b8bfa21c 100644 >> --- a/drivers/media/platform/vsp1/vsp1_dl.c >> +++ b/drivers/media/platform/vsp1/vsp1_dl.c >> @@ -121,6 +121,30 @@ struct vsp1_dl_body_pool { >> }; >> >> /** >> + * struct vsp1_cmd_pool - display list body pool >> + * @dma: DMA address of the entries >> + * @size: size of the full DMA memory pool in bytes >> + * @mem: CPU memory pointer for the pool >> + * @bodies: Array of DLB structures for the pool >> + * @free: List of free DLB entries >> + * @lock: Protects the pool and free list >> + * @vsp1: the VSP1 device >> + */ >> +struct vsp1_dl_cmd_pool { >> + /* DMA allocation */ >> + dma_addr_t dma; >> + size_t size; >> + void *mem; >> + >> + struct vsp1_dl_ext_cmd *cmds; >> + struct list_head free; >> + >> + spinlock_t lock; >> + >> + struct vsp1_device *vsp1; >> +}; >> + >> +/** >> * struct vsp1_dl_list - Display list >> * @list: entry in the display list manager lists >> * @dlm: the display list manager >> @@ -176,6 +200,7 @@ struct vsp1_dl_manager { >> struct vsp1_dl_list *pending; >> >> struct vsp1_dl_body_pool *pool; >> + struct vsp1_dl_cmd_pool *autfld_cmds; >> }; >> >> /* ----------------------------------------------------------------------------- >> @@ -339,6 +364,139 @@ void vsp1_dl_body_write(struct vsp1_dl_body *dlb, u32 reg, u32 data) >> } >> >> /* ----------------------------------------------------------------------------- >> + * Display List Extended Command Management >> + */ >> + >> +enum vsp1_extcmd_type { >> + VSP1_EXTCMD_AUTODISP, >> + VSP1_EXTCMD_AUTOFLD, >> +}; >> + >> +struct vsp1_extended_command_info { >> + u16 opcode; >> + size_t body_size; >> +} vsp1_extended_commands[] = { >> + [VSP1_EXTCMD_AUTODISP] = { 0x02, 96 }, >> + [VSP1_EXTCMD_AUTOFLD] = { 0x03, 160 }, >> +}; > > How about making this one static and const, since it does not get > modified? Good spot. Certainly. This is just a static descriptor table of the extended command parameter sizes, so it should not change. (but could be added to in later hardware operations I presume). Cheers Kieran > > Thanks > j >