Message ID | 1471481419-5917-5-git-send-email-steve_longerbeam@mentor.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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 -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/gpu/ipu-v3/ipu-ic.c b/drivers/gpu/ipu-v3/ipu-ic.c index 01b1b56..c44aeba 100644 --- a/drivers/gpu/ipu-v3/ipu-ic.c +++ b/drivers/gpu/ipu-v3/ipu-ic.c @@ -338,7 +338,6 @@ struct ipu_ic { enum ipu_color_space out_cs; bool graphics; bool rotation; - bool in_use; struct image_converter cvt; @@ -2370,38 +2369,16 @@ EXPORT_SYMBOL_GPL(ipu_ic_disable); struct ipu_ic *ipu_ic_get(struct ipu_soc *ipu, enum ipu_ic_task task) { struct ipu_ic_priv *priv = ipu->ic_priv; - unsigned long flags; - struct ipu_ic *ic, *ret; if (task >= IC_NUM_TASKS) return ERR_PTR(-EINVAL); - ic = &priv->task[task]; - - spin_lock_irqsave(&priv->lock, flags); - - if (ic->in_use) { - ret = ERR_PTR(-EBUSY); - goto unlock; - } - - ic->in_use = true; - ret = ic; - -unlock: - spin_unlock_irqrestore(&priv->lock, flags); - return ret; + return &priv->task[task]; } EXPORT_SYMBOL_GPL(ipu_ic_get); void ipu_ic_put(struct ipu_ic *ic) { - struct ipu_ic_priv *priv = ic->priv; - unsigned long flags; - - spin_lock_irqsave(&priv->lock, flags); - ic->in_use = false; - spin_unlock_irqrestore(&priv->lock, flags); } EXPORT_SYMBOL_GPL(ipu_ic_put);
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. 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. Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com> --- v4: no changes v3: no changes v2: no changes --- drivers/gpu/ipu-v3/ipu-ic.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-)