dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Hans de Goede <hdegoede@redhat.com>, airlied@linux.ie, daniel@ffwll.ch
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/vbox: Convert to Linux IRQ interfaces
Date: Tue, 3 Aug 2021 10:27:27 +0200	[thread overview]
Message-ID: <2708433e-c902-1117-22d6-21bf20160848@suse.de> (raw)
In-Reply-To: <12fb7f27-0e1c-5f35-ca2e-5a34e7977f80@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 4127 bytes --]

Hi

Am 02.08.21 um 13:52 schrieb Hans de Goede:
> Hi,
> 
> On 7/6/21 9:50 AM, 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.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> 
> Thanks, patch looks good to me:
> 
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> 
> And to make sure things don't regress I've also given this a test spin:
> 
> Tested-by: Hans de Goede <hdegoede@redhat.com>
> 
> Note I assume that you will push this out do drmi-misc yourself
> (if you've not done so already given that this patch is somewhat old).

Although it's been merged already, thanks for testing the patch.

Best regards
Thomas

> 
> Regards,
> 
> Hans
> 
> 
> 
>> ---
>>   drivers/gpu/drm/vboxvideo/vbox_drv.c |  1 -
>>   drivers/gpu/drm/vboxvideo/vbox_drv.h |  1 -
>>   drivers/gpu/drm/vboxvideo/vbox_irq.c | 16 +++++++++++-----
>>   3 files changed, 11 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/vboxvideo/vbox_drv.c b/drivers/gpu/drm/vboxvideo/vbox_drv.c
>> index 879a2445cc44..2b81cb259d23 100644
>> --- a/drivers/gpu/drm/vboxvideo/vbox_drv.c
>> +++ b/drivers/gpu/drm/vboxvideo/vbox_drv.c
>> @@ -184,7 +184,6 @@ static const struct drm_driver driver = {
>>   	.lastclose = drm_fb_helper_lastclose,
>>   
>>   	.fops = &vbox_fops,
>> -	.irq_handler = vbox_irq_handler,
>>   	.name = DRIVER_NAME,
>>   	.desc = DRIVER_DESC,
>>   	.date = DRIVER_DATE,
>> diff --git a/drivers/gpu/drm/vboxvideo/vbox_drv.h b/drivers/gpu/drm/vboxvideo/vbox_drv.h
>> index ac7c2effc46f..4903b91d7fe4 100644
>> --- a/drivers/gpu/drm/vboxvideo/vbox_drv.h
>> +++ b/drivers/gpu/drm/vboxvideo/vbox_drv.h
>> @@ -145,7 +145,6 @@ void vbox_mm_fini(struct vbox_private *vbox);
>>   int vbox_irq_init(struct vbox_private *vbox);
>>   void vbox_irq_fini(struct vbox_private *vbox);
>>   void vbox_report_hotplug(struct vbox_private *vbox);
>> -irqreturn_t vbox_irq_handler(int irq, void *arg);
>>   
>>   /* vbox_hgsmi.c */
>>   void *hgsmi_buffer_alloc(struct gen_pool *guest_pool, size_t size,
>> diff --git a/drivers/gpu/drm/vboxvideo/vbox_irq.c b/drivers/gpu/drm/vboxvideo/vbox_irq.c
>> index b3ded68603ba..903a6c48ee8b 100644
>> --- a/drivers/gpu/drm/vboxvideo/vbox_irq.c
>> +++ b/drivers/gpu/drm/vboxvideo/vbox_irq.c
>> @@ -10,7 +10,8 @@
>>    */
>>   
>>   #include <linux/pci.h>
>> -#include <drm/drm_irq.h>
>> +
>> +#include <drm/drm_drv.h>
>>   #include <drm/drm_probe_helper.h>
>>   
>>   #include "vbox_drv.h"
>> @@ -31,7 +32,7 @@ void vbox_report_hotplug(struct vbox_private *vbox)
>>   	schedule_work(&vbox->hotplug_work);
>>   }
>>   
>> -irqreturn_t vbox_irq_handler(int irq, void *arg)
>> +static irqreturn_t vbox_irq_handler(int irq, void *arg)
>>   {
>>   	struct drm_device *dev = (struct drm_device *)arg;
>>   	struct vbox_private *vbox = to_vbox_dev(dev);
>> @@ -170,16 +171,21 @@ static void vbox_hotplug_worker(struct work_struct *work)
>>   
>>   int vbox_irq_init(struct vbox_private *vbox)
>>   {
>> -	struct pci_dev *pdev = to_pci_dev(vbox->ddev.dev);
>> +	struct drm_device *dev = &vbox->ddev;
>> +	struct pci_dev *pdev = to_pci_dev(dev->dev);
>>   
>>   	INIT_WORK(&vbox->hotplug_work, vbox_hotplug_worker);
>>   	vbox_update_mode_hints(vbox);
>>   
>> -	return drm_irq_install(&vbox->ddev, pdev->irq);
>> +	/* PCI devices require shared interrupts. */
>> +	return request_irq(pdev->irq, vbox_irq_handler, IRQF_SHARED, dev->driver->name, dev);
>>   }
>>   
>>   void vbox_irq_fini(struct vbox_private *vbox)
>>   {
>> -	drm_irq_uninstall(&vbox->ddev);
>> +	struct drm_device *dev = &vbox->ddev;
>> +	struct pci_dev *pdev = to_pci_dev(dev->dev);
>> +
>> +	free_irq(pdev->irq, dev);
>>   	flush_work(&vbox->hotplug_work);
>>   }
>>
> 

-- 
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 --]

      reply	other threads:[~2021-08-03  8:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-06  7:50 [PATCH] drm/vbox: Convert to Linux IRQ interfaces Thomas Zimmermann
2021-07-10  6:40 ` Sam Ravnborg
2021-08-02 11:52 ` Hans de Goede
2021-08-03  8:27   ` Thomas Zimmermann [this message]

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=2708433e-c902-1117-22d6-21bf20160848@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.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).