[haiku-commits] haiku: hrev50434 - src/add-ons/accelerants/intel_extreme headers/private/graphics/intel_extreme

  • From: kallisti5@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 20 Jul 2016 07:28:31 +0200 (CEST)

hrev50434 adds 1 changeset to branch 'master'
old head: 04039d6f30393bb4eb9612cbb69cf355859cf696
new head: f6c32ce31051610c37d4978fbd27d588de6944d1
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=f6c32ce31051+%5E04039d6f3039

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

f6c32ce31051: intel_extreme: Set FDI PLL RX lane count when enabling

                       [ Alexander von Gluck IV <alex.vongluck@xxxxxxxxxx> ]

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

Revision:    hrev50434
Commit:      f6c32ce31051610c37d4978fbd27d588de6944d1
URL:         http://cgit.haiku-os.org/haiku/commit/?id=f6c32ce31051
Author:      Alexander von Gluck IV <alex.vongluck@xxxxxxxxxx>
Date:        Wed Jul 20 05:25:38 2016 UTC

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

3 files changed, 19 insertions(+), 7 deletions(-)
.../private/graphics/intel_extreme/intel_extreme.h |  4 ++++
.../intel_extreme/FlexibleDisplayInterface.cpp     | 18 +++++++++++++-----
.../intel_extreme/FlexibleDisplayInterface.h       |  4 ++--

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

diff --git a/headers/private/graphics/intel_extreme/intel_extreme.h 
b/headers/private/graphics/intel_extreme/intel_extreme.h
index 839bdb4..ab4e025 100644
--- a/headers/private/graphics/intel_extreme/intel_extreme.h
+++ b/headers/private/graphics/intel_extreme/intel_extreme.h
@@ -878,6 +878,10 @@ struct intel_free_graphics_memory {
 #define FDI_TX_ENHANCE_FRAME_ENABLE            (1 << 18)
 #define FDI_TX_PLL_ENABLED                             (1 << 14)
 
+#define FDI_DP_PORT_WIDTH_SHIFT                        19
+#define FDI_DP_PORT_WIDTH_MASK                 (7 << FDI_DP_PORT_WIDTH_SHIFT)
+#define FDI_DP_PORT_WIDTH(width)               (((width) - 1) << 
FDI_DP_PORT_WIDTH_SHIFT)
+
 #define FDI_PLL_BIOS_0                                 0x46000
 #define FDI_PLL_FB_CLOCK_MASK                  0xff
 #define FDI_PLL_BIOS_1                                 0x46004
diff --git a/src/add-ons/accelerants/intel_extreme/FlexibleDisplayInterface.cpp 
b/src/add-ons/accelerants/intel_extreme/FlexibleDisplayInterface.cpp
index c21c6c3..f9d3ac0 100644
--- a/src/add-ons/accelerants/intel_extreme/FlexibleDisplayInterface.cpp
+++ b/src/add-ons/accelerants/intel_extreme/FlexibleDisplayInterface.cpp
@@ -84,13 +84,14 @@ FDITransmitter::IsPLLEnabled()
 
 
 void
-FDITransmitter::EnablePLL()
+FDITransmitter::EnablePLL(uint32 lanes)
 {
        CALLED();
        uint32 targetRegister = fRegisterBase + PCH_FDI_TX_CONTROL;
        uint32 value = read32(targetRegister);
        if ((value & FDI_TX_PLL_ENABLED) != 0) {
                // already enabled, possibly IronLake where it always is
+               TRACE("%s: Already enabled.\n", __func__);
                return;
        }
 
@@ -169,13 +170,20 @@ FDIReceiver::IsPLLEnabled()
 
 
 void
-FDIReceiver::EnablePLL()
+FDIReceiver::EnablePLL(uint32 lanes)
 {
        CALLED();
        uint32 targetRegister = fRegisterBase + PCH_FDI_RX_CONTROL;
        uint32 value = read32(targetRegister);
-       if ((value & FDI_RX_PLL_ENABLED) != 0)
+       if ((value & FDI_RX_PLL_ENABLED) != 0) {
+               // already enabled, possibly IronLake where it always is
+               TRACE("%s: Already enabled.\n", __func__);
                return;
+       }
+
+       value &= ~(FDI_DP_PORT_WIDTH_MASK | (0x7 << 16));
+       value |= FDI_DP_PORT_WIDTH(lanes);
+       //value |= (read32(PIPECONF(pipe)) & PIPECONF_BPC_MASK) << 11;
 
        write32(targetRegister, value | FDI_RX_PLL_ENABLED);
        read32(targetRegister);
@@ -248,9 +256,9 @@ FDILink::Train(display_mode* target)
        TRACE("%s: FDI Link Lanes: %" B_PRIu32 "\n", __func__, lanes);
 
        // Enable FDI clocks
-       Receiver().EnablePLL();
+       Receiver().EnablePLL(lanes);
        Receiver().SwitchClock(true);
-       Transmitter().EnablePLL();
+       Transmitter().EnablePLL(lanes);
 
        status_t result = B_ERROR;
 
diff --git a/src/add-ons/accelerants/intel_extreme/FlexibleDisplayInterface.h 
b/src/add-ons/accelerants/intel_extreme/FlexibleDisplayInterface.h
index 33502ba..8f6156f 100644
--- a/src/add-ons/accelerants/intel_extreme/FlexibleDisplayInterface.h
+++ b/src/add-ons/accelerants/intel_extreme/FlexibleDisplayInterface.h
@@ -22,7 +22,7 @@ public:
                void                                            Disable();
 
                bool                                            IsPLLEnabled();
-               void                                            EnablePLL();
+               void                                            
EnablePLL(uint32 lanes);
                void                                            DisablePLL();
 
                uint32                                          Base()
@@ -42,7 +42,7 @@ public:
                void                                            Disable();
 
                bool                                            IsPLLEnabled();
-               void                                            EnablePLL();
+               void                                            
EnablePLL(uint32 lanes);
                void                                            DisablePLL();
 
                void                                            
SwitchClock(bool toPCDClock);


Other related posts:

  • » [haiku-commits] haiku: hrev50434 - src/add-ons/accelerants/intel_extreme headers/private/graphics/intel_extreme - kallisti5