History log of /drivers/gpu/drm/radeon/atombios_crtc.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1b61925061660009f5b8047f93c5297e04541273 01-Feb-2012 Michel Dänzer <michel.daenzer@amd.com> drm/radeon: Set DESKTOP_HEIGHT register to the framebuffer (not mode) height.

The value of this register is transferred to the V_COUNTER register at the
beginning of vertical blank. V_COUNTER is the reference for VLINE waits and
goes from VIEWPORT_Y_START to VIEWPORT_Y_START+VIEWPORT_HEIGHT during scanout,
so if VIEWPORT_Y_START is not 0, V_COUNTER actually went backwards at the
beginning of vertical blank, and VLINE waits excluding the whole scanout area
could never finish (possibly only if VIEWPORT_Y_START is larger than the length
of vertical blank in scanlines). Setting DESKTOP_HEIGHT to the framebuffer
height should prevent this for any kind of VLINE wait.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=45329 .

CC: stable@vger.kernel.org
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
9aa59993e226af94088adaee993eb8cfd33ae295 20-Jan-2012 Alex Deucher <alexander.deucher@amd.com> drm/radeon/kms: refine TMDS dual link checks

HDMI 1.3 defines single link clocks up to 340 Mhz.
Refine the current dual link checks to only enable
dual link for DVI > 165 Mhz or HDMI > 340 Mhz if the
hw supports HDMI 1.3 (DCE3+).

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=44755

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
3fa47d9efa6a0f5123e26e2c3ad54e3e1a1d108d 20-Jan-2012 Alex Deucher <alexander.deucher@amd.com> drm/radeon/kms: move disp eng pll setup to init path

We really only need to set it up once on init or resume
rather than on every mode set.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
06e4cd64174b48345cbd99179b780a2bf4f96ab6 20-Dec-2011 Dave Airlie <airlied@redhat.com> drm/radeon/kms: don't use 0 bpc for adjusting hdmi clock

If the bpc is set from the connector is 0, we then use it later to adjust
in a special case the HDMI pixel clock, however if the bpc is 0, we end up
passing a 0 pixel clock into the code.

I'm not sure if this is the correct answer or if we should avoid the HDMI
clock adjustment for 0 values.

This fixes a divide by 0 on my Llano system with a HDMI monitor and hdmi
audio enabled.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
1fbe6f625f69e48c4001051dc1431afc704acfaa 20-Dec-2011 Dave Airlie <airlied@redhat.com> Merge tag 'v3.2-rc6' of /home/airlied/devel/kernel/linux-2.6 into drm-core-next

Merge in the upstream tree to bring in the mainline fixes.

Conflicts:
drivers/gpu/drm/exynos/exynos_drm_fbdev.c
drivers/gpu/drm/nouveau/nouveau_sgdma.c
01f2c7730e188077026c5f766f85f329c7000c54 19-Dec-2011 Ville Syrjälä <ville.syrjala@linux.intel.com> drm: Replace pitch with pitches[] in drm_framebuffer

Otherwise each driver would need to keep the information inside
their own framebuffer object structure. Also add offsets[]. BOs
on the other hand are driver specific, so those can be kept in
driver specific structures.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
392e37229f0d6358dcc7b43641df776e9f62a6e6 28-Nov-2011 Alex Deucher <alexander.deucher@amd.com> drm/radeon/kms: fix scanout of 2D tiled buffers on EG/CM

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=43191

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
10b391b946c459a39b631aaf81880f94dcfbff46 04-Nov-2011 Alex Deucher <alexander.deucher@amd.com> drm/radeon/kms: remove extraneous calls to radeon_pm_compute_clocks()

It's already called via the DPMS functions.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
996d5c59006cd970dd3a9007aa1f76532909bae2 26-Oct-2011 Alex Deucher <alexander.deucher@amd.com> drm/radeon/kms: check for DP MST mode in a few more places (v2)

DP MST is DP multi-stream support, part of DP 1.2.

v2: switch to a helper macro as suggested by Michel.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
1d33e1fc8dcce667a70387b666a8b6f60153d90f 31-Oct-2011 Alex Deucher <alexander.deucher@amd.com> drm/radeon/kms: rework DP bridge checks

Return the encoder id rather than a boolean. This is needed
for differentiate between multiple DP bridge chips.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
b4f15f808b9a79b6ad9032fa5f6d8b88e1e1bf11 25-Oct-2011 Alex Deucher <alexander.deucher@amd.com> drm/radeon/kms: cleanup atombios_adjust_pll()

The logic was messy and hard to follow.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
09cc6506f9e234b2ead60398ebb88c4b44421a93 13-Oct-2011 Alex Deucher <alexander.deucher@amd.com> drm/radeon/kms/DCE4.1: ss is not supported on the internal pplls

It's handled via external clock. It should already be protected
by the external ss flag, but add an explicit check just in case.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
f1bece7fde9820a99c14d4db46ef071000e4ba47 13-Jul-2011 Benjamin Herrenschmidt <benh@kernel.crashing.org> drm/radeon: ATOM Endian fix for atombios_crtc_program_pll()

v6 of the structure was programmed incorrectly:

args.v6.ulCrtcPclkFreq.ulPixelClock = cpu_to_le32(clock / 10);

ulPixelClock is a 24-bit bitfield. This statement would thus
do a 32-bit swap of (clock / 10) and drop the top 8 bits which
are ... the LSB. Not what we want. Instead use masks & shifts.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
cc9f67a0a0b076b82ab1af3b2add82e19a33d5de 16-Jun-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/atom: AdjustPixelClock fixes for DP bridges

Need to set the external transmitter type properly in
AdjustPixelClock to get the properly output.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
adcfde516e10aad72d66f6fefd36e6d0e6bd7be7 27-May-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: viewport height has to be even

Otherwise, no vblank interrupts.
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=37522

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
d0ae3e890b5afbfdc80ffe9d4b7299b779daaa6a 23-May-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: fix typo in spread spectrum code

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
2307790f0c8dea7d8052805a8209fbd67e815e72 20-May-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: the SS_Id field in the LCD table if for LVDS only

For DP/eDP, always use the standard DP SS indices.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
6f15c506e0cec601fad9fabb7ded0d1811b8002f 20-May-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: properly set the CLK_REF bit for DCE3 devices

If the ss clock is external, the CLK_REF bit needs to be set
in the SetPixelClock parameters. This should fix DP failures
in the channel equalization loop.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
eac4dff6d3edc0aea1941db16c03ae19aa628a3c 20-May-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: handle DP bridges

Fusion hardware often has DP to VGA/LVDS/TMDS bridges to
handle non-DP encoders. Internally we treat them mostly
like DP.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
86a94defe2b88380c28547d7053633b26a397d42 20-May-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: fix up DP clock programming on DCE4/5

In DP mode, the DP ref clock can come from PPLL, DCPLL, or ext clock,
depending on the asic. The crtc virtual pixel clock is derived from
the DP ref clock.

- DCE4: PPLL or ext clock
- DCE5: DCPLL or ext clock

Setting ATOM_PPLL_INVALID will cause SetPixelClock to skip
PPLL/DCPLL programming and only program the DP DTO for the
crtc virtual pixel clock.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
8e8e523d865490e95ed7c9d2e173c02648d6be90 20-May-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: spread spectrum fixes

- properly mask the ss type
- don't enable ss if type is external or percentage is 0
- if ss enabled and type is external, set ref_div_src to ext clock
- prefer ASIC_INTERNAL_SS_ON_DP to LCD_Info SS_Id for eDP
- fix ss amount calculation

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
df271bec805b42527d864777ed035fcbb42e76c0 20-May-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: properly handle bpc >8 in atom command tables

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
5785e53ffa73f77fb19e378c899027afc07272bc 19-Apr-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: pll tweaks for r7xx

Prefer min m to max p only on pre-r7xx asics.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=36197

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
9bb09fa1b5b07459279301ac6220d575f307597b 07-Apr-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: pll tweaks for rv6xx

Prefer minm over maxp.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=35994

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
fb9674bd2cd3c18f6c756ee123967e43be501263 02-Apr-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: pageflipping cleanup for avivo+

Avoid touching the flip setup regs while
acceleration is running. Set them at modeset
rather than during pageflip. Touching these
regs while acceleration is active caused hangs
on pre-avivo chips. These chips do not seem
to be affected, but better safe than sorry,
plus it avoids repeatedly reprogramming the
regs every flip.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
64146f8b2af1ba77fe3c21d9d6d7213b9bb72b40 22-Mar-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: prefer legacy pll algo for tv-out

ntsc seems to work fine with either algo, some
pal TVs seem pickier.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=30832

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
942b0e95c34f1ba432d08e1c0288ed032d32c3b2 15-Mar-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: fix typo in atom overscan setup

Typo in the aspect scale setup.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
34db18abd376b2075c760c38f0b861aed379415d 14-Mar-2011 Dave Airlie <airlied@redhat.com> Merge remote branch 'intel/drm-intel-next' of ../drm-next into drm-core-next

* 'intel/drm-intel-next' of ../drm-next: (755 commits)
drm/i915: Only wait on a pending flip if we intend to write to the buffer
drm/i915/dp: Sanity check eDP existence
drm/i915: Rebind the buffer if its alignment constraints changes with tiling
drm/i915: Disable GPU semaphores by default
drm/i915: Do not overflow the MMADDR write FIFO
Revert "drm/i915: fix corruptions on i8xx due to relaxed fencing"
drm/i915: Don't save/restore hardware status page address register
drm/i915: don't store the reg value for HWS_PGA
drm/i915: fix memory corruption with GM965 and >4GB RAM
Linux 2.6.38-rc7
Revert "TPM: Long default timeout fix"
drm/i915: Re-enable GPU semaphores for SandyBridge mobile
drm/i915: Replace vblank PM QoS with "Interrupt-Based AGPBUSY#"
Revert "drm/i915: Use PM QoS to prevent C-State starvation of gen3 GPU"
drm/i915: Allow relocation deltas outside of target bo
drm/i915: Silence an innocuous compiler warning for an unused variable
fs/block_dev.c: fix new kernel-doc warning
ACPI: Fix build for CONFIG_NET unset
mm: <asm-generic/pgtable.h> must include <linux/mm_types.h>
x86: Use u32 instead of long to set reset vector back to 0
...

Conflicts:
drivers/gpu/drm/i915/i915_gem.c
7e4d15d90afe46d34b510f3c70217d3469a7dd70 18-Feb-2011 Daniel Vetter <daniel.vetter@ffwll.ch> drm/radeon: introduce gem_to_radeon_bo helper

... and switch it to container_of upcasting.

v2: converted new pageflip code-paths.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
9f4283f49f0a96a64c5a45fe56f0f8c942885eef 17-Feb-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: add missing frac fb div flag for dce4+

The fixed ref/post dividers are set by the AdjustPll table
rather than the ss info table on dce4+. Make sure we enable
the fractional feedback dividers when using a fixed post
or ref divider on them as well.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=29272

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
5b40ddf888398ce4cccbf3b9d0a18d90149ed7ff 14-Feb-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: hopefully fix pll issues for real (v3)

The problematic boards have a recommended reference divider
to be used when spread spectrum is enabled on the laptop panel.
Enable the use of the recommended reference divider along with
the new pll algo.

v2: testing options

v3: When using the fixed reference divider with LVDS, prefer
min m to max p and use fractional feedback dividers.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=28852
https://bugzilla.kernel.org/show_bug.cgi?id=24462
https://bugzilla.kernel.org/show_bug.cgi?id=26552
MacbookPro issues reported by Justin Mattock <justinmattock@gmail.com>

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
265aa6c8d8822c9074a2174e8c9f31a37fa02e50 14-Feb-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: fix a few more atombios endian issues

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
4589433c57bd34b7e49068549e07a43c8d41e39d 12-Feb-2011 Cédric Cano <ccano@interfaceconcept.com> drm/radeon/kms: atombios big endian fixes

agd5f: additional cleanups/fixes

Signed-off-by: Cédric Cano <ccano@interfaceconcept.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
c9417bdd4c6b1b92a21608c07e83afa419c7bb62 06-Feb-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: fix interlaced modes on dce4+

- set scaler table clears the interleave bit, need to
reset it in encoder quirks, this was already done for
pre-dce4.
- remove the interleave settings from set_base() functions
this is now handled in the encoder quirks functions, and
isn't technically part of the display base setup.
- rename evergreen_do_set_base() to dce4_do_set_base() since
it's used on both evergreen and NI asics.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=28182

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
619efb105924d8cafa0c1dd9389e9ab506f5425d 31-Jan-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: Enable new pll calculation for avivo+ asics

New algo is used for r5xx+ and legacy is used for
r1xx-r4xx, rv515.

I've tested on all relevant GPUs and monitors that I
have access to and have found no problems.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=26562
https://bugzilla.kernel.org/show_bug.cgi?id=26552
May fix:
https://bugs.freedesktop.org/show_bug.cgi?id=32556

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
f523f74eac1897b13c05c88ce6e5de0a7c34578b 31-Jan-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: add new pll algo for avivo asics

Based on the vbios code. This should hopefully
fix the pll problems on a number of avivo asics
once it's enabled.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
fa6bee46a655a750afb9a78a7ddf9a3bcda97db8 25-Jan-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: fix r6xx+ scanout on BE systems

R6xx+ have per-block swappers. BE content in the
framebuffer will now be swapped properly during scanout.
Untested, however, the same code is reported working in
the UMS ddx.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
b526ce2264e93b64853478ae50725a30c1dc7abf 21-Jan-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: simplify atom adjust pll setup

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
a572eaa3726968555451ba301ff8c61e90e8c278 07-Jan-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: DCE5 atom spread spectrum updates

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
f82b3ddc5fac044a28ab841bfd4ae48e2e43a21b 07-Jan-2011 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: DCE5 atom SetPixelClock updates

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
a93f344d3c04e4b84490c65f2a574387c593be40 20-Dec-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: reorder display resume to avoid problems

On resume, we were attemping to unblank the displays before the
timing and plls had be reprogrammed which led to atom timeouts
waiting for things that are not yet programmed. Re-program
the mode first, then reset the dpms state.

This fixes the infamous atombios timeouts on resume.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
e5fd205f28f83b3514dc5049b2d1388b10065a6d 13-Dec-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: disable ss fixed ref divide

Seems to cause problems on certain laptops

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=24462

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Tested-by: Luca Tettamanti <kronos.it@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
21c74a8ea8b47eb6c3c621e36578f6e27f65c5c7 13-Oct-2010 Jason Wessel <jason.wessel@windriver.com> drm, kdb, kms: Change mode_set_base_atomic() enter argument to be an enum

The enter argument as implemented by commit 413d45d3627 (drm, kdb, kms:
Add an enter argument to mode_set_base_atomic() API) should be more
descriptive as to what it does vs just passing 1 and 0 around.

There is no runtime behavior change as a result of this patch.

Reported-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
CC: David Airlie <airlied@linux.ie>
CC: dri-devel@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
5480f727dc4c049eb46b191bfaeb034067aa6835 19-Oct-2010 Dave Airlie <airlied@redhat.com> Revert "drm/radeon/kms: remove some pll algo flags"

This reverts commit f28488c282d8916b9b6190cc41714815bbaf97d5.

On my rv610 test machine the monitor failed to light up after this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
26bf62e47261142d528a6109fdd671a2e280b4ea 05-Oct-2010 Dave Airlie <airlied@redhat.com> Merge branch 'drm-radeon-next' of ../drm-radeon-next into drm-core-next

* 'drm-radeon-next' of ../drm-radeon-next:
drm/radeon/kms: add drm blit support for evergreen
drm/radeon: Modify radeon_pm_in_vbl to use radeon_get_crtc_scanoutpos()
drm/radeon: Add function for display scanout position query.
drm/radeon/kms: rework spread spectrum handling
drm/radeon/kms: remove new pll algo
drm/radeon/kms: remove some pll algo flags
drm/radeon/kms: prefer high post dividers in legacy pll algo
drm/radeon/kms: properly handle 40 bit MC addresses in the cursor code
drm/radeon: add properties to configure the width of the underscan borders
drm/radeon/kms/r6xx+: use new style fencing (v3)
drm/radeon/kms: enable writeback (v2)
drm/radeon/kms: clean up r6xx/r7xx blit init (v2)
413d45d3627be4748058dea697718ed6fb88bd01 26-Sep-2010 Jason Wessel <jason.wessel@windriver.com> drm, kdb, kms: Add an enter argument to mode_set_base_atomic() API

Some devices such as the radeon chips receive information from user
space which needs to be saved when executing an atomic mode set
operation, else the user space would have to be queried again for the
information.

This patch extends the mode_set_base_atomic() call to pass an argument
to indicate if this is an entry or an exit from an atomic kernel mode
set change. Individual drm drivers can properly save and restore
state accordingly.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
CC: Jesse Barnes <jbarnes@virtuousgeek.org>
CC: David Airlie <airlied@linux.ie>
CC: dri-devel@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
4dd19b0dd79c2bfe04a7a19bea0caf9284695cb4 26-Sep-2010 Chris Ball <cjb@laptop.org> drm/radeon/kms: Implement KDB debug hooks for radeon KMS.

Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
CC: Jesse Barnes <jbarnes@virtuousgeek.org>
CC: dri-devel@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
ba032a58d1f320039e7850fb6e8651695c1aa571 04-Oct-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: rework spread spectrum handling

This patch reworks spread spectrum handling to enable it
properly on lvds and DP/eDP links. It also fixes several
bugs in the old spread spectrum code.

- Use the ss recommended reference divider if available
when calculating the pll
- Use the proper ss command tables on pre-DCE3 asics
- Avoid reading past the end of the ss info tables
- Enable ss on evergreen asics (lvds, dp, tmds)
- Enable ss on DP/eDP links

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
48dfaaeb6637240af3089bf9b7a00a6cf24e0182 29-Sep-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: remove new pll algo

The recent changes to the old algo (prefer high post div)
coupled with the range and precision limitations of using
fixed point with the new algo make the new algo less
useful. So drop the new algo. This should work as well
or better than the old new/old combinations and simplifies
the code a lot.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=30218
among others.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
f28488c282d8916b9b6190cc41714815bbaf97d5 29-Sep-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: remove some pll algo flags

These shouldn't be needed with the post div changes
in the last patch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
f90087eea44ce5fad139f086bc9d89ca37b0edc2 07-Sep-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: force legacy pll algo for RV620 LVDS

There has been periodic evidence that LVDS, on at least some
panels, prefers the dividers selected by the legacy pll algo.
This patch forces the use of the legacy pll algo on RV620
LVDS panels. The old behavior (new pll algo) can be selected
by setting the new_pll module parameter to 1.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=30029

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
54bfe496cec7586f76f713a277435dd3ac6fd4c4 03-Sep-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: fix tv-out on avivo asics

digital underscan support regressed tv-out.

fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=29985

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
95347871865ca5093c7e87a223274f7c3b5eccda 01-Sep-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: properly set crtc high base on r7xx

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
0d9958b18e10d7426d94cc3dd024920a40db3ee2 01-Sep-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: force legacy pll algo for RV515 LVDS

There has been periodic evidence that LVDS, on at least some
panels, prefers the dividers selected by the legacy pll algo.
This patch forces the use of the legacy pll algo on RV515
LVDS panels. The old behavior (new pll algo) can be selected
by setting the new_pll module parameter to 1.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
fbee67a65d16c431ae3c389db13688c6e1b1b9d8 16-Aug-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: DCE3/4 AdjustPixelPll updates

Add options necessary bits for:
- SS on DP
- SS on LVDS
- set clocks right for DP
- deep color on hdmi (needs additional encoder and edid work as well)

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
5b1714d386a2f0c0d270e3abe1ac39ad1b0ba010 04-Aug-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: enable underscan option for digital connectors

This connector attribute allows you to enable or disable underscan
on a digital output to compensate for panels that automatically
overscan (e.g., many HDMI TVs). Valid values for the attribute are:

off - forces underscan off
on - forces underscan on
auto - enables underscan if an HDMI TV is connected, off otherwise

default value is auto.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
d9fdaafbe912a34ef06ed569c6606fe2811f325b 02-Aug-2010 Dave Airlie <airlied@redhat.com> drm/radeon/kms: move a bunch of modesetting debug to correct debug usage.

This migrates a bunch of DRM_DEBUG->DRM_DEBUG_KMS so we can get more modesetting related info without all the other ioctl handling easily.

Also the PM code moves to DRM_DEBUG_DRIVER mostly.

Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
97d663285322b3db05613d274b1eb3f9806f37ca 20-May-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: Add crtc tiling setup support for evergreen

Needed for scanning out of a tiled buffer.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
40c4ac1c1931eb48ca0cf5e9ec464d13c5921994 20-May-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: Add crtc tiling setup support for r6xx/r7xx

Needed for scanning out of a tiled buffer.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
37f9003bd355d9109769fff66f7f228aab42155b 11-Jun-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/atom: add crtc disable function

Disables the crts as per dpms and also disables the ppll
associated with the crtc. This should save additional power.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
2ff776cf77f1837a0397bc876e086e8a54274b09 09-Jun-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: disable frac fb dividers for rs6xx

Should fix fdo bug 28331:
https://bugs.freedesktop.org/show_bug.cgi?id=28331

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
921d98b58285805d792257e311da9e920eb5d73e 26-May-2010 Stefan Richter <stefanr@s5r6.in-berlin.de> drm/radeon/kms: suppress a build warning (unused variable)

At least 'make CONFIG_DEBUG_SECTION_MISMATCH=y' causes
drivers/gpu/drm/radeon/atombios_crtc.c: In function 'atombios_crtc_set_pll':
drivers/gpu/drm/radeon/atombios_crtc.c:684: warning: 'pll' may be used uninitialized in this function
which has the looks of a falso positive.

Add a default: case so that gcc rests assured that all possible pll_id's are covered.
Keep the present cases that fall through to the default one for self-documentation.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
d7311171c4cc8d6231427f7ac5056b939a184b80 03-May-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/pm: add support for no display power states

The lowest power states often cause display problems, so only enable
them when all displays are off.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
68adac5e49436992e9c999fbae879d9ac5b72d4e 28-Apr-2010 Ben Skeggs <bskeggs@redhat.com> drm: move radeon_fixed.h to shared drm_fixed.h header

Will be used by nouveau driver also in the near future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
a48b9b4edb8bb87deb13b9f088a595cf71457b69 22-Apr-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/pm: add asic specific callbacks for getting power state (v2)

This also simplifies the code and enables reclocking with multiple heads
active by tracking whether the power states are single or multi-head
capable.

Eventually, we will want to select a power state based on external
factors (AC/DC state, user selection, etc.).

(v2) Update for evergreen

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
03214bd5c6e59c83703238227254deef8810513d 16-Mar-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/pm: move pm state update to crtc functions

crtcs are what we ultimately care about wrt to pm.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
153549b8b63d71a9c5d8cbde887097b995c32bd6 20-Apr-2010 Dave Airlie <airlied@redhat.com> Merge branch 'drm-radeon-evergreen-accel' into drm-core-next

* drm-radeon-evergreen-accel:
drm/radeon: fix cypress firmware typo.
drm/radeon/kms/evergreen: add hpd support
drm/radeon/kms/evergreen: implement irq support
drm/radeon/kms/evergreen: setup and enable the CP
drm/radeon/kms/evergreen: implement gfx init
drm/radeon/kms/evergreen: add soft reset function
drm/radeon/kms/evergreen: add gart support
drm/radeon/kms: add support for evergreen power tables
drm/radeon/kms: update atombios.h power tables for evergreen
a1a4b23b66039c814c3d3a9a28d76d34800eadc5 09-Apr-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: adjust pll settings for tv

May fix fdo bug 26582.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
45f9a39bedc3afab3fc85567792efc0103f34a55 24-Mar-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/evergreen: implement irq support

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
9f998ad7e92a1653b6b396b1278e75560a8be519 30-Mar-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: minor fixes for eDP with LCD* device tags (v2)

Some systems have LCD* rather than DFP* device tags in the bios
for eDP connectors; notably the new apple iMac. This fixes
things up so eDP connectors with either tag will work.

v2: fix typo

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
a084e6ee6e64a76f1a9665d527203cdab7d6048f 18-Mar-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/atom: make sure tables are valid (v2)

Check that atom cmd and data tables are valid
before using them.

(v2)
- fix some whitespace errors noticed by Rafał Miłecki
- check a few more cases

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
c1bcad9d16831859373d8f579fa1e146409f9960 18-Mar-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: remove lvds quirks

- no longer needed with the latest new pll algo fixes.
- also don't use lcd pll limits. They don't seem
to work well for all systems. If we have a case where
they are useful, we can set the flag for that case.

fixes fdo bug 27083

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
267364ac17f6474c69b03034340f769b22f46105 08-Mar-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: further spread spectrum fixes

Adjust modeset ordering to fix spread spectrum.
The spread spectrum command table relies on the
crtc routing to already be set in order to work
properly on some asics.

Should fix fdo bug 25741.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
86cb2bbfda2cf402aee46779ee90bbb7d915482b 08-Mar-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: use lcd pll limits when available

The bios has alternate pll output limits for LCD panels.
If available, use these for pll divider calculations.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
b792210e7d1f9fb102061e2016da96cf2ad5cdbd 06-Mar-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/atom: spread spectrum fix

The atom spread spectrum table does not always
disable ss. Explicitly disable it and then use
the atom table to enable later if needed (currently
only used for LVDS).

Fixes display issues on some systems.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
383be5d1789d9a7a2e77dca1cb0aca89507d069e 23-Feb-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: update new pll algo

- add support for pre-avivo chips
- add support for fixed post/ref dividers
- add support for non-fractional fb dividers

By default avivo chips use the new algo and
pre-avivo chips use the old algo. Use the "new_pll"
module option to toggle between them.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
12d7798f71107e7f4391a532af8c6690bda16f66 09-Feb-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/evergreen: fix multi-head

Fix a typo in crtc offset setup that set the crtc
instances wrong for all crtcs except the first.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
37b4390ec7f12f82e47a2ef56dccee094f26d34f 09-Feb-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/atom: replace 0/1 in crtc code with ATOM_DISABLE/ATOM_ENABLE

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
bcc1c2a1d22974215e39dc87ce746ba9a39223e5 12-Jan-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: add initial Evergreen support (Radeon HD 5xxx)

This adds initial Evergreen KMS support, it doesn't include
any acceleration features or interrupt handling yet.

Major changes are DCE4 handling for PLLs for the > 2 crtcs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
26b9fc3ab13587d4e86b217be43d1fb7ca934576 01-Feb-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/atom: clean up spread spectrum code

use a union for the atom args.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
7c27f87d2bde885e9bcda74c208a7aae8bef8e76 02-Feb-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: rework pll algo selection

Rework the pll algo selection so that the pll algo
in use can be selected more easily. This allows
us to select different pll divider selection algos
for specific monitors that work better with one algo
or the other. This is needed for the next patch which
adds an LVDS pll quirk for a specific notebook.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
f2ab3a13d2cbe19426c27c35a014c98212e914a5 25-Jan-2010 Dave Airlie <airlied@redhat.com> drm/radeon/kms: drop unnecessary printks.

These printks aren't required anymore.

Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
4eaeca33512b9774c25507b9a9bdcfe3791a5cc5 19-Jan-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: clean up atombios pll code

- split pll adjust into a separate function
- use a union for SetPixelClock params

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
fc10332b8ac5ca32d11f898027d84c007543bd80 19-Jan-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: clean up pll struct

- add a new flag for fixed post div
- pull the pll flags into the struct

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
a348c84d953f61c776e53cde0a63a4e407a23c18 21-Jan-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/atom: fix crtc lock ordering

This makes crtc_prepare and crtc_commit match.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
615e0cb67968c94fd9e53797985843a5b816dec4 20-Jan-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/r4xx: cleanup atom path

most of radeon_legacy_atom_set_surface() is taken care
of in atombios_set_base(), so remove the duplicate
setup and move the remaining bits (DISP_MERGE setup and
FP2 sync) to atombios_crtc.c where they are used.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
/drivers/gpu/drm/radeon/atombios_crtc.c
54f088a9603dbee88809cb2ddfd8dc1ef8a74be5 19-Jan-2010 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: fix atombios_crtc_set_base

Make it call the proper backend depending on the
GPU family. Right now r4xx cards with atombios modesetting
enabled were using the avivo crtc base code. This also
allows us to add support for new asics more easily.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
/drivers/gpu/drm/radeon/atombios_crtc.c
b27b63750d912e80d61d2120c4a1664062d0f808 09-Dec-2009 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/avivo: add support for new pll selection algo

Supported on all AVIVO-based asics.
Can be disabled via the new_pll module parameter:
new_pll=0 - disable
new_pll=1 - enable
enabled by default

[airlied: fixed to use do_div]
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
/drivers/gpu/drm/radeon/atombios_crtc.c
cf2f05d30dacab32e6866347be6cbfa4030b33b7 08-Dec-2009 Dave Airlie <airlied@redhat.com> drm/radeon/kms: fix avivo tiling regression since radeon object rework

The object rework moved the tiling flag setup around wrongly,
so tiling we getting setup then overwritten by fb format.

Fixes regression with drm-radeon-next on rv530 laptop tiling test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
2a008d0ccde4ce59a2714e132d5f86a0771e6422 04-Dec-2009 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: more r4xx lvds fixes

Grab pll ref div from regs at driver init. r4xx seems very
picky about the dividers for the pll driving lvds.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
500b758725314ab1b5316eb0caa5b0fa26740e6b 02-Dec-2009 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: handle vblanks properly with dpms on

avivo chips

Copied from pre-avivo code.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
4c7886791264f03428d5424befb1b96f08fc90f4 20-Nov-2009 Jerome Glisse <jglisse@redhat.com> drm/radeon/kms: Rework radeon object handling

The locking & protection of radeon object was somewhat messy.
This patch completely rework it to now use ttm reserve as a
protection for the radeon object structure member. It also
shrink down the various radeon object structure by removing
field which were redondant with the ttm information. Last it
converts few simple functions to inline which should with
performances.

airlied: rebase on top of r600 and other changes.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
2de3b4841f67a15c7b8e820b84dd6b7cc41370da 17-Nov-2009 Jerome Glisse <jglisse@redhat.com> drm/radeon/kms: fix oops when set_base is call with no FB

Just do nothing if crct_set_base() is called with no FB.

The oops happens when the user switches between X & vt or in some case
when changing mode.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
d11aa88b33b071d55181a7a482b9e7494888c10e 28-Oct-2009 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/atom: fix potential oops in spread spectrum code

Make sure we have an LVDS encoder before casting enc_priv.

[airlied: also fix two missing cpu_to_le16 casts we noticed on irc]

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
d56ef9c8fd34ed29ffae27598a864b4a9a82521b 27-Oct-2009 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/atom: Fix DVO support

DVO in 12 bit mode (which seems to be the most common
config) requires 2x ppll.

Fixes fdo bug 21857.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
ebbe1cb936dfc96d809ccf4d64a9755f8ba0c0ff 16-Oct-2009 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/atom: add support for spread spectrum (v2)

Spread spectrum is a periodic disturbance added
to the feedback divider to change the pixel clock
periodically to reduce interference.

Only enabled on LVDS.

v2: add support for r4xx and fix DCE 3

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
c290dadf4cac25cc91529d84004795ab43fc0821 22-Oct-2009 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/r7xx: add regs for 40 bit CUR/GRPH addresses

The *_HIGH regs are reversed. The secondary ones are in the
primary block and vice versa.

We currently only use a 32 bit internal address, so these are
0 for now.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
ceefedd8e8a80b743fa0b6d6b1992be7029a9efb 14-Oct-2009 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/atom: fix tv-out

D1MODE_INTERLEAVE_EN was getting set in some cases
in the encoder quirks function due to the changes in
5a9bcacc0a56f0d9577494e834519480018a6cc3

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
39deb2d67515086f08a672e7574716ca0d3883a5 12-Oct-2009 Dave Airlie <airlied@redhat.com> drm/radeon/kms: fix use of index before proper initialisation.

With the adjust table introduction, we need to fill out index
before getting the table version.

Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
5a9bcacc0a56f0d9577494e834519480018a6cc3 08-Oct-2009 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/atom: rework crtc modeset

- clean up tv timing handling
- unify SetCRTC_Timing and SetCRTC_UsingDTDTiming

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
2606c88608122339cbd5c6b5c149a2eb74ccfe9e 08-Oct-2009 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/atom: add support for AdjustDisplayPll

DCE3+ has an AdjustDisplayPll that will adjust the pixel
clock accordingly based on the encoder/transmitter to
handle special hw requirements.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
5f9a0eb5af16906cd31fc3e02746aa3d61fd3aa9 08-Oct-2009 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms/atom: reorder crtc dpms

Based on recommendation from bios docs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
f30f37def4c72e5df8d949022b806e5a4e99bbcb 08-Oct-2009 Michel Dänzer <daenzer@vmware.com> drm/radeon/kms: Update memory bandwidth requirements in mode_set_base hook.

The hook may change the number of bytes per pixel being scanned out, which
affects the CRTC memory bandwidth requirements. E.g. booting in 8bpp and then
running X in 32bpp would result in the bandwidth requirements being
underestimated for the latter and consequently in CRTC FIFO underruns causing
visible artifacts with 3D intensive workloads.

ATOM changes only compile-tested.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
068143d38804825d59d951a192cfadd2e22f457d 05-Oct-2009 Dave Airlie <airlied@redhat.com> drm/fb: add setcmap and fix 8-bit support.

This adds support for the setcmap api and fixes the 8bpp
support at least on radeon hardware. It adds a new load_lut
hook which can be called once the color map is setup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
41456df2d45299c2eea5aaabafbaa2430ab9a124 16-Sep-2009 Dave Airlie <airlied@linux.ie> drm/radeon/kms: reprogram format in set base.

This should in theory fix the problem with a mode set being required
for adjusting the color depth.

This also adds in the necessary bits to the format tables for
8-bit, though it doesn't work yet.

Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
3ce0a23d2d253185df24e22e3d5f89800bb3dd1c 08-Sep-2009 Jerome Glisse <jglisse@redhat.com> drm/radeon/kms: add r600 KMS support

This adds the r600 KMS + CS support to the Linux kernel.

The r600 TTM support is quite basic and still needs more
work esp around using interrupts, but the polled fencing
should work okay for now.

Also currently TTM is using memcpy to do VRAM moves,
the code is here to use a 3D blit to do this, but
isn't fully debugged yet.

Authors:
Alex Deucher <alexdeucher@gmail.com>
Dave Airlie <airlied@redhat.com>
Jerome Glisse <jglisse@redhat.com>

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
4ce001abafafe77e5dd943d1480fc9f87894e96f 13-Aug-2009 Dave Airlie <airlied@redhat.com> drm/radeon/kms: add initial radeon tv-out support.

This ports the tv-out code from the DDX to KMS.

adds a radeon.tv module option, radeon.tv=0 to disable tv

Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
c93bb85b5cba3e3a06f2cad8e9bc5c23d3d10aac 13-Jul-2009 Jerome Glisse <jglisse@redhat.com> drm/radeon/kms: fix bandwidth computation on avivo hardware

Fix bandwidth computation and crtc priority in memory controller
so that crtc memory request are fullfill in time to avoid display
artifact.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
e024e11070a0a0dc7163ce1ec2da354a638bdbed 24-Jun-2009 Dave Airlie <airlied@redhat.com> drm/radeon/kms: add initial colortiling support.

This adds new set/get tiling interfaces where the pitch
and macro/micro tiling enables can be set. Along with
a flag to decide if this object should have a surface when mapped.

The only thing we need to allocate with a mapped surface should be
the frontbuffer. Note rotate scanout shouldn't require one, and
back/depth shouldn't either, though mesa needs some fixes.

It fixes the TTM interfaces along Thomas's suggestions, and I've tested
the surface stealing code with two X servers and not seen any lockdep issues.

I've stopped tiling the fbcon frontbuffer, as I don't see there being
any advantage other than testing, I've left the testing commands in there,
just flip the fb_tiled to true in radeon_fb.c

Open: Can we integrate endian swapping in with this?

Future features:
texture tiling - need to relocate texture registers TXOFFSET* with tiling info.

This also merges Michel's cleanup surfaces regs at init time patch
even though it makes sense on its own, this patch really relies on it.

Some PowerMac firmwares set up a tiling surface at the beginning of VRAM
which messes us up otherwise.
that patch is:
Signed-off-by: Michel Dänzer <daenzer@vmware.com>

Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
eb1300bcd70b3bffbefb6ae0eab13a571255ee93 13-Jul-2009 Alex Deucher <alexdeucher@gmail.com> drm/radeon/kms: enable frac fb divs on rs600/rs690/rs740

Allows us to hit dot clocks much closer, especially on
chips with non-27 Mhz reference clocks like most IGP chips.
This fixes most flickering and blanking problems with
non-exact dot clocks on these chips.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c
771fe6b912fca54f03e8a72eb63058b582775362 05-Jun-2009 Jerome Glisse <jglisse@redhat.com> drm/radeon: introduce kernel modesetting for radeon hardware

Add kernel modesetting support to radeon driver, use the ttm memory
manager to manage memory and DRM/GEM to provide userspace API.
In order to avoid backward compatibility issue and to allow clean
design and code the radeon kernel modesetting use different code path
than old radeon/drm driver.

When kernel modesetting is enabled the IOCTL of radeon/drm
driver are considered as invalid and an error message is printed
in the log and they return failure.

KMS enabled userspace will use new API to talk with the radeon/drm
driver. The new API provide functions to create/destroy/share/mmap
buffer object which are then managed by the kernel memory manager
(here TTM). In order to submit command to the GPU the userspace
provide a buffer holding the command stream, along this buffer
userspace have to provide a list of buffer object used by the
command stream. The kernel radeon driver will then place buffer
in GPU accessible memory and will update command stream to reflect
the position of the different buffers.

The kernel will also perform security check on command stream
provided by the user, we want to catch and forbid any illegal use
of the GPU such as DMA into random system memory or into memory
not owned by the process supplying the command stream. This part
of the code is still incomplete and this why we propose that patch
as a staging driver addition, future security might forbid current
experimental userspace to run.

This code support the following hardware : R1XX,R2XX,R3XX,R4XX,R5XX
(radeon up to X1950). Works is underway to provide support for R6XX,
R7XX and newer hardware (radeon from HD2XXX to HD4XXX).

Authors:
Jerome Glisse <jglisse@redhat.com>
Dave Airlie <airlied@redhat.com>
Alex Deucher <alexdeucher@gmail.com>

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/drivers/gpu/drm/radeon/atombios_crtc.c