From patchwork Fri May 29 17:56:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Noralf_Tr=C3=B8nnes?= X-Patchwork-Id: 11579463 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0614E912 for ; Fri, 29 May 2020 17:57:12 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E2AE92073B for ; Fri, 29 May 2020 17:57:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E2AE92073B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=tronnes.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8714E6E954; Fri, 29 May 2020 17:57:07 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from asav22.altibox.net (asav22.altibox.net [109.247.116.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id E94996E954 for ; Fri, 29 May 2020 17:57:05 +0000 (UTC) Received: from localhost.localdomain (unknown [81.166.168.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: noralf.tronnes@ebnett.no) by asav22.altibox.net (Postfix) with ESMTPSA id B6E3E200A8; Fri, 29 May 2020 19:57:02 +0200 (CEST) From: =?utf-8?q?Noralf_Tr=C3=B8nnes?= To: dri-devel@lists.freedesktop.org, balbi@kernel.org Subject: [PATCH v3 0/6] Generic USB Display driver Date: Fri, 29 May 2020 19:56:37 +0200 Message-Id: <20200529175643.46094-1-noralf@tronnes.org> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=LvK8NEVc c=1 sm=1 tr=0 a=OYZzhG0JTxDrWp/F2OJbnw==:117 a=OYZzhG0JTxDrWp/F2OJbnw==:17 a=IkcTkHD0fZMA:10 a=M51BFTxLslgA:10 a=gAmX6pxEAAAA:20 a=VwQbUJbxAAAA:8 a=DMtxpE9c-qso5yFzpc8A:9 a=QEXdDO2ut3YA:10 a=AjGcO6oz07-iQ99wixmX:22 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-usb@vger.kernel.org, sam@ravnborg.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi, A while back I had the idea to turn a Raspberry Pi Zero into a $5 USB to HDMI/SDTV/DSI/DPI display adapter. This series adds a USB host driver and a device/gadget driver to achieve that. The reason for calling it 'Generic' is so anyone can make a USB display/adapter against this driver, all that's needed is to add a USB vid:pid. I have done a microcontroller implementation hack just to see how that would work out[1] (which unconvered a couple of bugs in the host driver). The contents of the previous cover letter has been moved to the wiki[2] since it was getting rather long. I've made an image[3] with the gadget side set up for the Raspberry Pi for easy testing. Patch 4 is the only one needed for the host side. Merge plan I'm hoping to apply the remaining drm_client patches in time for 5.9. With that in place it's much easier to apply the patch for the USB subsystem the following merge window (5.10). Doing both in the same cycle is possible ofc, but due to the high rate of change in DRM this _can_ turn out to be tricky. There's no hurry to get the gadget side merged since I will provide images for the Raspberry Pi. The host driver I hope to apply in time for 5.9. Reviews and testing are very much welcome! Changes since version 2: - Use donated Openmoko USB pid: 1d50:614d - Use direct compression from framebuffer when pitch matches, not only on full frames, so split updates can benefit - Use __le16 in struct gud_drm_req_get_connector_status - Set edid property when the device only provides edid - Clear compression fields in struct gud_drm_req_set_buffer - Fix protocol version negotiation - Remove mode->vrefresh, it's calculated - drm_client_init_from_id(): remove locking - Applied reviewed patches, thanks Sam. Dependency: - backlight: Add backlight_device_get_by_name()[4] Noralf. [1] https://github.com/notro/gud/tree/master/STM32F769I-DISCO [2] https://github.com/notro/gud/wiki [3] https://github.com/notro/gud/wiki/rpi-image [4] https://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git/commit/?h=for-backlight-next&id=479da1f538a2f3547e15f9d5922c611b69ec2fbc Noralf Trønnes (6): drm/client: Add drm_client_init_from_id() drm/client: Add drm_client_modeset_disable() drm/client: Add a way to set modeset, properties and rotation drm: Add Generic USB Display driver drm/gud: Add functionality for the USB gadget side usb: gadget: function: Add Generic USB Display support .../ABI/testing/configfs-usb-gadget-gud_drm | 10 + MAINTAINERS | 10 + drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/drm_client.c | 44 +- drivers/gpu/drm/drm_client_modeset.c | 157 +++ drivers/gpu/drm/gud/Kconfig | 20 + drivers/gpu/drm/gud/Makefile | 5 + drivers/gpu/drm/gud/gud_drm_connector.c | 726 ++++++++++ drivers/gpu/drm/gud/gud_drm_drv.c | 648 +++++++++ drivers/gpu/drm/gud/gud_drm_gadget.c | 1167 +++++++++++++++++ drivers/gpu/drm/gud/gud_drm_internal.h | 65 + drivers/gpu/drm/gud/gud_drm_pipe.c | 426 ++++++ drivers/usb/gadget/Kconfig | 12 + drivers/usb/gadget/function/Makefile | 2 + drivers/usb/gadget/function/f_gud_drm.c | 678 ++++++++++ include/drm/drm_client.h | 43 +- include/drm/gud_drm.h | 374 ++++++ 18 files changed, 4387 insertions(+), 3 deletions(-) create mode 100644 Documentation/ABI/testing/configfs-usb-gadget-gud_drm create mode 100644 drivers/gpu/drm/gud/Kconfig create mode 100644 drivers/gpu/drm/gud/Makefile create mode 100644 drivers/gpu/drm/gud/gud_drm_connector.c create mode 100644 drivers/gpu/drm/gud/gud_drm_drv.c create mode 100644 drivers/gpu/drm/gud/gud_drm_gadget.c create mode 100644 drivers/gpu/drm/gud/gud_drm_internal.h create mode 100644 drivers/gpu/drm/gud/gud_drm_pipe.c create mode 100644 drivers/usb/gadget/function/f_gud_drm.c create mode 100644 include/drm/gud_drm.h Tested-by: Lubomir Rintel