From: Thomas Zimmermann <tzimmermann@suse.de>
To: Rob Clark <robdclark@gmail.com>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: "Daniel Vetter" <daniel@ffwll.ch>,
"David Airlie" <airlied@linux.ie>,
"Alexander Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Liviu Dudau" <liviu.dudau@arm.com>,
"Brian Starkey" <brian.starkey@arm.com>,
"Sam Ravnborg" <sam@ravnborg.org>,
"Boris Brezillon" <bbrezillon@kernel.org>,
"Nicolas Ferre" <nicolas.ferre@microchip.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Stefan Agner" <stefan@agner.ch>,
alison.wang@nxp.com,
"Patrik Jakobsson" <patrik.r.jakobsson@gmail.com>,
anitha.chrisanthus@intel.com, edmund.j.dea@intel.com,
"Sean Paul" <sean@poorly.run>, "Shawn Guo" <shawnguo@kernel.org>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Sascha Hauer" <kernel@pengutronix.de>,
jyri.sarha@iki.fi, tomba@kernel.org, Dan.Sneddon@microchip.com,
tomi.valkeinen@ideasonboard.com,
"amd-gfx list" <amd-gfx@lists.freedesktop.org>,
dri-devel <dri-devel@lists.freedesktop.org>,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>,
linux-arm-msm <linux-arm-msm@vger.kernel.org>,
freedreno <freedreno@lists.freedesktop.org>
Subject: Re: [PATCH v2 07/14] drm/msm: Convert to Linux IRQ interfaces
Date: Sat, 7 Aug 2021 20:40:39 +0200 [thread overview]
Message-ID: <9c6471b2-cd6b-d5b9-0c93-1f3e498233ee@suse.de> (raw)
In-Reply-To: <CAF6AEGu-Vj_3ex1Auae_SQvFkwgaXVokqhL_nsFzXOKP0p06SQ@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 7577 bytes --]
Hi
Am 07.08.21 um 19:08 schrieb Rob Clark:
> On Tue, Aug 3, 2021 at 2:37 AM Dmitry Baryshkov
> <dmitry.baryshkov@linaro.org> wrote:
>>
>> On 03/08/2021 12:06, Thomas Zimmermann wrote:
>>> Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's
>>> IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers
>>> don't benefit from using it.
>>>
>>> DRM IRQ callbacks are now being called directly or inlined.
>>>
>>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>>
>> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>
>> Rob should probably also give his blessing on this patch though.
>>
>
> I've pushed this to msm-next-staging, but if Thomas would prefer to
> merge the series together then I can drop it (in which case a-b for
> this patch)
Yes, please. I'd prefer to merge the whole patchset at once through
drm-misc-next.
Best regards
Thomas
>
> BR,
> -R
>
>>> ---
>>> drivers/gpu/drm/msm/msm_drv.c | 113 ++++++++++++++++++++--------------
>>> drivers/gpu/drm/msm/msm_kms.h | 2 +-
>>> 2 files changed, 69 insertions(+), 46 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
>>> index 1594ae39d54f..a332b09a5a11 100644
>>> --- a/drivers/gpu/drm/msm/msm_drv.c
>>> +++ b/drivers/gpu/drm/msm/msm_drv.c
>>> @@ -14,7 +14,6 @@
>>> #include <drm/drm_drv.h>
>>> #include <drm/drm_file.h>
>>> #include <drm/drm_ioctl.h>
>>> -#include <drm/drm_irq.h>
>>> #include <drm/drm_prime.h>
>>> #include <drm/drm_of.h>
>>> #include <drm/drm_vblank.h>
>>> @@ -201,6 +200,71 @@ void msm_rmw(void __iomem *addr, u32 mask, u32 or)
>>> msm_writel(val | or, addr);
>>> }
>>>
>>> +static irqreturn_t msm_irq(int irq, void *arg)
>>> +{
>>> + struct drm_device *dev = arg;
>>> + struct msm_drm_private *priv = dev->dev_private;
>>> + struct msm_kms *kms = priv->kms;
>>> +
>>> + BUG_ON(!kms);
>>> +
>>> + return kms->funcs->irq(kms);
>>> +}
>>> +
>>> +static void msm_irq_preinstall(struct drm_device *dev)
>>> +{
>>> + struct msm_drm_private *priv = dev->dev_private;
>>> + struct msm_kms *kms = priv->kms;
>>> +
>>> + BUG_ON(!kms);
>>> +
>>> + kms->funcs->irq_preinstall(kms);
>>> +}
>>> +
>>> +static int msm_irq_postinstall(struct drm_device *dev)
>>> +{
>>> + struct msm_drm_private *priv = dev->dev_private;
>>> + struct msm_kms *kms = priv->kms;
>>> +
>>> + BUG_ON(!kms);
>>> +
>>> + if (kms->funcs->irq_postinstall)
>>> + return kms->funcs->irq_postinstall(kms);
>>> +
>>> + return 0;
>>> +}
>>> +
>>> +static int msm_irq_install(struct drm_device *dev, unsigned int irq)
>>> +{
>>> + int ret;
>>> +
>>> + if (irq == IRQ_NOTCONNECTED)
>>> + return -ENOTCONN;
>>> +
>>> + msm_irq_preinstall(dev);
>>> +
>>> + ret = request_irq(irq, msm_irq, 0, dev->driver->name, dev);
>>> + if (ret)
>>> + return ret;
>>> +
>>> + ret = msm_irq_postinstall(dev);
>>> + if (ret) {
>>> + free_irq(irq, dev);
>>> + return ret;
>>> + }
>>> +
>>> + return 0;
>>> +}
>>> +
>>> +static void msm_irq_uninstall(struct drm_device *dev)
>>> +{
>>> + struct msm_drm_private *priv = dev->dev_private;
>>> + struct msm_kms *kms = priv->kms;
>>> +
>>> + kms->funcs->irq_uninstall(kms);
>>> + free_irq(kms->irq, dev);
>>> +}
>>> +
>>> struct msm_vblank_work {
>>> struct work_struct work;
>>> int crtc_id;
>>> @@ -265,7 +329,7 @@ static int msm_drm_uninit(struct device *dev)
>>> }
>>>
>>> /* We must cancel and cleanup any pending vblank enable/disable
>>> - * work before drm_irq_uninstall() to avoid work re-enabling an
>>> + * work before msm_irq_uninstall() to avoid work re-enabling an
>>> * irq after uninstall has disabled it.
>>> */
>>>
>>> @@ -294,7 +358,7 @@ static int msm_drm_uninit(struct device *dev)
>>> drm_mode_config_cleanup(ddev);
>>>
>>> pm_runtime_get_sync(dev);
>>> - drm_irq_uninstall(ddev);
>>> + msm_irq_uninstall(ddev);
>>> pm_runtime_put_sync(dev);
>>>
>>> if (kms && kms->funcs)
>>> @@ -553,7 +617,7 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
>>>
>>> if (kms) {
>>> pm_runtime_get_sync(dev);
>>> - ret = drm_irq_install(ddev, kms->irq);
>>> + ret = msm_irq_install(ddev, kms->irq);
>>> pm_runtime_put_sync(dev);
>>> if (ret < 0) {
>>> DRM_DEV_ERROR(dev, "failed to install IRQ handler\n");
>>> @@ -662,43 +726,6 @@ static void msm_postclose(struct drm_device *dev, struct drm_file *file)
>>> context_close(ctx);
>>> }
>>>
>>> -static irqreturn_t msm_irq(int irq, void *arg)
>>> -{
>>> - struct drm_device *dev = arg;
>>> - struct msm_drm_private *priv = dev->dev_private;
>>> - struct msm_kms *kms = priv->kms;
>>> - BUG_ON(!kms);
>>> - return kms->funcs->irq(kms);
>>> -}
>>> -
>>> -static void msm_irq_preinstall(struct drm_device *dev)
>>> -{
>>> - struct msm_drm_private *priv = dev->dev_private;
>>> - struct msm_kms *kms = priv->kms;
>>> - BUG_ON(!kms);
>>> - kms->funcs->irq_preinstall(kms);
>>> -}
>>> -
>>> -static int msm_irq_postinstall(struct drm_device *dev)
>>> -{
>>> - struct msm_drm_private *priv = dev->dev_private;
>>> - struct msm_kms *kms = priv->kms;
>>> - BUG_ON(!kms);
>>> -
>>> - if (kms->funcs->irq_postinstall)
>>> - return kms->funcs->irq_postinstall(kms);
>>> -
>>> - return 0;
>>> -}
>>> -
>>> -static void msm_irq_uninstall(struct drm_device *dev)
>>> -{
>>> - struct msm_drm_private *priv = dev->dev_private;
>>> - struct msm_kms *kms = priv->kms;
>>> - BUG_ON(!kms);
>>> - kms->funcs->irq_uninstall(kms);
>>> -}
>>> -
>>> int msm_crtc_enable_vblank(struct drm_crtc *crtc)
>>> {
>>> struct drm_device *dev = crtc->dev;
>>> @@ -1051,10 +1078,6 @@ static const struct drm_driver msm_driver = {
>>> .open = msm_open,
>>> .postclose = msm_postclose,
>>> .lastclose = drm_fb_helper_lastclose,
>>> - .irq_handler = msm_irq,
>>> - .irq_preinstall = msm_irq_preinstall,
>>> - .irq_postinstall = msm_irq_postinstall,
>>> - .irq_uninstall = msm_irq_uninstall,
>>> .dumb_create = msm_gem_dumb_create,
>>> .dumb_map_offset = msm_gem_dumb_map_offset,
>>> .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
>>> diff --git a/drivers/gpu/drm/msm/msm_kms.h b/drivers/gpu/drm/msm/msm_kms.h
>>> index 086a2d59b8c8..9de7c42e1071 100644
>>> --- a/drivers/gpu/drm/msm/msm_kms.h
>>> +++ b/drivers/gpu/drm/msm/msm_kms.h
>>> @@ -150,7 +150,7 @@ struct msm_kms {
>>> const struct msm_kms_funcs *funcs;
>>> struct drm_device *dev;
>>>
>>> - /* irq number to be passed on to drm_irq_install */
>>> + /* irq number to be passed on to msm_irq_install */
>>> int irq;
>>>
>>> /* mapper-id used to request GEM buffer mapped for scanout: */
>>>
>>
>>
>> --
>> With best wishes
>> Dmitry
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
next prev parent reply other threads:[~2021-08-07 18:40 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-03 9:06 [PATCH v2 00/14] drm: Make DRM's IRQ helpers legacy Thomas Zimmermann
2021-08-03 9:06 ` [PATCH v2 01/14] drm/amdgpu: Convert to Linux IRQ interfaces Thomas Zimmermann
2021-08-03 9:06 ` [PATCH v2 02/14] drm/arm/hdlcd: " Thomas Zimmermann
2021-08-20 16:05 ` Liviu Dudau
2021-08-03 9:06 ` [PATCH v2 03/14] drm/atmel-hlcdc: " Thomas Zimmermann
2021-08-03 9:06 ` [PATCH v2 04/14] drm/fsl-dcu: " Thomas Zimmermann
2021-08-03 9:06 ` [PATCH v2 05/14] drm/gma500: " Thomas Zimmermann
2021-08-03 9:06 ` [PATCH v2 06/14] drm/kmb: " Thomas Zimmermann
2021-08-03 9:06 ` [PATCH v2 07/14] drm/msm: " Thomas Zimmermann
2021-08-03 9:37 ` Dmitry Baryshkov
2021-08-03 15:04 ` Rob Clark
2021-08-07 17:08 ` Rob Clark
2021-08-07 18:40 ` Thomas Zimmermann [this message]
2021-08-07 18:50 ` Rob Clark
2021-08-03 17:20 ` [Freedreno] " abhinavk
2021-08-03 9:06 ` [PATCH v2 08/14] drm/mxsfb: " Thomas Zimmermann
2021-08-03 9:06 ` [PATCH v2 09/14] drm/radeon: " Thomas Zimmermann
2021-08-03 9:07 ` [PATCH v2 10/14] drm/tidss: " Thomas Zimmermann
2021-08-03 9:07 ` [PATCH v2 11/14] drm/tilcdc: " Thomas Zimmermann
[not found] ` <YQlZ+EQVbO9N3Mla@ravnborg.org>
2021-08-04 18:30 ` Thomas Zimmermann
2021-08-03 9:07 ` [PATCH v2 12/14] drm/vc4: " Thomas Zimmermann
2021-08-03 9:07 ` [PATCH v2 13/14] drm: Remove unused devm_drm_irq_install() Thomas Zimmermann
2021-08-03 9:07 ` [PATCH v2 14/14] drm: IRQ midlayer is now legacy Thomas Zimmermann
[not found] ` <YQlbFjbrnyeWv7QP@ravnborg.org>
2021-08-03 18:36 ` [PATCH v2 00/14] drm: Make DRM's IRQ helpers legacy Chrisanthus, Anitha
2021-08-04 7:10 ` Thomas Zimmermann
2021-08-05 23:59 ` Chrisanthus, Anitha
2021-08-07 6:51 ` Thomas Zimmermann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9c6471b2-cd6b-d5b9-0c93-1f3e498233ee@suse.de \
--to=tzimmermann@suse.de \
--cc=Dan.Sneddon@microchip.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=alison.wang@nxp.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=anitha.chrisanthus@intel.com \
--cc=bbrezillon@kernel.org \
--cc=brian.starkey@arm.com \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=edmund.j.dea@intel.com \
--cc=freedreno@lists.freedesktop.org \
--cc=jyri.sarha@iki.fi \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=patrik.r.jakobsson@gmail.com \
--cc=robdclark@gmail.com \
--cc=s.hauer@pengutronix.de \
--cc=sam@ravnborg.org \
--cc=sean@poorly.run \
--cc=shawnguo@kernel.org \
--cc=stefan@agner.ch \
--cc=tomba@kernel.org \
--cc=tomi.valkeinen@ideasonboard.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).