Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7097689ybi; Thu, 13 Jun 2019 09:30:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFpPvhhtvGY5uRk3DGeFpT08K6+Cgzvn50n4GEmSWA5JhTShAUx9B9CBYO+FeYG4soVncx X-Received: by 2002:a65:56c5:: with SMTP id w5mr31038248pgs.434.1560443430507; Thu, 13 Jun 2019 09:30:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560443430; cv=none; d=google.com; s=arc-20160816; b=K3rKM/TRAZQ900fZH4qeHCtYAiuh1DGoT09mJB+lwDquOYiRUNrUTDllqEWeJyBeqG Bsr0FfxQ3hzpC8X1X9GcEB4SXfKdjKRVl+39x0xAbG18+9CF0HSfd+v1c2feZ9wSymN0 giWv4dIq+AF7orRkh8NmDwVxI6ETJKjAxHIiY2JI9BtoDMNGBEmJ1HOx4BPyRw7zIIi/ G0PXl5Ef3wxNtBwKAMdihnzMZmwxHItymYrx4n6xRIbAmf37E4T4VWreWra4eJ3XiQmm TR/s51G3fZ9goX6CWnFipVGCSORiHDBSFzea7Tn9c5cyXk+S+JzWNLKJTPbyiUOgB/RT inDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=tqR7KUGFfumAcuphrria7+/RoVcJHKJJ08SA/IFspl4=; b=BDBuaZnJjZ3UchIyFUCXtxKxhIjawJqyWHNctF3cVBbh4LoBimMUAQQL32HEDvDiuZ 0hNb3A2xDrPVCX+zfLslreFkSOuCN69nyNW/txLmojJHkfswt1XAIRmA+j3qxf80jGt6 9owjYUS/JqOmjlgIZgK1T5wNypC0ygGxf2rbZsqoOKIg6W4HhWZ57yU9efqAbQLH97mx +3Gf0ZooVCggoBnub8J/yYlTA/YE8gtCXDhDn5Ox/7wr/mdKHABnwzoZQ6jdAPjx+Qhm dNdPvOadtOPs9c8fdlbp91D+cT+zfsMyY1iBHp43DeL87fPyl4DiHrRuBwbusHF0nV6b Mkiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3si50656plo.159.2019.06.13.09.30.15; Thu, 13 Jun 2019 09:30:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392513AbfFMQ3b (ORCPT + 99 others); Thu, 13 Jun 2019 12:29:31 -0400 Received: from foss.arm.com ([217.140.110.172]:45746 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730925AbfFMQ33 (ORCPT ); Thu, 13 Jun 2019 12:29:29 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C2B293EF; Thu, 13 Jun 2019 09:29:28 -0700 (PDT) Received: from e110455-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7ED963F694; Thu, 13 Jun 2019 09:29:28 -0700 (PDT) Received: by e110455-lin.cambridge.arm.com (Postfix, from userid 1000) id 4867E682577; Thu, 13 Jun 2019 17:29:27 +0100 (BST) Date: Thu, 13 Jun 2019 17:29:27 +0100 From: Liviu Dudau To: Ayan Halder Cc: "james qian wang (Arm Technology China)" , Brian Starkey , "airlied@linux.ie" , "daniel@ffwll.ch" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , nd Subject: Re: [PATCH v2] drm/komeda: Make Komeda interrupts shareable Message-ID: <20190613162927.GS4173@e110455-lin.cambridge.arm.com> References: <20190613151257.32297-1-ayan.halder@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190613151257.32297-1-ayan.halder@arm.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 13, 2019 at 04:13:10PM +0100, Ayan Halder wrote: > Komeda interrupts may be shared with other hardware blocks. > One needs to use devm_request_irq() with IRQF_SHARED to create a shared > interrupt handler. > As a result of not using drm_irq_install() api, one needs to set > "(struct drm_device *)->irq_enabled = true/false" to enable/disable > vblank interrupts. > > Changes from v1:- > 1. Squashed the following two patches into one (as the second patch is a > consequence of the first one):- > drm/komeda: Avoid using DRIVER_IRQ_SHARED > drm/komeda: Enable/Disable vblank interrupts > 2. Fixed the commit message (as pointed by Daniel Vetter) > 3. Removed calls to 'drm_irq_uninstall()' as we are no longer using > drm_irq_install() > 4. Removed the struct member 'komeda_kms_driver.irq_handler' as it is not > used anywhere. > > Signed-off-by: Ayan Kumar halder Reviewed-by: Liviu Dudau > --- > drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c > index 86f6542afb40..bb2bffc0e022 100644 > --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c > +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c > @@ -58,7 +58,6 @@ static struct drm_driver komeda_kms_driver = { > .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC | > DRIVER_PRIME | DRIVER_HAVE_IRQ, > .lastclose = drm_fb_helper_lastclose, > - .irq_handler = komeda_kms_irq_handler, > .gem_free_object_unlocked = drm_gem_cma_free_object, > .gem_vm_ops = &drm_gem_cma_vm_ops, > .dumb_create = komeda_gem_cma_dumb_create, > @@ -194,23 +193,26 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev) > > drm_mode_config_reset(drm); > > - err = drm_irq_install(drm, mdev->irq); > + err = devm_request_irq(drm->dev, mdev->irq, > + komeda_kms_irq_handler, IRQF_SHARED, > + drm->driver->name, drm); > if (err) > goto cleanup_mode_config; > > err = mdev->funcs->enable_irq(mdev); > if (err) > - goto uninstall_irq; > + goto cleanup_mode_config; > + > + drm->irq_enabled = true; > > err = drm_dev_register(drm, 0); > if (err) > - goto uninstall_irq; > + goto cleanup_mode_config; > > return kms; > > -uninstall_irq: > - drm_irq_uninstall(drm); > cleanup_mode_config: > + drm->irq_enabled = false; > drm_mode_config_cleanup(drm); > komeda_kms_cleanup_private_objs(kms); > free_kms: > @@ -223,9 +225,9 @@ void komeda_kms_detach(struct komeda_kms_dev *kms) > struct drm_device *drm = &kms->base; > struct komeda_dev *mdev = drm->dev_private; > > + drm->irq_enabled = false; > mdev->funcs->disable_irq(mdev); > drm_dev_unregister(drm); > - drm_irq_uninstall(drm); > component_unbind_all(mdev->dev, drm); > komeda_kms_cleanup_private_objs(kms); > drm_mode_config_cleanup(drm); > -- > 2.21.0 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯