Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp905483imm; Fri, 3 Aug 2018 13:51:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpclOKh+NHmU/484fdxA+0Rs3o7G3a1ajYupdX68HIfS3CE24Jg4KErmvWNj2dvF4F6PseUE X-Received: by 2002:a17:902:65:: with SMTP id 92-v6mr4956040pla.318.1533329472600; Fri, 03 Aug 2018 13:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533329472; cv=none; d=google.com; s=arc-20160816; b=zwgDvy4oKjHTFu6lOxHEyjKu3rkgWBt08ahUemyWEGzc9fah7syrtf7WzV2L06uiOK R3aHRzzNGeIBJ9ikyz52wHOILoLY1fkOe0T7ClXYedxCJjdAcsE03LBdhdby6rhjtPfJ Dw3us3AjwbIknnda+emVe9/U1BpF0hPnW+NxbYnGYjiBjboBIbitqO9XiqdZIyV4vjot AUrCrVkzmx1TXgEM7y74Aknu+y8mjPfs/VU7iwtwtgMjn8KfQfQ09xbzOn+NoErg6AeI ju7bHZkex6OAAGBvL7PggSd12WwqeR+Zaii+m9uuNheqG3MfXda1siuiwuqoGzZEN64B RrOw== 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:mime-version :organization:references:in-reply-to:date:cc:to:from:subject :message-id:arc-authentication-results; bh=8nKroX0TqVT3jaOAg7YwqHh2E7PHyHOoU5fxDm2oFPY=; b=r8SO/I5Yb5ho4NHVxdgfMNkBcYgyePmF6hLyOGSNdg4mVoooEN4GHqldr0+5veZU4C jmsZrm0GBfH5ZcpC7WoIXJmMULJnMOHeIAylKcHFLCCxR67K2jPWJ3qRLIBbRUNWweCQ NnXEbo+JRa5U3KbkWV9X0a++SbSyZsegXjeBgtaeqH9hg3csCcql1Rw7wPPcqktBW7ow PTsHveHjgBhGRBuhQPO3Y+ipm0zT/ft4WO2n12prQvLWPWfpSWhCzAq2TvSrzbABV1DZ fxUqvWK9pIgCexcHRALcrFfvJ69/Zu/U696+4BSaRUrw3uL0f/S8rH5trFT9p1PfkTdr 652A== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w1-v6si6625941pfl.215.2018.08.03.13.50.57; Fri, 03 Aug 2018 13:51:12 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732065AbeHCWrq (ORCPT + 99 others); Fri, 3 Aug 2018 18:47:46 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:57410 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728477AbeHCWrq (ORCPT ); Fri, 3 Aug 2018 18:47:46 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id 35AF927D53A Message-ID: Subject: Re: [PATCH v6 4/8] media: platform: Add Cedrus VPU decoder driver From: Ezequiel Garcia To: Paul Kocialkowski , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org Cc: Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Maxime Ripard , Chen-Yu Tsai , Greg Kroah-Hartman , Thomas Petazzoni , linux-sunxi@googlegroups.com, Hugues Fruchet , Randy Li , Hans Verkuil , Tomasz Figa , Alexandre Courbot , Philipp Zabel , Laurent Pinchart , Sakari Ailus Date: Fri, 03 Aug 2018 17:49:38 -0300 In-Reply-To: <20180725100256.22833-5-paul.kocialkowski@bootlin.com> References: <20180725100256.22833-1-paul.kocialkowski@bootlin.com> <20180725100256.22833-5-paul.kocialkowski@bootlin.com> Organization: Collabora Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.2-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-07-25 at 12:02 +0200, Paul Kocialkowski wrote: > This introduces the Cedrus VPU driver that supports the VPU found in > Allwinner SoCs, also known as Video Engine. It is implemented through > a v4l2 m2m decoder device and a media device (used for media requests). > So far, it only supports MPEG2 decoding. > > Since this VPU is stateless, synchronization with media requests is > required in order to ensure consistency between frame headers that > contain metadata about the frame to process and the raw slice data that > is used to generate the frame. > > This driver was made possible thanks to the long-standing effort > carried out by the linux-sunxi community in the interest of reverse > engineering, documenting and implementing support for Allwinner VPU. > > Signed-off-by: Paul Kocialkowski [..] > +static int cedrus_probe(struct platform_device *pdev) > +{ > + struct cedrus_dev *dev; > + struct video_device *vfd; > + int ret; > + > + dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); > + if (!dev) > + return -ENOMEM; > + > + dev->dev = &pdev->dev; > + dev->pdev = pdev; > + > + ret = cedrus_hw_probe(dev); > + if (ret) { > + dev_err(&pdev->dev, "Failed to probe hardware\n"); > + return ret; > + } > + > + dev->dec_ops[CEDRUS_CODEC_MPEG2] = &cedrus_dec_ops_mpeg2; > + > + mutex_init(&dev->dev_mutex); > + spin_lock_init(&dev->irq_lock); > + A minor thing. I believe this spinlock is not needed. All the data structures it's accessing are already protected, and some operations (stop_streaming) are guaranteed to not run at the same time as a job. Regards, Eze