From patchwork Wed Mar 13 00:05:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 10850405 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7EEE41515 for ; Wed, 13 Mar 2019 00:06:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B30429883 for ; Wed, 13 Mar 2019 00:06:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5FC1D299D5; Wed, 13 Mar 2019 00:06:11 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 07B2029883 for ; Wed, 13 Mar 2019 00:06:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A37F36E046; Wed, 13 Mar 2019 00:05:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by gabe.freedesktop.org (Postfix) with ESMTPS id D4D076E03C for ; Wed, 13 Mar 2019 00:05:52 +0000 (UTC) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id F35419DB; Wed, 13 Mar 2019 01:05:49 +0100 (CET) From: Laurent Pinchart To: dri-devel@lists.freedesktop.org Subject: [PATCH v6 10/18] media: vsp1: drm: Extend frame completion API to the DU driver Date: Wed, 13 Mar 2019 02:05:24 +0200 Message-Id: <20190313000532.7087-11-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190313000532.7087-1-laurent.pinchart+renesas@ideasonboard.com> References: <20190313000532.7087-1-laurent.pinchart+renesas@ideasonboard.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1552435550; bh=wJ9TD5iSpzEG8YYZBSzgMSH8VQMOVzLjHqElJ+znd+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fxYdsHgJGmWCgLDFvXmRRd2jqoYXchKLhnuPvdeR0IMoSImn0YXbNbYSXDElE3aVX 0EwTvomjLHion307kl8UOKQbD3Ci9VXpt+6Y5dxZXgWfDP51UdsenwFYRSKWQcJqlK FTV3+aqMRIeYQ+Kotl9FWqUJgHWFeNLRiPWi4Zus= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-renesas-soc@vger.kernel.org, Kieran Bingham , Liviu Dudau , linux-media@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The VSP1 driver will need to pass extra flags to the DU through the frame completion API. Replace the completed bool flag by a bitmask to support this. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 4 ++-- drivers/media/platform/vsp1/vsp1_drm.c | 4 ++-- drivers/media/platform/vsp1/vsp1_drm.h | 2 +- include/media/vsp1.h | 4 +++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c index 76a39eee7c9c..28bfeb8c24fb 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c @@ -26,14 +26,14 @@ #include "rcar_du_kms.h" #include "rcar_du_vsp.h" -static void rcar_du_vsp_complete(void *private, bool completed, u32 crc) +static void rcar_du_vsp_complete(void *private, unsigned int status, u32 crc) { struct rcar_du_crtc *crtc = private; if (crtc->vblank_enable) drm_crtc_handle_vblank(&crtc->crtc); - if (completed) + if (status & VSP1_DU_STATUS_COMPLETE) rcar_du_crtc_finish_page_flip(crtc); drm_crtc_add_crc_entry(&crtc->crtc, false, 0, &crc); diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c index 5601a787688b..0367f88135bf 100644 --- a/drivers/media/platform/vsp1/vsp1_drm.c +++ b/drivers/media/platform/vsp1/vsp1_drm.c @@ -34,14 +34,14 @@ static void vsp1_du_pipeline_frame_end(struct vsp1_pipeline *pipe, unsigned int completion) { struct vsp1_drm_pipeline *drm_pipe = to_vsp1_drm_pipeline(pipe); - bool complete = completion & VSP1_DL_FRAME_END_COMPLETED; if (drm_pipe->du_complete) { struct vsp1_entity *uif = drm_pipe->uif; + unsigned int status = completion & VSP1_DU_STATUS_COMPLETE; u32 crc; crc = uif ? vsp1_uif_get_crc(to_uif(&uif->subdev)) : 0; - drm_pipe->du_complete(drm_pipe->du_private, complete, crc); + drm_pipe->du_complete(drm_pipe->du_private, status, crc); } if (completion & VSP1_DL_FRAME_END_INTERNAL) { diff --git a/drivers/media/platform/vsp1/vsp1_drm.h b/drivers/media/platform/vsp1/vsp1_drm.h index 8dfd274a59e2..e85ad4366fbb 100644 --- a/drivers/media/platform/vsp1/vsp1_drm.h +++ b/drivers/media/platform/vsp1/vsp1_drm.h @@ -42,7 +42,7 @@ struct vsp1_drm_pipeline { struct vsp1_du_crc_config crc; /* Frame synchronisation */ - void (*du_complete)(void *data, bool completed, u32 crc); + void (*du_complete)(void *data, unsigned int status, u32 crc); void *du_private; }; diff --git a/include/media/vsp1.h b/include/media/vsp1.h index 1cf868360701..877496936487 100644 --- a/include/media/vsp1.h +++ b/include/media/vsp1.h @@ -17,6 +17,8 @@ struct device; int vsp1_du_init(struct device *dev); +#define VSP1_DU_STATUS_COMPLETE BIT(0) + /** * struct vsp1_du_lif_config - VSP LIF configuration * @width: output frame width @@ -32,7 +34,7 @@ struct vsp1_du_lif_config { unsigned int height; bool interlaced; - void (*callback)(void *data, bool completed, u32 crc); + void (*callback)(void *data, unsigned int status, u32 crc); void *callback_data; };