[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <29e7eeb5-de7b-89bd-b710-38c00e3c7b54@huawei.com>
Date: Tue, 3 Nov 2020 16:57:45 +0800
From: "tiantao (H)" <tiantao6@...wei.com>
To: Thomas Zimmermann <tzimmermann@...e.de>,
Tian Tao <tiantao6@...ilicon.com>,
<maarten.lankhorst@...ux.intel.com>, <mripard@...nel.org>,
<airlied@...ux.ie>, <daniel@...ll.ch>,
<dri-devel@...ts.freedesktop.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] drm: Add the new api to install irq
在 2020/11/3 15:56, Thomas Zimmermann 写道:
> Hi
>
> Thanks, the code looks good already. There just are a few nits below.
>
Thanks for the help with the review code.
Add the new api devm_drm_irq_install and himbc use the new interface as
one patch or two?
> Am 03.11.20 um 03:10 schrieb Tian Tao:
>> Add new api devm_drm_irq_install() to register interrupts,
>> no need to call drm_irq_uninstall() when the drm module is removed.
>>
>> v2:
>> fixed the wrong parameter.
>>
>> Signed-off-by: Tian Tao <tiantao6@...ilicon.com>
>> ---
>> drivers/gpu/drm/drm_drv.c | 23 +++++++++++++++++++++++
>> include/drm/drm_drv.h | 3 ++-
>> 2 files changed, 25 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
>> index cd162d4..0fe5243 100644
>> --- a/drivers/gpu/drm/drm_drv.c
>> +++ b/drivers/gpu/drm/drm_drv.c
>
> The implementation should rather go to drm_irq.c
>
>> @@ -39,6 +39,7 @@
>> #include <drm/drm_color_mgmt.h>
>> #include <drm/drm_drv.h>
>> #include <drm/drm_file.h>
>> +#include <drm/drm_irq.h>
>> #include <drm/drm_managed.h>
>> #include <drm/drm_mode_object.h>
>> #include <drm/drm_print.h>
>> @@ -678,6 +679,28 @@ static int devm_drm_dev_init(struct device *parent,
>> return ret;
>> }
>>
>> +static void devm_drm_dev_irq_uninstall(void *data)
>> +{
>> + drm_irq_uninstall(data);
>> +}
>> +
>> +int devm_drm_irq_install(struct device *parent,
>> + struct drm_device *dev, int irq)
>> +{
>> + int ret;
>> +
>> + ret = drm_irq_install(dev, irq);
>> + if (ret)
>> + return ret;
>> +
>> + ret = devm_add_action(parent, devm_drm_dev_irq_uninstall, dev);
>> + if (ret)
>> + devm_drm_dev_irq_uninstall(dev);
>> +
>> + return ret;
>> +}
>> +EXPORT_SYMBOL(devm_drm_irq_install);
>> +
>> void *__devm_drm_dev_alloc(struct device *parent, struct drm_driver *driver,
>> size_t size, size_t offset)
>> {
>> diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
>> index 0230762..fec1776 100644
>> --- a/include/drm/drm_drv.h
>> +++ b/include/drm/drm_drv.h
>
> And the declaration should go to drm_irq.h
>
> We generally don't merge unused code, so you should convert at least one
> KMS driver, say hibmc, to use the new interface.
>
> Best regards
> Thomas
>
>> @@ -513,7 +513,8 @@ struct drm_driver {
>>
>> void *__devm_drm_dev_alloc(struct device *parent, struct drm_driver *driver,
>> size_t size, size_t offset);
>> -
>> +int devm_drm_irq_install(struct device *parent, struct drm_device *dev,
>> + int irq);
>> /**
>> * devm_drm_dev_alloc - Resource managed allocation of a &drm_device instance
>> * @parent: Parent device object
>>
>
Powered by blists - more mailing lists