2007-08-31 20:00:31

by Adrian McMenamin

[permalink] [raw]
Subject: [PATCH] Patch pvr2 driver to allow development of maple bus driver

This patch makes the PVR2 VBLANK interrupt on the SEGA Dreamcast
shareable - a small but necessary change to enable ongoing efforts to
develop a driver for the maple bus on the Dreamcast. (Maple is Sega's
proprietary serial interface for the Dreamcast and can be set to
synchronise dma transfers to the VBLANK).

This has no impact on the performance of the PVR2.

Signed-off by Adrian McMenamin <[email protected]>

diff --git a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c
index 7d6c298..13de07f 100644
--- a/drivers/video/pvr2fb.c
+++ b/drivers/video/pvr2fb.c
@@ -890,7 +890,7 @@ static int __init pvr2fb_dc_init(void)
pvr2_fix.mmio_start = 0xa05f8000; /* registers start here */
pvr2_fix.mmio_len = 0x2000;

- if (request_irq(HW_EVENT_VSYNC, pvr2fb_interrupt, 0,
+ if (request_irq(HW_EVENT_VSYNC, pvr2fb_interrupt, IRQF_SHARED,
"pvr2 VBL handler", fb_info)) {
return -EBUSY;
}


2007-08-31 20:06:21

by Adrian McMenamin

[permalink] [raw]
Subject: Fwd: [PATCH] Patch pvr2 driver to allow development of maple bus driver

Apologies, sent this Bcc by mistake the first time

---------- Forwarded message ----------
From: Adrian McMenamin <[email protected]>
Date: 31 Aug 2007 21:00
Subject: [PATCH] Patch pvr2 driver to allow development of maple bus driver
To: "Antonino A. Daplas" <[email protected]>


This patch makes the PVR2 VBLANK interrupt on the SEGA Dreamcast
shareable - a small but necessary change to enable ongoing efforts to
develop a driver for the maple bus on the Dreamcast. (Maple is Sega's
proprietary serial interface for the Dreamcast and can be set to
synchronise dma transfers to the VBLANK).

This has no impact on the performance of the PVR2.

Signed-off by Adrian McMenamin <[email protected]>

diff --git a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c
index 7d6c298..13de07f 100644
--- a/drivers/video/pvr2fb.c
+++ b/drivers/video/pvr2fb.c
@@ -890,7 +890,7 @@ static int __init pvr2fb_dc_init(void)
pvr2_fix.mmio_start = 0xa05f8000; /* registers start here */
pvr2_fix.mmio_len = 0x2000;

- if (request_irq(HW_EVENT_VSYNC, pvr2fb_interrupt, 0,
+ if (request_irq(HW_EVENT_VSYNC, pvr2fb_interrupt, IRQF_SHARED,
"pvr2 VBL handler", fb_info)) {
return -EBUSY;
}

2007-08-31 20:12:14

by Mike Frysinger

[permalink] [raw]
Subject: Re: [PATCH] Patch pvr2 driver to allow development of maple bus driver

On 8/31/07, Adrian McMenamin <[email protected]> wrote:
> This patch makes the PVR2 VBLANK interrupt on the SEGA Dreamcast
> shareable - a small but necessary change to enable ongoing efforts to
> develop a driver for the maple bus on the Dreamcast. (Maple is Sega's
> proprietary serial interface for the Dreamcast and can be set to
> synchronise dma transfers to the VBLANK).
>
> This has no impact on the performance of the PVR2.

sharable implies the interrupt handler checks to see if it actually
caused the interrupt ... which it doesnt at the moment ... presumably,
you're making it shared because another device will be using that
interrupt as well ... so when that other device gets an interrupt, how
do you know it's for that device and not PVR2 ?
-mike

2007-08-31 20:14:46

by Adrian McMenamin

[permalink] [raw]
Subject: Re: [PATCH] Patch pvr2 driver to allow development of maple bus driver

On 31/08/2007, Mike Frysinger <[email protected]> wrote:
> On 8/31/07, Adrian McMenamin <[email protected]> wrote:
> > This patch makes the PVR2 VBLANK interrupt on the SEGA Dreamcast
> > shareable - a small but necessary change to enable ongoing efforts to
> > develop a driver for the maple bus on the Dreamcast. (Maple is Sega's
> > proprietary serial interface for the Dreamcast and can be set to
> > synchronise dma transfers to the VBLANK).
> >
> > This has no impact on the performance of the PVR2.
>
> sharable implies the interrupt handler checks to see if it actually
> caused the interrupt ... which it doesnt at the moment ... presumably,
> you're making it shared because another device will be using that
> interrupt as well ... so when that other device gets an interrupt, how
> do you know it's for that device and not PVR2 ?


If the interrupt occurs then it will be for both of them. The hardware
cannot be removed and the maple bus driver is set for hardware sync.

The question seems redundant to me.

2007-09-01 03:02:43

by Mike Frysinger

[permalink] [raw]
Subject: Re: [PATCH] Patch pvr2 driver to allow development of maple bus driver

On Friday 31 August 2007, Adrian McMenamin wrote:
> On 31/08/2007, Mike Frysinger <[email protected]> wrote:
> > On 8/31/07, Adrian McMenamin <[email protected]> wrote:
> > > This patch makes the PVR2 VBLANK interrupt on the SEGA Dreamcast
> > > shareable - a small but necessary change to enable ongoing efforts to
> > > develop a driver for the maple bus on the Dreamcast. (Maple is Sega's
> > > proprietary serial interface for the Dreamcast and can be set to
> > > synchronise dma transfers to the VBLANK).
> > >
> > > This has no impact on the performance of the PVR2.
> >
> > sharable implies the interrupt handler checks to see if it actually
> > caused the interrupt ... which it doesnt at the moment ... presumably,
> > you're making it shared because another device will be using that
> > interrupt as well ... so when that other device gets an interrupt, how
> > do you know it's for that device and not PVR2 ?
>
> If the interrupt occurs then it will be for both of them. The hardware
> cannot be removed and the maple bus driver is set for hardware sync.
>
> The question seems redundant to me.

i really dont know how the maple bus works or what piece of hardware is wired
up to the same interrupt line. my point is that if the other device fires an
interrupt, the pvr interrupt handler may be executed and attempt to do work
when in reality the pvr was not the source of the interrupt.
-mike


Attachments:
(No filename) (1.38 kB)
signature.asc (827.00 B)
This is a digitally signed message part.
Download all attachments

2007-09-01 09:36:16

by Adrian McMenamin

[permalink] [raw]
Subject: Re: [PATCH] Patch pvr2 driver to allow development of maple bus driver

On Fri, 2007-08-31 at 23:02 -0400, Mike Frysinger wrote:

> i really dont know how the maple bus works or what piece of hardware is wired
> up to the same interrupt line. my point is that if the other device fires an
> interrupt, the pvr interrupt handler may be executed and attempt to do work
> when in reality the pvr was not the source of the interrupt.
> -mike

The interrupt is *always* fired by the PVR - it is the VBLANK - ie
essentially screen refresh. It is *never* generated by the maple bus.

However, the maple bus is/can be hardware synced - which means once that
setting is made then the hardware will *always* be polled on the VBLANK.

In other words there is no need to check which device is interrupt is
for, because it is *always* going to be for both of them.