From patchwork Tue Aug 15 22:57:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 9902587 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9A5896028A for ; Tue, 15 Aug 2017 22:57:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E0662894C for ; Tue, 15 Aug 2017 22:57:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82E612894E; Tue, 15 Aug 2017 22:57:44 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 53DC82894D for ; Tue, 15 Aug 2017 22:57:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752899AbdHOW53 (ORCPT ); Tue, 15 Aug 2017 18:57:29 -0400 Received: from galahad.ideasonboard.com ([185.26.127.97]:38499 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752453AbdHOW52 (ORCPT ); Tue, 15 Aug 2017 18:57:28 -0400 Received: from avalon.bb.dnainternet.fi (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id 8B33A2017E; Wed, 16 Aug 2017 00:56:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1502837770; bh=7TsZ6IdCi4ihTJc/NHAKZTgdCWHvDyuiBUMGjoBNgnA=; h=From:To:Cc:Subject:Date:From; b=XrzeBIxtD0A0CUbJ2+whUpSm+tWdANR5hv4GRWb/BEckqS/HmR5Y9nmHoGs6x7tl1 nmcj7D3w3nyY9mxLyXwfyJ9ULIwbRQneV4Tj2mfLPTIN0Kps32qUai9S2XUaTyonG3 v48WUOJlzFo+HMIGPrZmom6g18pBGZL4RFnDn8PQ= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org Subject: [PATCH] v4l: vsp1: Start and stop DRM pipeline independently of planes Date: Wed, 16 Aug 2017 01:57:44 +0300 Message-Id: <20170815225744.14730-1-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 2.13.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The KMS API supports enabling a CRTC without any plane. To enable that use case, we need to start the pipeline when configuring the LIF, instead of when enabling the first plane. Signed-off-by: Laurent Pinchart Tested-by: Kieran Bingham Reviewed-by: Kieran Bingham --- drivers/media/platform/vsp1/vsp1_drm.c | 37 +++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 10 deletions(-) This patch is based on top of the VSP+DU large patch series queued through Dave's DRM tree for v4.14-rc1. It doesn't can't be merged independently through the linux-media tree for the same kernel version. As the change is not urgent, it can be delayed until v4.15-rc1. diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c index 4dfbeac8f42c..7ce69f23f50a 100644 --- a/drivers/media/platform/vsp1/vsp1_drm.c +++ b/drivers/media/platform/vsp1/vsp1_drm.c @@ -84,8 +84,12 @@ int vsp1_du_setup_lif(struct device *dev, unsigned int pipe_index, struct vsp1_drm_pipeline *drm_pipe; struct vsp1_pipeline *pipe; struct vsp1_bru *bru; + struct vsp1_entity *entity; + struct vsp1_entity *next; + struct vsp1_dl_list *dl; struct v4l2_subdev_format format; const char *bru_name; + unsigned long flags; unsigned int i; int ret; @@ -250,6 +254,29 @@ int vsp1_du_setup_lif(struct device *dev, unsigned int pipe_index, vsp1_write(vsp1, VI6_DISP_IRQ_STA, 0); vsp1_write(vsp1, VI6_DISP_IRQ_ENB, 0); + /* Configure all entities in the pipeline. */ + dl = vsp1_dl_list_get(pipe->output->dlm); + + list_for_each_entry_safe(entity, next, &pipe->entities, list_pipe) { + vsp1_entity_route_setup(entity, pipe, dl); + + if (entity->ops->configure) { + entity->ops->configure(entity, pipe, dl, + VSP1_ENTITY_PARAMS_INIT); + entity->ops->configure(entity, pipe, dl, + VSP1_ENTITY_PARAMS_RUNTIME); + entity->ops->configure(entity, pipe, dl, + VSP1_ENTITY_PARAMS_PARTITION); + } + } + + vsp1_dl_list_commit(dl); + + /* Start the pipeline. */ + spin_lock_irqsave(&pipe->irqlock, flags); + vsp1_pipeline_run(pipe); + spin_unlock_irqrestore(&pipe->irqlock, flags); + dev_dbg(vsp1->dev, "%s: pipeline enabled\n", __func__); return 0; @@ -488,7 +515,6 @@ void vsp1_du_atomic_flush(struct device *dev, unsigned int pipe_index) struct vsp1_entity *next; struct vsp1_dl_list *dl; const char *bru_name; - unsigned long flags; unsigned int i; int ret; @@ -570,15 +596,6 @@ void vsp1_du_atomic_flush(struct device *dev, unsigned int pipe_index) } vsp1_dl_list_commit(dl); - - /* Start or stop the pipeline if needed. */ - if (!drm_pipe->enabled && pipe->num_inputs) { - spin_lock_irqsave(&pipe->irqlock, flags); - vsp1_pipeline_run(pipe); - spin_unlock_irqrestore(&pipe->irqlock, flags); - } else if (drm_pipe->enabled && !pipe->num_inputs) { - vsp1_pipeline_stop(pipe); - } } EXPORT_SYMBOL_GPL(vsp1_du_atomic_flush);