From patchwork Tue Aug 3 09:06:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 12415671 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FEF3C4338F for ; Tue, 3 Aug 2021 09:09:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 3DC6660C3F for ; Tue, 3 Aug 2021 09:09:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3DC6660C3F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=sRXOkB2UFMmnu2UDbyANpBsQNFwx2SdwqyZYyCRrHpc=; b=e3RFvEELpaoOeu 1gCourmgQxIqciDKIMT0t94K72che6tnhA9DHi7y1CfGPJiDigeZ/YkpkqbwAHX9QWBaY+kjkSFpK r9+JPAjgsVPBJ/LrQD3kQ9xVws+ODmpWg5k1NAa+e4wBzZnqFw7ek6+LuNUvqLRh9lgVZE1QbAAzR uGX0VTXvla/Pd6qVxan07jH4pAi6M07cQqLAAZoofzq1Ab3Je5C4qyJTORT78MSJMMmO9ris3tFB6 YIWSPyXmv6sMX3xofzWRwVsnmGTiezc2ninFh9eCKjWFegY/8PfwgOcGFptSHN/7OdqLvfQ2/C8K4 3EXyQHa8jsLNs/1M0Q7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAqOO-001gtl-Mx; Tue, 03 Aug 2021 09:07:21 +0000 Received: from smtp-out2.suse.de ([195.135.220.29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAqOE-001goi-SS for linux-arm-kernel@lists.infradead.org; Tue, 03 Aug 2021 09:07:12 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6CB62200AD; Tue, 3 Aug 2021 09:07:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1627981627; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q3+6KEUPrv4P0GKwP+A7/qqpGBMH/Xg9bYVCDAlx7rY=; b=lj2EINnNTDtFgnz3ekPIREpOQMBlLc+hGKbR6/AjY5pgs3q2xRJgTGChwBXApw/1jV4lTj 6VX4CJ+FgVeLzBcWDLc98q0C8jc8RrhcThZAQVdMhdFICgjHEVSBFrH1KaB7uqKbWXHRy4 9PObbWNX6TowjohPMRKQBOiJ1VB/JII= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1627981627; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q3+6KEUPrv4P0GKwP+A7/qqpGBMH/Xg9bYVCDAlx7rY=; b=DIlrjiYO3akc03nF/YB89hmnQ148+n+niJhuf4YsHNkfflBTxVLMjTFEjx8sqNaCKvM/fq Af3/15oWWiPcciAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A096B13CC4; Tue, 3 Aug 2021 09:07:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id +sX6JToHCWFVJQAAMHmgww (envelope-from ); Tue, 03 Aug 2021 09:07:06 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@linux.ie, alexander.deucher@amd.com, christian.koenig@amd.com, liviu.dudau@arm.com, brian.starkey@arm.com, sam@ravnborg.org, bbrezillon@kernel.org, nicolas.ferre@microchip.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, stefan@agner.ch, alison.wang@nxp.com, patrik.r.jakobsson@gmail.com, anitha.chrisanthus@intel.com, robdclark@gmail.com, edmund.j.dea@intel.com, sean@poorly.run, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, jyri.sarha@iki.fi, tomba@kernel.org, Dan.Sneddon@microchip.com, tomi.valkeinen@ideasonboard.com Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Thomas Zimmermann Subject: [PATCH v2 00/14] drm: Make DRM's IRQ helpers legacy Date: Tue, 3 Aug 2021 11:06:50 +0200 Message-Id: <20210803090704.32152-1-tzimmermann@suse.de> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210803_020711_132197_497F69BC X-CRM114-Status: GOOD ( 14.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DRM's IRQ helpers are only helpful for old, non-KMS drivers. Move the code behind CONFIG_DRM_LEGACY. Convert KMS drivers to Linux IRQ interfaces. DRM provides IRQ helpers for setting up, receiving and removing IRQ handlers. It's an abstraction over plain Linux functions. The code is mid-layerish with several callbacks to hook into the rsp drivers. Old UMS driver have their interrupts enabled via ioctl, so these abstractions makes some sense. Modern KMS manage all their interrupts internally. Using the DRM helpers adds indirection without benefits. Most KMS drivers already use Linux IRQ functions instead of DRM's abstraction layer. Patches 1 to 12 convert the remaining ones. The patches also resolve a bug for devices without assigned interrupt number. DRM helpers don't test for IRQ_NOTCONNECTED, so drivers do not detect if the device has no interrupt assigned. Patch 13 removes an unused function. Patch 14 moves the DRM IRQ helpers behind CONFIG_DRM_LEGACY. Only the old non-KMS drivers still use the functionality. v2: * drop IRQ_NOTCONNECTED test from atmel-hlcdc (Sam) * use devm_request_irq() in atmel-hlcdc (Sam) * unify variable names in arm/hlcdc (Sam) Thomas Zimmermann (14): drm/amdgpu: Convert to Linux IRQ interfaces drm/arm/hdlcd: Convert to Linux IRQ interfaces drm/atmel-hlcdc: Convert to Linux IRQ interfaces drm/fsl-dcu: Convert to Linux IRQ interfaces drm/gma500: Convert to Linux IRQ interfaces drm/kmb: Convert to Linux IRQ interfaces drm/msm: Convert to Linux IRQ interfaces drm/mxsfb: Convert to Linux IRQ interfaces drm/radeon: Convert to Linux IRQ interfaces drm/tidss: Convert to Linux IRQ interfaces drm/tilcdc: Convert to Linux IRQ interfaces drm/vc4: Convert to Linux IRQ interfaces drm: Remove unused devm_drm_irq_install() drm: IRQ midlayer is now legacy drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 21 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_irq.h | 2 +- drivers/gpu/drm/arm/hdlcd_drv.c | 174 ++++++++++--------- drivers/gpu/drm/arm/hdlcd_drv.h | 1 + drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 80 +++++---- drivers/gpu/drm/drm_irq.c | 95 +--------- drivers/gpu/drm/drm_legacy_misc.c | 3 +- drivers/gpu/drm/drm_vblank.c | 8 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 78 +++++---- drivers/gpu/drm/gma500/power.c | 1 + drivers/gpu/drm/gma500/psb_drv.c | 8 +- drivers/gpu/drm/gma500/psb_drv.h | 5 - drivers/gpu/drm/gma500/psb_irq.c | 26 ++- drivers/gpu/drm/gma500/psb_irq.h | 4 +- drivers/gpu/drm/i810/i810_dma.c | 3 +- drivers/gpu/drm/kmb/kmb_drv.c | 26 ++- drivers/gpu/drm/mga/mga_dma.c | 2 +- drivers/gpu/drm/mga/mga_drv.h | 1 - drivers/gpu/drm/msm/msm_drv.c | 113 +++++++----- drivers/gpu/drm/msm/msm_kms.h | 2 +- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 81 +++++---- drivers/gpu/drm/mxsfb/mxsfb_drv.h | 2 + drivers/gpu/drm/r128/r128_cce.c | 3 +- drivers/gpu/drm/radeon/radeon_drv.c | 4 - drivers/gpu/drm/radeon/radeon_irq_kms.c | 44 ++++- drivers/gpu/drm/radeon/radeon_kms.h | 4 - drivers/gpu/drm/tidss/tidss_drv.c | 15 +- drivers/gpu/drm/tidss/tidss_drv.h | 2 + drivers/gpu/drm/tidss/tidss_irq.c | 27 ++- drivers/gpu/drm/tidss/tidss_irq.h | 4 +- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 51 ++++-- drivers/gpu/drm/tilcdc/tilcdc_drv.h | 3 + drivers/gpu/drm/vc4/vc4_drv.c | 4 - drivers/gpu/drm/vc4/vc4_drv.h | 8 +- drivers/gpu/drm/vc4/vc4_irq.c | 48 +++-- drivers/gpu/drm/vc4/vc4_v3d.c | 17 +- drivers/gpu/drm/via/via_mm.c | 3 +- include/drm/drm_device.h | 18 +- include/drm/drm_drv.h | 44 +---- include/drm/drm_irq.h | 32 ---- include/drm/drm_legacy.h | 3 + 42 files changed, 567 insertions(+), 504 deletions(-) delete mode 100644 include/drm/drm_irq.h base-commit: c9d6903562aa335593daf44b4a1edeaef6bf9206 prerequisite-patch-id: c2b2f08f0eccc9f5df0c0da49fa1d36267deb11d prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24 prerequisite-patch-id: c3f32630e1d2de2eb74316c930578847d4b83fb3 prerequisite-patch-id: b32ca0abfc255601f8a5052d3b88be09527dabcb prerequisite-patch-id: 22a3f264168bacb04ef65306b32b86be8dc982ef prerequisite-patch-id: 095a0acb604eb02956e1a7e53da41371c64eb813 prerequisite-patch-id: 7a2417d5d8d453204bd94aa873e3faae812f26fc Acked-by: Sam Ravnborg --- 2.32.0