History log of /haiku/src/add-ons/accelerants/radeon_hd/pll.cpp
Revision Date Author Comments
# 66291294 11-Dec-2021 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd/pll: Guard bpc on non-HDMI under table 1.5,1.6

* Cut extra calls to display_get_encoder_mode
* Correct incorrect ucMiscInfo on table 1.6 via atombios
comments

Change-Id: Ib6d7938269b8421d3711c1344eab0b9842336932


# 3084929f 11-Dec-2021 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd/pll: Fix pll MiscInfo on table 1.5

* Looks like some error in atombios. AMD just
reversed the values instead of fixing the atom.h
defines in Linux.

Change-Id: I440682af5708ce0da1625e8f50e8cb77595c8397


# 1121a232 08-Sep-2017 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Improve external/dce PLL programming

* Bug fix around pll_external_set. We prepared all the args,
but never actually executed the AtomBIOS table.
* Add new AtomBIOS methods in Polaris to set external PLL
clock frequencies.
* Implement new 1.7 PLL set table on Polaris.


# 9816a89a 07-Jul-2015 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Move to a unified dp aux transaction function.

* Leverage a single common dp aux message struct.
* Likely lots of obvious bugs that need fixed still.
* Untested.


# 0de3a595 07-Jul-2015 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: ss_probe reads the pixel clock; set before calling.

* CID 743876


# 44b97460 10-Nov-2014 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Fix Spread Spectrum clock decimal place

* As 104Mhz is stores as 10400 on atombios,
and 104000 everywhere else... this conversion
was going the wrong direction.
* Shrink the stored value to 10Khz units to properly
compare to the AtomBIOS value


# 99f83552 26-May-2014 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Fix comment typo, no functional change


# e938ebda 26-May-2014 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Rework PLL picking code

* Rewrote to be more efficient and more accurate.
* Fix a DP bug where we didn't choose the correct
external PLL.


# a8307efa 24-May-2014 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Improve pll probing. Let probe calls enable ss


# 2354b8ac 01-May-2014 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Finish spread spectrum support

* This needs testing and is to remain disabled
until we can test on several radeon_hd cards
from multiple families


# f01af94f 01-May-2014 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Don't squash ss status_t into bool


# eb5224cf 02-Mar-2014 Julian Harnath <julian.harnath@rwth-aachen.de>

Oops, remove leftover "TODO" in comment


# de26f2e7 02-Mar-2014 Julian Harnath <julian.harnath@rwth-aachen.de>

Make code a bit easier to read, add some comments

* No functional change intended


# 34d3dff3 02-Mar-2014 Julian Harnath <julian.harnath@rwth-aachen.de>

Fix feedback divider value approximation

* The rounding algorithm here expects to start with the 2 digits
after the decimal point in pll->feedbackDivFrac. Multiplying with
1000 instead of 100 filled it with 3 digits.
The last step then set the fractional part to zero because it was
still too large.


# 224b875b 30-Dec-2013 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: clean up clock units

* Ensure we store all clock units as khz or
n * 10 off from AtomBIOS unit expected
* Perform DDC setup of external encoder


# 9c2d51d6 29-Dec-2013 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: clean up encoder object

* Encoder flags were 1:1 connector flags...
just look at connector flags.
* Record encoder capabilities
* Add function to check for dp 1.2 support


# 00bc40ad 28-Jan-2013 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Fix DisplayPort link training

* Original changes by Bill Randle
* Includes a large number of modifications
and cleanups.
* Add a "currentMode" to the gDisplay to
enable easier checking of intended changes.
(we pass the display_mode around quite a
bit, adding a "currentMode" allows code
to know the intended display mode being set
without passing the mode pointer around as
much)


# a5ccd036 14-Aug-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Become Spread Spectrum aware

* Enable Spread Spectrum when requested
* Tested working across several cards, does
have regression potential though.


# baa7999a 14-Aug-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: slight adjustment to PLL choosing on DP


# d96e6876 07-Aug-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: re-rework some pll code

* Grab pseudo pll SS info for early
Spread Spectrum access
* display_crtc_ss now takes a pll vs
a display for easy pll access


# 817c114d 07-Aug-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: rework some pll code

* Force fractional feedback divider on APU's
* Spread Spectrum is now probed more correctly
across multiple encoders and cards
* SS still disabled however.


# 63624e40 07-Aug-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: reorganize some pll code

* Move DisplayPort external pixel clock out of pll
as this frequency is card-wide.
* Add new function to pull display clock frequency
and other card-wide settings.
* Set displayDefault frequency card-wide
* My DisplayPort LVDS bridge laptop now kind of works
(a clock somewhere seems a little off though)


# 47274433 06-Aug-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: pick a PLL based on connector

* was static PLL 1


# 4e7e3e33 04-Aug-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: display port improvements

* Remove non-generic radeon dp_get_lane_count
* Set lane count and link rate at set_display_mode
* Pass entire mode to pll_set vs only pixel clock for DP code
* Add helpers for DP config data to common code
* Obtain more correct link rate


# ece8e7a8 06-Apr-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Fix pll DisplayPort endian bug.


# d8ac7e28 24-Mar-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Fix DCE version check

* Trace cleanup
* Minimal change


# 151b4996 22-Mar-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Add spread spectrum control functions

* Store SS information with PLL
* Probe SS information for PLL
* Disable SS more correctly
* May resolve mode setting issues on newer cards


# d07afea3 22-Mar-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Fix AtomBIOS provided reference divider

* When AtomBIOS provides a reference divider, we should
still attempt to perform calculations using it vs
returning.


# 6728eddf 15-Mar-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Fix bugs in external DP bridge code

* non-external encoder will never be a DP bridge.
* use external encoder in places where needed.
* ensure we look at proper encoder for isDPBridge.


# 6da8db27 15-Mar-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

Revert "radeon_hd: Convert encoders to pointers"

This reverts commit 5a1f9f0f16b2a4bef89b61b4e3e24bf0b53917da.

* Thinking on this a bit more, this is really a silly change as
I know the upper limit for number of valid encoders.
* Resolves a app_server crash introduced as well due to not
allocating encoder pointer.


# 5a1f9f0f 14-Mar-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Convert encoders to pointers

* Preparation for multiple encoders per connector


# c937ca19 22-Feb-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Improve pll DP bridge code

* Only set DP bridge on DP bridge.
* Add a bit of tracing


# 8ff2ca22 16-Dec-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Complete code for DIG transmitter control

* Record external clock frequency (aka, DP non-pll)
* Add function to control DIG transmitter
* Cleanup duplicated is external code in encoder mode set


# c8677fb1 14-Dec-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Working towards DP connector support

* Lots of new DisplayPort functions
* Call DP link training during mode set
* Rename dp_info variables to be less redundant
* Make encoder_pick_dig accept connector ID and
then check parent display
* Encode/Decode DP link speed functions
* Calculate DP lanes
* Rewrite encoder_dig_setup
* Correct bitsPerChannel to bitsPerColor
* My TRAVIS DisplayPort -> LVDS bridge now works


# 96587f13 13-Dec-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Introduce new displayport source file

* Move existing displayport functions to new source file
* Move was done due to large amount of DP code
* Style fixes
* Stub out new DP link training function


# dc0d01ab 10-Dec-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Cleanup. Move unions into functions that use them.

* Rename unions to match style guide lines
* Group things that make sense together
* Move AtomBIOS argument struct creation closer to what uses it


# 0cd5024d 09-Dec-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Pointer style cleanup; Variable consolidation


# 61cf7133 09-Dec-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Include file style cleanup, no functional change


# 654dc4bf 09-Dec-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Use bridge encoder flag vs making direct calls to check


# 2944d7da 02-Dec-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Bug fix in drm driver, set EncoderID properly on pll_adjust


# dad34be3 02-Dec-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Improve pll calculations dealing with DisplayPort devices

* rename encoder_isexternal to encoder_is_external
* add encoder_is_dp_bridge call for special DP cases
* add initial get_dp_link_clock, hard code a guess for now
* take external DP encoders into consideration when making
pixel clock adjustments


# 359b926f 08-Nov-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* style cleanup of shared storage names
* return better data on card
* display chipset flags in screen preflet


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43226 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 76a3e009 08-Nov-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* add lots of missing evergreen defines
* evergreen headers are split due to different
header copyrights
* detect and set up evergreen memory controler
* change the way we manage radeon chipsets to
more closely match drm driver as the chipset
model numbers aren't in order and change from
numbers to names.
* check for evergreen when populating frame buffer
information.
* style cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43225 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 025d4eed 27-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* reorganize register definitions
There were a large number if incorrect, duplicated, misplaced
registers that were leading to bugs in the code. This is my first
shot at cleaning them up. Luckly as we are using AtomBIOS the number
of registers we need to know about is shrinking.
* remove registers left over from register banging days
* r770 is less then r710, r720 in the drm sources. Fix in code.
* enable newer radeons for testing


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42930 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f089aa52 21-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* stub out dig encoder setup
* adjust pll post divider calculation
* fix digital encoder setup action
* don't run memreq on DCE < 3, should solve
some AtomBIOS failure loops


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42892 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a4f66979 17-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* fix minimum pll out units
* sort files in Jamfile
* add TV and compontent video support in encoder code
* fix missing var in display detection code


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 756fb8b7 17-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* fix pll limitations probing
* radeon HD mode setting on analog monitors is now working!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42877 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 86a5585b 17-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* redo 42874 in the right direction
* fix a order of operations bug
* fix a few long lines
* pll computation should now be correct


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42876 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 96eb5a46 17-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* increase tolerance checking as we store kHz vs 10kHz units


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42874 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 05a2fee6 17-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* add varying PLL calculations as directed by AtomBIOS
* don't set referenceDivider as minimum unless directed to by
AtomBIOS


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42873 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f66a1a8d 16-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* fix TODO style due to ML
* rename bpc to bitsPerChannel
* remove un-needed / unused PCI BAR reference
* no functional change


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42861 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5fd02779 15-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* add function to make pll flag adjustments
* bug fix of improper unit conversion


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42858 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cf1d1fb4 14-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* add function to probe pll timing limits from AtomBIOS
* rename *_* pll vars to match style guidelines
* refactor PLL calculation to be easier to read with
more central 10kHz unit conversions
* limited mode switching has been seen working including
a perfect 1280x1024@75


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42855 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c0fe7a01 14-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* tweaks to pll calculation reference units.. make divisors match 10 kHz unit


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42854 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 245fe001 14-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* first shot at fixing pll calculations
AtomBIOS wants number of 10Khz Units
* better debugging after modeset on current
CRTC status


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42853 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e774cb4b 12-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* style fixes
move quite a bit of code away from var_var format
* #if 0 some not-yet-ready r500 code
* no real functional change


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42835 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6b49ba89 12-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* style fixes, no functional change...
frev / crev to tableMajor / tableMinor
size to tableSize
offset to tableOffset


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42834 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6b0b621b 12-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* style fixes, no functional change...
automatic crtc_id -> crtcID
automatic pll_id -> pllID
automatic encoder_id -> encoderID
automatic connector_index -> connectorIndex
automatic encoder_flags -> encoderFlags


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42831 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 042bdcc0 12-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* complete pll_set for all AtomBIOS revisions
* add update of crtc encoder scratch registers
* rename id for more descriptive crtc_id
* encoder dpms, BL on/off on lcd


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42828 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 14493b1e 11-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* quick style fix before I forget, no functional change


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42827 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e7d0abae 11-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* move pll info into pll_info struct.
* reduce the number of unique storage uint32's


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42826 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 82720f1c 10-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* move pll info onto encoder
* add atombios PLL adjustment code
* add initial PLL clock flags


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42819 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1fca5eaf 10-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* detect hdmi and tv and set as such
* set encoder flags the same as connector flags
* add curly comments to make troubleshooting clearer
* program encoder dpms scratch registers


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42818 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d0509b7e 09-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* move encoder info into own struct
* rename some connector / encoder struct members
* improve debugging in connector / encoder
AtomBIOS walking


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42815 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7c91a33c 02-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* RIP Radeon register banging
Remove old non-atombios code
* add encoder.c and encoder.h to handle
encoder management
* fix pll code to use encoder object id
vs crtcid


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42797 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e53d6375 01-Sep-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* reformulate display and connector storage to match AtomBIOS requirements
* each active gDisplay references a gConnector index
* add atombios DAC sense.. this really won't be the main call used...
AtomBIOS expects you to attempt an EDID read to detect connected displays
* remove old manual DACSense
* next we attempt to add ddc / edid


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42705 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d3e8b642 19-Aug-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* introduce mc control calls
* malloc storage for mc state info
* redo pll range struct
* change to ATOM_ENCODER_MODE for connector info
* redo pll calculations to match AtomBIOS requirements
* some structure changes
* no longer init already posted AtomBIOS as it
causes an infinite loop of AtomBIOS calls


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42644 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6da3f7d4 05-Aug-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* lots of changes
* add missing header for some radeon registers
* begin removing now un-needed direct register calls
* move and refactor crtc functions
* fix function naming to be clearer
* create more AtomBIOS style calls
* this will eat your cat at the moment, don't bother testing


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42582 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 95e1d7e8 21-Jul-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Large refactoring of display detection and storage
* Create new display.c/h for display management
* Rename global gCRT to gDisplay
* Add CRT connection type into gDisplay
* Add CRT connection index into gDisplay
* Refactor registers for each display into gDisplay via regs
* We now shouldn't freak out too badly on multi-monitors


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42462 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3fe78837 11-Jul-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* remove superfluous parentheses as per Axel

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42411 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 414b6dd9 11-Jul-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

DeadYak gave a better solution to r42407, simply typecast the defines as we don't want to modify the AMD radeon_hd register headers

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42409 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5da2e463 11-Jul-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

prevent radeon_hd enumeral mismatch on powerpc/gcc4

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42407 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f2fe29a0 08-Jul-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Final (hopefully?) calculation for blank start/end
* Lets actually call PLLPower after PLLSet
* Improve screen blanking function
* Detect DAC/PLL to use separately from CRT id
* Add DACSense that senses displays on DACA/DACB
* Grab CRT in PLL code via gRegister crtid
* Set overscan to 0 for now
* Setting extended video modes now kinda works sometimes :-/


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42397 a95241bf-73f2-0310-859d-f6bbb57e9c96


# eb5c4b07 07-Jul-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Style Cleanup
* Remove some un-needed test stuff
* Perform a little re-ordering
* Make scale corrections


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42390 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d97da786 07-Jul-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Refactor PLL legacy registers to be pllIndex aware
* Rename PLL register vars to more closely match AMD defines
* Small logic fixes
* Fix pretty large PLLControlTable bug in legacy set.
Wasn't using output of PLLControlTable.
* Fix *REALLY* big bug in CRTCGrab.
Using PLL2 value instead of PLL1 due to incorrect
index offset of pllIndex.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42389 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b6c5f468 04-Jul-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Add D2 GRPH update lock register to priv headers
* Add crtControl global register
* Add grphUpdate storage
* Do some logical reordering of register writes
* Correct crt final power-on checks
* Enhance tracing
* Disable PLL, it is needed but seems to completely break
the modesetting resulting in black-screen-of-doom.
(fixing PLL set/calibration is now priority one)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42380 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 26e18b1f 30-Jun-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

gcc2 buildfix; few style adjustments

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42347 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ab29dee1 16-Jun-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

A few style fixes, no functional change

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42207 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6604b1b6 16-Jun-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Break DAC code into sperate source file
* Implement assigning DAC A/B to crt
* Clean up mode change code
* Still some pixel clock wierdness


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42205 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d1d65a79 15-Jun-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* malloc an array of pointers to hold active crt info, mode, limits, etc.
Plan to move gRegister into the crt struct at some point.
* Few style fixes
* Added function to probe edid of attached monitors and populate CRT info
* Disable VGA control modifications temporarly while I hammer out some issues.
* Fix radeon card model checks (bitwise & is not |)
* Finally fix? blanking start / end calculations using porch
* Use mask for setting sync polarity
* Add overscan (8 pixels is default?)
* Disable PLLSet/Power for the moment as it seems to muck things up.
* is_mode_supported now validates if a mode line is with the monitors
h/v sync frequencies (how does is_mode_supported know what crt the os wants?)
* PLL Write/Read don't actually use the PLL Write/Read functions (thanks AMD!)
* Added better PLL legacy (r600-r610) support
* Consistantly give no DCCG on legacy cards.
* Tracing!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42191 a95241bf-73f2-0310-859d-f6bbb57e9c96


# aa2a6e33 13-Jun-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Move to common MMIO function set to make card subsystem access easier

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42159 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d9e412b3 13-Jun-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Repair style issue using uintNN_t vs uintNN
* Make index numbering consistant (0-n vs 1-n)
* Add a little more tracing to PLLCalibrate because
we were missing a failure situation


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42158 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a604c049 13-Jun-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Small style fix to Calibration diff var and PLLCRTCGrab stored var
* Repair incorrect DCCG operation at end of PLLSet


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42149 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e7e76b29 12-Jun-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Define default PLL ranges
* Add crtid to register struct
* Disable VGA mode on FrameBuffer set (enables extended mode setting)
* Disable blanking calculations and setting more gracefully via if 0
* Add a *large* amount of code to Set/Calculate/Calibrate PLL
* Disable PLL on removal of accel.
* Remove junk comments on overscan
* Enable pixel clock limit pulling
* write32AtMask style cleanup
* Rename ReadMC to be more consistant
(I need to adjust naming for these MMIO calls)
* Implement read/write MC. (so many hardcoded oneoffs AMD)
* Implement write32PLLAtMask MMIO call


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42146 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9816a89ade7d73bb1aa1d813b876e0d5076aa22b 07-Jul-2015 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Move to a unified dp aux transaction function.

* Leverage a single common dp aux message struct.
* Likely lots of obvious bugs that need fixed still.
* Untested.


# 0de3a59590e46bda70bf3eb0e2d920c13349edd8 07-Jul-2015 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: ss_probe reads the pixel clock; set before calling.

* CID 743876


# 44b97460395f11be75f58cbfffbb454158bab4c3 10-Nov-2014 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Fix Spread Spectrum clock decimal place

* As 104Mhz is stores as 10400 on atombios,
and 104000 everywhere else... this conversion
was going the wrong direction.
* Shrink the stored value to 10Khz units to properly
compare to the AtomBIOS value


# 99f83552caedf630a20d657a4400bef011b2e856 26-May-2014 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Fix comment typo, no functional change


# e938ebdae0869ae7682fe8c9ed8e1178c52d0642 26-May-2014 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Rework PLL picking code

* Rewrote to be more efficient and more accurate.
* Fix a DP bug where we didn't choose the correct
external PLL.


# a8307efa4651dc952e6d54ed0016e1b7de464019 24-May-2014 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Improve pll probing. Let probe calls enable ss


# 2354b8ac00da0383f2e8d59620a64afb3118c500 01-May-2014 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Finish spread spectrum support

* This needs testing and is to remain disabled
until we can test on several radeon_hd cards
from multiple families


# f01af94ff7c271c955c2cce53262b3ba145c0b8d 01-May-2014 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Don't squash ss status_t into bool


# eb5224cf9deb2a44f67ccdcabea8148ba4c1f86e 02-Mar-2014 Julian Harnath <julian.harnath@rwth-aachen.de>

Oops, remove leftover "TODO" in comment


# de26f2e76291e3e6953d950709617c57a76bbeaa 02-Mar-2014 Julian Harnath <julian.harnath@rwth-aachen.de>

Make code a bit easier to read, add some comments

* No functional change intended


# 34d3dff3f5caef59b67669535a6f535dcaad7827 02-Mar-2014 Julian Harnath <julian.harnath@rwth-aachen.de>

Fix feedback divider value approximation

* The rounding algorithm here expects to start with the 2 digits
after the decimal point in pll->feedbackDivFrac. Multiplying with
1000 instead of 100 filled it with 3 digits.
The last step then set the fractional part to zero because it was
still too large.


# 224b875b3ad6ea9d7324377deb63d9087882092c 30-Dec-2013 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: clean up clock units

* Ensure we store all clock units as khz or
n * 10 off from AtomBIOS unit expected
* Perform DDC setup of external encoder


# 9c2d51d685b20c6b86f5cb39fb0ac95a864f4a26 29-Dec-2013 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: clean up encoder object

* Encoder flags were 1:1 connector flags...
just look at connector flags.
* Record encoder capabilities
* Add function to check for dp 1.2 support


# 00bc40ad588f4bd59cd7574788b5dc111b62198a 28-Jan-2013 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Fix DisplayPort link training

* Original changes by Bill Randle
* Includes a large number of modifications
and cleanups.
* Add a "currentMode" to the gDisplay to
enable easier checking of intended changes.
(we pass the display_mode around quite a
bit, adding a "currentMode" allows code
to know the intended display mode being set
without passing the mode pointer around as
much)


# a5ccd036b4a540462abe4d1347381344695b7fcf 14-Aug-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Become Spread Spectrum aware

* Enable Spread Spectrum when requested
* Tested working across several cards, does
have regression potential though.


# baa7999a48a2a0e147b439ef35491281cfef0613 14-Aug-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: slight adjustment to PLL choosing on DP


# d96e68765247f837b3787879cfcde72d3311d4d2 07-Aug-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: re-rework some pll code

* Grab pseudo pll SS info for early
Spread Spectrum access
* display_crtc_ss now takes a pll vs
a display for easy pll access


# 817c114de7e2e71d98adccb66358e94244a1486a 07-Aug-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: rework some pll code

* Force fractional feedback divider on APU's
* Spread Spectrum is now probed more correctly
across multiple encoders and cards
* SS still disabled however.


# 63624e404b5eb6fc11a503331e67ce29af074021 07-Aug-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: reorganize some pll code

* Move DisplayPort external pixel clock out of pll
as this frequency is card-wide.
* Add new function to pull display clock frequency
and other card-wide settings.
* Set displayDefault frequency card-wide
* My DisplayPort LVDS bridge laptop now kind of works
(a clock somewhere seems a little off though)


# 472744339b0b8190a4028a76bc8a940c178d6dad 06-Aug-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: pick a PLL based on connector

* was static PLL 1


# 4e7e3e331d4b0d1edfb94f52507b04163dc001f8 04-Aug-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: display port improvements

* Remove non-generic radeon dp_get_lane_count
* Set lane count and link rate at set_display_mode
* Pass entire mode to pll_set vs only pixel clock for DP code
* Add helpers for DP config data to common code
* Obtain more correct link rate


# ece8e7a85788cc1ac6641f3cea482e64e93fecea 06-Apr-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Fix pll DisplayPort endian bug.


# d8ac7e28ee2e685640d98f878fd6a55927f85f3e 24-Mar-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Fix DCE version check

* Trace cleanup
* Minimal change


# 151b4996221d7bc9db571d71efeb2929431bf936 22-Mar-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Add spread spectrum control functions

* Store SS information with PLL
* Probe SS information for PLL
* Disable SS more correctly
* May resolve mode setting issues on newer cards


# d07afea357fe15652695a8af88d315ea9838b367 22-Mar-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Fix AtomBIOS provided reference divider

* When AtomBIOS provides a reference divider, we should
still attempt to perform calculations using it vs
returning.


# 6728eddfa4faac6725c5f6ed99fddb342c0393ea 15-Mar-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Fix bugs in external DP bridge code

* non-external encoder will never be a DP bridge.
* use external encoder in places where needed.
* ensure we look at proper encoder for isDPBridge.


# 6da8db278635c0b56a151bc59151a4e9a02bce50 15-Mar-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

Revert "radeon_hd: Convert encoders to pointers"

This reverts commit 5a1f9f0f16b2a4bef89b61b4e3e24bf0b53917da.

* Thinking on this a bit more, this is really a silly change as
I know the upper limit for number of valid encoders.
* Resolves a app_server crash introduced as well due to not
allocating encoder pointer.


# 5a1f9f0f16b2a4bef89b61b4e3e24bf0b53917da 14-Mar-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Convert encoders to pointers

* Preparation for multiple encoders per connector


# c937ca1987565eae3496d16b3e8b1580c5f550a5 22-Feb-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

radeon_hd: Improve pll DP bridge code

* Only set DP bridge on DP bridge.
* Add a bit of tracing


# 8ff2ca22f7a66cbc29c2d128e352f801cb2fd620 16-Dec-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Complete code for DIG transmitter control

* Record external clock frequency (aka, DP non-pll)
* Add function to control DIG transmitter
* Cleanup duplicated is external code in encoder mode set


# c8677fb1384051cb147d53ff8e5d9f1f41a35201 14-Dec-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Working towards DP connector support

* Lots of new DisplayPort functions
* Call DP link training during mode set
* Rename dp_info variables to be less redundant
* Make encoder_pick_dig accept connector ID and
then check parent display
* Encode/Decode DP link speed functions
* Calculate DP lanes
* Rewrite encoder_dig_setup
* Correct bitsPerChannel to bitsPerColor
* My TRAVIS DisplayPort -> LVDS bridge now works


# 96587f13569659fa59abde67e430da426bb0a1ac 13-Dec-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Introduce new displayport source file

* Move existing displayport functions to new source file
* Move was done due to large amount of DP code
* Style fixes
* Stub out new DP link training function


# dc0d01abcdc64458f3d8b4965322b56474370d7f 10-Dec-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Cleanup. Move unions into functions that use them.

* Rename unions to match style guide lines
* Group things that make sense together
* Move AtomBIOS argument struct creation closer to what uses it


# 0cd5024dbb8c0b979798d10528cb8140470f129d 09-Dec-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Pointer style cleanup; Variable consolidation


# 61cf713381b5ef727d0b1d78306dacde4887b8f5 09-Dec-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Include file style cleanup, no functional change


# 654dc4bfabac752ddf61e5e55db77800dfccd531 09-Dec-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Use bridge encoder flag vs making direct calls to check


# 2944d7dab8f19ab3cc2c6c71efdf7ce6d35305bd 02-Dec-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Bug fix in drm driver, set EncoderID properly on pll_adjust


# dad34be3e1198fd37f4d2e7a0d42a20d3887847b 02-Dec-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Improve pll calculations dealing with DisplayPort devices

* rename encoder_isexternal to encoder_is_external
* add encoder_is_dp_bridge call for special DP cases
* add initial get_dp_link_clock, hard code a guess for now
* take external DP encoders into consideration when making
pixel clock adjustments


# 359b926f79d7e7ac697d6aaf28f704b5d5f1283f 08-Nov-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* style cleanup of shared storage names
* return better data on card
* display chipset flags in screen preflet


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43226 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 76a3e009ddb1b0c649bca1f84376ec2eb6c096c9 08-Nov-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* add lots of missing evergreen defines
* evergreen headers are split due to different
header copyrights
* detect and set up evergreen memory controler
* change the way we manage radeon chipsets to
more closely match drm driver as the chipset
model numbers aren't in order and change from
numbers to names.
* check for evergreen when populating frame buffer
information.
* style cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43225 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 025d4eed52f31e0047268227cde722164e52e2d8 27-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* reorganize register definitions
There were a large number if incorrect, duplicated, misplaced
registers that were leading to bugs in the code. This is my first
shot at cleaning them up. Luckly as we are using AtomBIOS the number
of registers we need to know about is shrinking.
* remove registers left over from register banging days
* r770 is less then r710, r720 in the drm sources. Fix in code.
* enable newer radeons for testing


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42930 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f089aa5229020b51c15e2fd294dcc5de269fdb5c 21-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* stub out dig encoder setup
* adjust pll post divider calculation
* fix digital encoder setup action
* don't run memreq on DCE < 3, should solve
some AtomBIOS failure loops


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42892 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a4f66979fe6b62e658496d993a65c95e0c9a138e 17-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* fix minimum pll out units
* sort files in Jamfile
* add TV and compontent video support in encoder code
* fix missing var in display detection code


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 756fb8b7964aedbadad260cec62997d753ddd401 17-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* fix pll limitations probing
* radeon HD mode setting on analog monitors is now working!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42877 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 86a5585b2d127c8cd8c8207db9904f8d9953e622 17-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* redo 42874 in the right direction
* fix a order of operations bug
* fix a few long lines
* pll computation should now be correct


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42876 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 96eb5a46fdc54393d4e279740542c1b970adaea4 17-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* increase tolerance checking as we store kHz vs 10kHz units


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42874 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 05a2fee65016aca7f143f1607580f5e28eb98238 17-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* add varying PLL calculations as directed by AtomBIOS
* don't set referenceDivider as minimum unless directed to by
AtomBIOS


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42873 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f66a1a8d71e68f2c725fa556af7b9983a85e057e 16-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* fix TODO style due to ML
* rename bpc to bitsPerChannel
* remove un-needed / unused PCI BAR reference
* no functional change


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42861 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5fd02779275f8a197a6988d961fb301674f0c6bf 15-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* add function to make pll flag adjustments
* bug fix of improper unit conversion


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42858 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cf1d1fb4ffb2cc4323b92a6d2f3c9a2cd1389a80 14-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* add function to probe pll timing limits from AtomBIOS
* rename *_* pll vars to match style guidelines
* refactor PLL calculation to be easier to read with
more central 10kHz unit conversions
* limited mode switching has been seen working including
a perfect 1280x1024@75


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42855 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c0fe7a011ba98044dd373433784b848e01659d4f 14-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* tweaks to pll calculation reference units.. make divisors match 10 kHz unit


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42854 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 245fe001e7ee6458a7a5cc1a4702e5697574cf5e 14-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* first shot at fixing pll calculations
AtomBIOS wants number of 10Khz Units
* better debugging after modeset on current
CRTC status


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42853 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e774cb4b0aea6ec99b8b9d8878c5ffbe79516ded 12-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* style fixes
move quite a bit of code away from var_var format
* #if 0 some not-yet-ready r500 code
* no real functional change


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42835 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6b49ba893183ec7d0c9a1231080e2c60fe33722e 12-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* style fixes, no functional change...
frev / crev to tableMajor / tableMinor
size to tableSize
offset to tableOffset


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42834 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6b0b621be9113080a339054cb3847201e5ed55dd 12-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* style fixes, no functional change...
automatic crtc_id -> crtcID
automatic pll_id -> pllID
automatic encoder_id -> encoderID
automatic connector_index -> connectorIndex
automatic encoder_flags -> encoderFlags


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42831 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 042bdcc0d24430a5af2dcda23e5439bd623926b7 12-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* complete pll_set for all AtomBIOS revisions
* add update of crtc encoder scratch registers
* rename id for more descriptive crtc_id
* encoder dpms, BL on/off on lcd


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42828 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 14493b1ecb3a2f1f6575d83d38f11cc95e7c1810 11-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* quick style fix before I forget, no functional change


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42827 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e7d0abae231f1fcd3fefc6bc963793c5d6756118 11-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* move pll info into pll_info struct.
* reduce the number of unique storage uint32's


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42826 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 82720f1cd0f4d1b7e5678ef3107e47b557cb4978 10-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* move pll info onto encoder
* add atombios PLL adjustment code
* add initial PLL clock flags


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42819 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1fca5eaf116609013ea078eac249e20fe8a87098 10-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* detect hdmi and tv and set as such
* set encoder flags the same as connector flags
* add curly comments to make troubleshooting clearer
* program encoder dpms scratch registers


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42818 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d0509b7eb93e3cb67b23fa5ccdd2fb789333370b 09-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* move encoder info into own struct
* rename some connector / encoder struct members
* improve debugging in connector / encoder
AtomBIOS walking


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42815 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7c91a33c84935f6697e246a985730400ec976d61 02-Oct-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* RIP Radeon register banging
Remove old non-atombios code
* add encoder.c and encoder.h to handle
encoder management
* fix pll code to use encoder object id
vs crtcid


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42797 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e53d637520ce91031ff9ac5ea4a5044156136a27 01-Sep-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* reformulate display and connector storage to match AtomBIOS requirements
* each active gDisplay references a gConnector index
* add atombios DAC sense.. this really won't be the main call used...
AtomBIOS expects you to attempt an EDID read to detect connected displays
* remove old manual DACSense
* next we attempt to add ddc / edid


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42705 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d3e8b64208159ab71ca24f58ec7e56f1aa4bb5e6 19-Aug-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* introduce mc control calls
* malloc storage for mc state info
* redo pll range struct
* change to ATOM_ENCODER_MODE for connector info
* redo pll calculations to match AtomBIOS requirements
* some structure changes
* no longer init already posted AtomBIOS as it
causes an infinite loop of AtomBIOS calls


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42644 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6da3f7d4c1de302697f5d948057a68dd428277f6 05-Aug-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* lots of changes
* add missing header for some radeon registers
* begin removing now un-needed direct register calls
* move and refactor crtc functions
* fix function naming to be clearer
* create more AtomBIOS style calls
* this will eat your cat at the moment, don't bother testing


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42582 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 95e1d7e8288c9eb390705b0fa6e735ff091a0e65 21-Jul-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Large refactoring of display detection and storage
* Create new display.c/h for display management
* Rename global gCRT to gDisplay
* Add CRT connection type into gDisplay
* Add CRT connection index into gDisplay
* Refactor registers for each display into gDisplay via regs
* We now shouldn't freak out too badly on multi-monitors


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42462 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3fe788377828eb76c862aa4e58c000086b41d884 11-Jul-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* remove superfluous parentheses as per Axel

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42411 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 414b6dd98edf3cb27b9f768367e17c38dd2a161a 11-Jul-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

DeadYak gave a better solution to r42407, simply typecast the defines as we don't want to modify the AMD radeon_hd register headers

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42409 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5da2e4639492406e1411d6e9c4aa6aa3b45889c7 11-Jul-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

prevent radeon_hd enumeral mismatch on powerpc/gcc4

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42407 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f2fe29a0db13c08df7d88755775246f91c290ebf 08-Jul-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Final (hopefully?) calculation for blank start/end
* Lets actually call PLLPower after PLLSet
* Improve screen blanking function
* Detect DAC/PLL to use separately from CRT id
* Add DACSense that senses displays on DACA/DACB
* Grab CRT in PLL code via gRegister crtid
* Set overscan to 0 for now
* Setting extended video modes now kinda works sometimes :-/


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42397 a95241bf-73f2-0310-859d-f6bbb57e9c96


# eb5c4b07451d6c397563ded8b26fe34167ccd332 07-Jul-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Style Cleanup
* Remove some un-needed test stuff
* Perform a little re-ordering
* Make scale corrections


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42390 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d97da786e193383df3de2bd0d7be4f01c0bd96a5 07-Jul-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Refactor PLL legacy registers to be pllIndex aware
* Rename PLL register vars to more closely match AMD defines
* Small logic fixes
* Fix pretty large PLLControlTable bug in legacy set.
Wasn't using output of PLLControlTable.
* Fix *REALLY* big bug in CRTCGrab.
Using PLL2 value instead of PLL1 due to incorrect
index offset of pllIndex.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42389 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b6c5f46896776d67f4b48af4584fb989dddda162 04-Jul-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Add D2 GRPH update lock register to priv headers
* Add crtControl global register
* Add grphUpdate storage
* Do some logical reordering of register writes
* Correct crt final power-on checks
* Enhance tracing
* Disable PLL, it is needed but seems to completely break
the modesetting resulting in black-screen-of-doom.
(fixing PLL set/calibration is now priority one)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42380 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 26e18b1f89e288096e932ccc958f0aa21edf040f 30-Jun-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

gcc2 buildfix; few style adjustments

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42347 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ab29dee1ed8775e78fbc93fd1e193fa8c5ff08da 16-Jun-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

A few style fixes, no functional change

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42207 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6604b1b62325b3f372c8f002a9311a50f2e10faf 16-Jun-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Break DAC code into sperate source file
* Implement assigning DAC A/B to crt
* Clean up mode change code
* Still some pixel clock wierdness


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42205 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d1d65a79cbba5eb871c2763824839ee56930a557 15-Jun-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* malloc an array of pointers to hold active crt info, mode, limits, etc.
Plan to move gRegister into the crt struct at some point.
* Few style fixes
* Added function to probe edid of attached monitors and populate CRT info
* Disable VGA control modifications temporarly while I hammer out some issues.
* Fix radeon card model checks (bitwise & is not |)
* Finally fix? blanking start / end calculations using porch
* Use mask for setting sync polarity
* Add overscan (8 pixels is default?)
* Disable PLLSet/Power for the moment as it seems to muck things up.
* is_mode_supported now validates if a mode line is with the monitors
h/v sync frequencies (how does is_mode_supported know what crt the os wants?)
* PLL Write/Read don't actually use the PLL Write/Read functions (thanks AMD!)
* Added better PLL legacy (r600-r610) support
* Consistantly give no DCCG on legacy cards.
* Tracing!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42191 a95241bf-73f2-0310-859d-f6bbb57e9c96


# aa2a6e33cb7617a18592ef2d97b00b5f5f936ecd 13-Jun-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Move to common MMIO function set to make card subsystem access easier

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42159 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d9e412b3394847a98fb7bcf85daa3ee59bb765fc 13-Jun-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Repair style issue using uintNN_t vs uintNN
* Make index numbering consistant (0-n vs 1-n)
* Add a little more tracing to PLLCalibrate because
we were missing a failure situation


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42158 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a604c049651dd618e7fefad86deb63e2ea83ee42 13-Jun-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Small style fix to Calibration diff var and PLLCRTCGrab stored var
* Repair incorrect DCCG operation at end of PLLSet


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42149 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e7e76b29e839204be635b9f10dd52a41837e20bd 12-Jun-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

* Define default PLL ranges
* Add crtid to register struct
* Disable VGA mode on FrameBuffer set (enables extended mode setting)
* Disable blanking calculations and setting more gracefully via if 0
* Add a *large* amount of code to Set/Calculate/Calibrate PLL
* Disable PLL on removal of accel.
* Remove junk comments on overscan
* Enable pixel clock limit pulling
* write32AtMask style cleanup
* Rename ReadMC to be more consistant
(I need to adjust naming for these MMIO calls)
* Implement read/write MC. (so many hardcoded oneoffs AMD)
* Implement write32PLLAtMask MMIO call


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42146 a95241bf-73f2-0310-859d-f6bbb57e9c96