[PATCH] drm: Improve manual IRQ installation documentation

Thierry Reding thierry.reding at gmail.com
Thu Jun 20 03:40:26 PDT 2013


On Thu, Jun 20, 2013 at 12:17:25PM +0200, Laurent Pinchart wrote:
> Hi Thierry,
> 
> On Thursday 20 June 2013 12:10:47 Thierry Reding wrote:
> > On Wed, Jun 19, 2013 at 02:00:45PM +0200, Laurent Pinchart wrote:
> > > Signed-off-by: Laurent Pinchart
> > > <laurent.pinchart+renesas at ideasonboard.com>
> > > ---
> > > 
> > >  Documentation/DocBook/drm.tmpl | 14 ++++++++------
> > >  1 file changed, 8 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/Documentation/DocBook/drm.tmpl
> > > b/Documentation/DocBook/drm.tmpl index f9df3b8..738b727 100644
> > > --- a/Documentation/DocBook/drm.tmpl
> > > +++ b/Documentation/DocBook/drm.tmpl
> > > @@ -186,11 +186,12 @@
> > > 
> > >            <varlistentry>
> > >            
> > >              <term>DRIVER_HAVE_IRQ</term><term>DRIVER_IRQ_SHARED</term>
> > >              <listitem><para>
> > > 
> > > -              DRIVER_HAVE_IRQ indicates whether the driver has an IRQ
> > > handler. The -              DRM core will automatically register an
> > > interrupt handler when the -              flag is set. DRIVER_IRQ_SHARED
> > > indicates whether the device & -              handler support shared
> > > IRQs (note that this is required of PCI -              drivers).
> > > +              DRIVER_HAVE_IRQ indicates whether the driver has an IRQ
> > > handler +              managed by the DRM Core. The core will support
> > > simple IRQ handler +              installation when the flag is set. The
> > > installation process is +              described in <xref
> > > linkend="drm-irq-registration"/>.</para> +             
> > > <para>DRIVER_IRQ_SHARED indicates whether the device & handler +     
> > >         support shared IRQs (note that this is required of PCI  drivers).> 
> > >              </para></listitem>
> > >            
> > >            </varlistentry>
> > >            <varlistentry>
> > > 
> > > @@ -344,7 +345,8 @@ char *date;</synopsis>
> > > 
> > >            The DRM core tries to facilitate IRQ handler registration and
> > >            unregistration by providing
> > >            <function>drm_irq_install</function> and
> > >            <function>drm_irq_uninstall</function> functions. Those
> > >            functions only
> > > 
> > > -          support a single interrupt per device.
> > > +          support a single interrupt per device, devices that use more
> > > than one +          IRQs need to be handled manually.
> > 
> > Perhaps this should mention that if you handle IRQ installation manually
> > you also need to manually set drm->irq_enabled = 1, as otherwise things
> > like DRM_IOCTL_WAIT_VBLANK won't work properly.
> 
> That's only needed if DRIVER_HAVE_IRQ is set, otherwise the drm_wait_vblank() 
> function skips the irq_enabled check.

Not quite. There's another check for dev->irq_enabled in the
DRM_WAIT_ON() so it'll never actually block. Arguably this could be
solved by making the DRM_WAIT_ON() condition drop the !dev->irq_enabled
in case DRIVER_HAVE_IRQ isn't set.

I'll see if I can find the time to come up with a patch.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20130620/dac54ffe/attachment-0001.pgp>


More information about the dri-devel mailing list