[haiku-commits] haiku: hrev47032 - src/add-ons/kernel/drivers/graphics/intel_extreme

  • From: korli@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 18 Mar 2014 22:02:04 +0100 (CET)

hrev47032 adds 1 changeset to branch 'master'
old head: 4fc7f247a8acbe2844bd5cd8b091321522b23b69
new head: ab1f2cd08dd06af2de17df916e55814a772bb658
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=ab1f2cd+%5E4fc7f24

----------------------------------------------------------------------------

ab1f2cd: intel_extreme: read and loop for new interrupts. Fix #9718.
  
  * MSI seems to trigger the need to loop: interrupts are not generated for bits
  set while we process.

                                   [ Jérôme Duval <jerome.duval@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev47032
Commit:      ab1f2cd08dd06af2de17df916e55814a772bb658
URL:         http://cgit.haiku-os.org/haiku/commit/?id=ab1f2cd
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Sat Mar  8 19:18:23 2014 UTC

Ticket:      https://dev.haiku-os.org/ticket/9718

----------------------------------------------------------------------------

1 file changed, 25 insertions(+), 20 deletions(-)
.../graphics/intel_extreme/intel_extreme.cpp     | 45 +++++++++++---------

----------------------------------------------------------------------------

diff --git 
a/src/add-ons/kernel/drivers/graphics/intel_extreme/intel_extreme.cpp 
b/src/add-ons/kernel/drivers/graphics/intel_extreme/intel_extreme.cpp
index 5adb4b3..f9dddbb 100644
--- a/src/add-ons/kernel/drivers/graphics/intel_extreme/intel_extreme.cpp
+++ b/src/add-ons/kernel/drivers/graphics/intel_extreme/intel_extreme.cpp
@@ -78,35 +78,40 @@ static int32
 intel_interrupt_handler(void* data)
 {
        intel_info &info = *(intel_info*)data;
-
-       uint16 identity = read16(info, find_reg(info, 
INTEL_INTERRUPT_IDENTITY));
+       uint32 reg = find_reg(info, INTEL_INTERRUPT_IDENTITY);
+       uint16 identity = read16(info, reg);
        if (identity == 0)
                return B_UNHANDLED_INTERRUPT;
 
        int32 handled = B_HANDLED_INTERRUPT;
 
-       // TODO: verify that these aren't actually the same
-       bool hasPCH = info.device_type.HasPlatformControlHub();
-       uint16 mask = hasPCH ? PCH_INTERRUPT_VBLANK_PIPEA : 
INTERRUPT_VBLANK_PIPEA;
-       if ((identity & mask) != 0) {
-               handled = release_vblank_sem(info);
+       while (identity != 0) {
 
-               // make sure we'll get another one of those
-               write32(info, INTEL_DISPLAY_A_PIPE_STATUS,
-                       DISPLAY_PIPE_VBLANK_STATUS | 
DISPLAY_PIPE_VBLANK_ENABLED);
-       }
+               // TODO: verify that these aren't actually the same
+               bool hasPCH = info.device_type.HasPlatformControlHub();
+               uint16 mask = hasPCH ? PCH_INTERRUPT_VBLANK_PIPEA
+                       : INTERRUPT_VBLANK_PIPEA;
+               if ((identity & mask) != 0) {
+                       handled = release_vblank_sem(info);
 
-       mask = hasPCH ? PCH_INTERRUPT_VBLANK_PIPEB : INTERRUPT_VBLANK_PIPEB;
-       if ((identity & mask) != 0) {
-               handled = release_vblank_sem(info);
+                       // make sure we'll get another one of those
+                       write32(info, INTEL_DISPLAY_A_PIPE_STATUS,
+                               DISPLAY_PIPE_VBLANK_STATUS | 
DISPLAY_PIPE_VBLANK_ENABLED);
+               }
 
-               // make sure we'll get another one of those
-               write32(info, INTEL_DISPLAY_B_PIPE_STATUS,
-                       DISPLAY_PIPE_VBLANK_STATUS | 
DISPLAY_PIPE_VBLANK_ENABLED);
-       }
+               mask = hasPCH ? PCH_INTERRUPT_VBLANK_PIPEB : 
INTERRUPT_VBLANK_PIPEB;
+               if ((identity & mask) != 0) {
+                       handled = release_vblank_sem(info);
 
-       // setting the bit clears it!
-       write16(info, find_reg(info, INTEL_INTERRUPT_IDENTITY), identity);
+                       // make sure we'll get another one of those
+                       write32(info, INTEL_DISPLAY_B_PIPE_STATUS,
+                               DISPLAY_PIPE_VBLANK_STATUS | 
DISPLAY_PIPE_VBLANK_ENABLED);
+               }
+
+               // setting the bit clears it!
+               write16(info, reg, identity);
+               identity = read16(info, reg);
+       }
 
        return handled;
 }


Other related posts:

  • » [haiku-commits] haiku: hrev47032 - src/add-ons/kernel/drivers/graphics/intel_extreme - korli