From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934062AbcIFJ1L (ORCPT ); Tue, 6 Sep 2016 05:27:11 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:59451 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933472AbcIFJ02 (ORCPT ); Tue, 6 Sep 2016 05:26:28 -0400 Message-ID: <1473153985.2805.90.camel@pengutronix.de> Subject: Re: [PATCH v4 4/4] gpu: ipu-ic: allow multiple handles to ic From: Philipp Zabel To: Steve Longerbeam Cc: plagnioj@jcrosoft.com, tomi.valkeinen@ti.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, Steve Longerbeam Date: Tue, 06 Sep 2016 11:26:25 +0200 In-Reply-To: <1471481419-5917-5-git-send-email-steve_longerbeam@mentor.com> References: <1471481419-5917-1-git-send-email-steve_longerbeam@mentor.com> <1471481419-5917-5-git-send-email-steve_longerbeam@mentor.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:96de:80ff:fec2:9969 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Mittwoch, den 17.08.2016, 17:50 -0700 schrieb Steve Longerbeam: > The image converter kernel API supports conversion contexts and > job queues, so we should allow more than one handle to the IC, so > that multiple users can add jobs to the queue. The image converter queue can be shared, but hardware access to the IC task still has to be exclusive (ipu_ic_task_enable/disable/init/etc.) > Note however that users that control the IC manually (that do not > use the image converter APIs but setup the IC task by hand via calls > to ipu_ic_task_enable(), ipu_ic_enable(), etc.) must still be careful not > to share the IC handle with other threads. At this point, the only user > that still controls the IC manually is the i.mx capture driver. In that > case the capture driver only allows one open context to get a handle > to the IC at a time, so we should be ok there. The ipu_ic task handles should be kept exclusive. The image conversion queue API could get its own handle (ipu_ic_queue? basically what is now struct image_converter) with its own refcounting get/put functions on top and each queue should take one exclusive reference on its corresponding IC task while requested.:_: If the capture code uses FSU channel linking to feed the IC preprocessor tasks directly from the CSI, the viewfinder and encoder IC tasks should not be available for the conversion queues to use. regards Philipp