From patchwork Thu Feb 21 10:31:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 10823581 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 D7CFB13A4 for ; Thu, 21 Feb 2019 10:32:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C294630670 for ; Thu, 21 Feb 2019 10:32:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B359030785; Thu, 21 Feb 2019 10:32:28 +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 4AD9630670 for ; Thu, 21 Feb 2019 10:32:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF13C89165; Thu, 21 Feb 2019 10:32:24 +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 60E0B89151 for ; Thu, 21 Feb 2019 10:32:23 +0000 (UTC) Received: from pendragon.bb.dnainternet.fi (dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 29769255; Thu, 21 Feb 2019 11:32:21 +0100 (CET) From: Laurent Pinchart To: dri-devel@lists.freedesktop.org Subject: [PATCH v5 00/19] R-Car DU display writeback support Date: Thu, 21 Feb 2019 12:31:53 +0200 Message-Id: <20190221103212.28764-1-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1550745141; bh=cNN0kyzDvaTnarT0bCPQH/J6UhvhdIzKIUcUDJdXZcw=; h=From:To:Cc:Subject:Date:From; b=pnY/70HWdgTB1NqVcoBqiZxNKzYY38JQ1qxfwaURNQVIFOT3R9eHrznzcoM8bnzLG UQAqzLx7PW/9hfO+N3eKXfejdaRBomef01skSImDp1Cvc+ZibPGAchWy5A0WwzMWMm tp88utjZS296rXLS7GNKC0740IrF123xrYXhjiBI= 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: Liviu Dudau , James Qian Wang , Kieran Bingham Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hello everybody, This patch series implements display writeback support for the R-Car Gen3 platforms in the VSP1 and DU drivers. Patches 01/19 to 11/19 prepare the VSP1 driver for writeback support with all the necessary plumbing, including extensions of the API between the VSP1 and DU drivers. Compared to v4 the major change is the move from V4L2 to DRM writeback connectors for the userspace API. This has caused a few issues with writeback support to be uncovered, and they are addressed by patches 12/19 to 14/19. Patch 15/19 is an unrelated drive-by fix. Patches 16/19 to 18/19 then perform refactoring of the DU driver, to finally add writeback support in patch 19/19. The writeback pixel format is restricted to RGB, due to the VSP1 outputting RGB to the display and lacking a separate colour space conversion unit for writeback. The resolution can be freely picked by will result in cropping or composing, not scaling. Writeback requests are queued to the hardware on page flip (atomic flush), and complete at the next vblank. This means that a queued writeback buffer will not be processed until the next page flip, but once it starts being written to by the VSP, it will complete at the next vblank regardless of whether another page flip occurs at that time. The code is based on a merge of the media master branch, the drm-next branch and the R-Car DT next branch. For convenience patches can be found at git://linuxtv.org/pinchartl/media.git v4l2/vsp1/writeback Kieran Bingham (1): Revert "[media] v4l: vsp1: Supply frames to the DU continuously" Laurent Pinchart (18): media: vsp1: wpf: Fix partition configuration for display pipelines media: vsp1: Replace leftover occurrence of fragment with body media: vsp1: Fix addresses of display-related registers for VSP-DL media: vsp1: Refactor vsp1_video_complete_buffer() for later reuse media: vsp1: Replace the display list internal flag with a flags field media: vsp1: dl: Support one-shot entries in the display list media: vsp1: wpf: Add writeback support media: vsp1: drm: Split RPF format setting to separate function media: vsp1: drm: Extend frame completion API to the DU driver media: vsp1: drm: Implement writeback support drm: writeback: Cleanup job ownership handling when queuing job drm: writeback: Fix leak of writeback job drm: writeback: Add job prepare and cleanup operations drm/msm: Remove prototypes for non-existing functions drm: rcar-du: Fix rcar_du_crtc structure documentation drm: rcar-du: Store V4L2 fourcc in rcar_du_format_info structure drm: rcar-du: vsp: Extract framebuffer (un)mapping to separate functions drm: rcar-du: Add writeback support for R-Car Gen3 drivers/gpu/drm/arm/malidp_mw.c | 3 +- drivers/gpu/drm/drm_atomic_helper.c | 11 ++ drivers/gpu/drm/drm_atomic_state_helper.c | 4 + drivers/gpu/drm/drm_atomic_uapi.c | 31 +-- drivers/gpu/drm/drm_writeback.c | 71 ++++++- drivers/gpu/drm/msm/msm_drv.h | 2 - drivers/gpu/drm/rcar-du/Kconfig | 4 + drivers/gpu/drm/rcar-du/Makefile | 3 +- drivers/gpu/drm/rcar-du/rcar_du_crtc.h | 9 +- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 37 ++++ drivers/gpu/drm/rcar-du/rcar_du_kms.h | 1 + drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 121 ++++++------ drivers/gpu/drm/rcar-du/rcar_du_vsp.h | 17 ++ drivers/gpu/drm/rcar-du/rcar_du_writeback.c | 203 ++++++++++++++++++++ drivers/gpu/drm/rcar-du/rcar_du_writeback.h | 39 ++++ drivers/gpu/drm/vc4/vc4_txp.c | 2 +- drivers/media/platform/vsp1/vsp1_dl.c | 127 ++++++++++-- drivers/media/platform/vsp1/vsp1_dl.h | 8 +- drivers/media/platform/vsp1/vsp1_drm.c | 92 ++++++--- drivers/media/platform/vsp1/vsp1_drm.h | 2 +- drivers/media/platform/vsp1/vsp1_drv.c | 15 ++ drivers/media/platform/vsp1/vsp1_pipe.c | 5 + drivers/media/platform/vsp1/vsp1_pipe.h | 1 + drivers/media/platform/vsp1/vsp1_regs.h | 6 +- drivers/media/platform/vsp1/vsp1_rwpf.h | 2 + drivers/media/platform/vsp1/vsp1_video.c | 49 +++-- drivers/media/platform/vsp1/vsp1_wpf.c | 68 +++++-- include/drm/drm_modeset_helper_vtables.h | 7 + include/drm/drm_writeback.h | 30 ++- include/media/vsp1.h | 19 +- 30 files changed, 790 insertions(+), 199 deletions(-) create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_writeback.c create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_writeback.h