Re: Feedback: BKL / radeon pageflipping patches / DRM Vblank timestamping patches. 1st Try.

2010-10-26 Thread Alex Deucher
On Tue, Oct 26, 2010 at 9:32 AM, Sedat Dilek sedat.di...@googlemail.com wrote:
 Hi,

 today, I started with testing DRM Vblank timestamping patches. 1st
 Try. from Mario in combination with radeon pageflipping patches
 from Alex together in a non-BKL config Kernel-setup.

 First some words to my system and hardware:
 * It's a Debian/sid i386 host with latest dist-upgrades as of today.
 * My radeon gfxcard is a RV250.

 [ Linux-kernel ]

 * Base is a 2.6.36 vanilla Linux-kernel tarball
 * on top linux-next (next-20101026) with some extra-patches to be able
 to build a BKL-free Kernel (Thanks Arnd)
 * on top drm-radeon-testing (up to commit 881fe6c: drm/radeon/kms:
 properly compute group_size on 6xx/7xx)
 * Mario's vblank timestamp caching patches (Rev 1 10.10.2010) with
 some patches to fit linux-next/drm-radeon-testing
 * Alex's radeon-KMS pageflipping patches for Kernel
 * For full patch-series see below

 NOTE: My Linux-kernel has one speciality: It is BigKerneLock-free !

 [ DDX (xf66-video-ati) ]

 * xf86-video-ati from GIT master (up to commit df92245: r100: add
 some missing bits in SE_COORD_FMT)
 * on top Alex's radeon-KMS pageflipping patch for DDX

 NOTE from Alex in [2]: 6xx/7xx/evergreen are pretty solid, but
 r1xx-r5xx still need some work.


Thanks for testing! Please make sure you try the latest pageflipping
patches I posted last night:
http://lists.freedesktop.org/archives/dri-devel/2010-October/005042.html
I've also updated put the latest patches here:
http://people.freedesktop.org/~agd5f/pflip/
They work much better on r1xx-r5xx asics.

Alex

 [ Mesa3D ]

 * it is from GIT master (up to commit 547e761: egl_dri2: Fix a typo
 that make glFlush be called at wrong time.)

 [ LibDRM ]

 * 2.4.22-1 from Debian/experimental

 [ Xorg-server ]
 * 2:1.9.0.902-1 from Debian/experimental

 So, how we know Mario made us happy (BTW, greetings from TUE to TUE)?

 [ dmesg ]
 [    8.195646] [drm] Supports vblank timestamp caching Rev 1
 (10.10.2010). --- Driver-date could be changed into more
 human-readable 10-Oct-2010?

 What about the fun Alex gives us?

 [ /var/log/Xorg.0.log ]
 [  1797.204] (II) RADEON(0): KMS Pageflipping: enabled

 INFO:
 I have attached the full dmesg and a Xorg.log (with logs after having
 started Eric Anholt's OpenArena benchmark).

 Above mentionned OA-benchmark drops fps from ~18 down to 13 (new
 Kernel + new DDX).
 I have not tested battery performance.

 My notebook's LVDS has a 1400x1050 resolution, OA was run @1024x768.
 Can you enlighten a bit on the other mesages in X log?

 [ /var/log/Xorg.0.log ]
 ...
 [  2069.700] (II) RADEON(0): Allocate new frame buffer 1024x768 stride
 1024  Start OpenArena benchmark
 [  2069.700] (II) RADEON(0): VRAM usage limit set to 50788K
 [  2072.150] (II) RADEON(0): radeon_dri2_schedule_flip:571 fevent[0x849e988]
 [  2072.160] (II) RADEON(0): radeon_dri2_flip_event_handler:927
 fevent[0x849e988] width 1024 pitch 4096 (/4 1024)
 [  2072.178] (II) RADEON(0): radeon_dri2_schedule_flip:571 fevent[0x8c83298]
 ...
 [  2082.364] (II) RADEON(0): Allocate new frame buffer 1400x1056
 stride 1408 --- Switch back to native resolution (end of benchmark)
 [  2082.364] (II) RADEON(0): VRAM usage limit set to 48326K
 ...

 Hope, this feedback is helpful and encourages the diverse involved
 developers to continue their work.
 Have fun!

 Kind Regards,
 - Sedat -

 [1] http://lists.freedesktop.org/archives/dri-devel/2010-October/005009.html
 [2] http://lists.freedesktop.org/archives/dri-devel/2010-October/005036.html
 [3] http://git.kernel.org/?p=linux/kernel/git/arnd/bkl.git;a=summary
 [4] http://people.freedesktop.org/~agd5f/pflip/

 [ setup_linux-next_next-20101026.1.log ]
 ...
 -- Try to apply base.
  (+) OK   linux-next/patch-v2.6.36-next-20101026
  (+) OK   linux-next/0001-Remove-localversion-next.patch
  (+) OK   for-linux-next/fs-remove-BKL-from-FILE_LOCKING-v2.patch
  (+) OK   for-linux-next/drm-i810-remove-SMP-support-and-BKL.patch
  (+) OK   drm-radeon-testing/drm-radeon-testing.patch
  (+) OK   
 drm-vblank-timestamping/1-3-drm-vblank-Add-support-for-precise-vblank-timestamping.patch
  (+) OK   
 drm-vblank-timestamping/2-3-kms-radeon-Add-support-for-precise-vblank-timestamping.patch
  (+) OK   
 drm-vblank-timestamping/drm-i915-fix-assignment-obj_priv-to_intel_bo.patch
  (+) OK   
 drm-vblank-timestamping/3-3-kms-i915-Add-support-for-precise-vblank-timestamping.patch
  (+) OK   
 drm-vblank-timestamping/drm-i915-fix-error-implicit-declaration-of-function-IS_IRONLAKE.patch
  (+) OK   
 agd5f_pflip/0001-drm-radeon-kms-add-support-for-pflip-interrupts-on-6.patch
  (+) OK   agd5f_pflip/0002-drm-radeon-kms-add-pageflip-ioctl-support.patch
  (+) OK   
 linux-kbuild/1-2-Kbuild-Treat-KBUILD_DEFCONFIG-old-as-request-to-use-.config-as-the-base.patch
  (+) OK   
 linux-kbuild/2-2-Kbuild-kconfig-Verbose-version-of---listnewconfig-and---defconfig-v2.patch
  (+) OK   
 x86-apic-fix/Skip-looking-for-ioapic-overrides-when-ioapics-are-not-present.patch
  (+) 

Re: DRM Vblank timestamping patches. 1st Try.

2010-10-26 Thread Alex Deucher
On Sun, Oct 24, 2010 at 3:28 PM, Mario Kleiner
mario.klei...@tuebingen.mpg.de wrote:
 Hi all,

 after obsessing over these for another month after xds 2010,
 this is the first version of my vblank timestamping patches that
 i'm not totally ashamed off.


Mario, these look great.  Nice work!

Reviewed-by: Alex Deucher alexdeuc...@gmail.com

 1st patch modifies the drm vblank handling to maintain precise
 timestamps of when vblanks happen. It timestamps the end of
 each vblank interval (= start of active scanout of the following
 frame), as required by the OpenML OML_sync_control extension spec,
 so the DRI2 swap  sync bits should return proper timestamps to
 gl clients. It also takes care of keeping timestamps and vblcounts
 consistent across vblank irq on/off and hopefully fixes a few
 off-by-one vblank counts due to race conditions in those on/off bits.

 There is still one small race condition between the vblank on/off
 bits and the gpu (updating its hardware vblank counter at the
 wrong moment) which can cause miscounting of vblanks across
 enable/disable. I have an idea how to fix that, based on these
 patches but will need to tinker around with it a bit more. After
 that we could reduce the vblankoffdelay from 5000 msecs to something
 smaller like 100 msecs to save more power on desktops with
 desktop composition enabled, where already a blinking cursor
 in a terminal window or a ticking clock in the menu bar
 can keep vblanks turned on all the time with a 5000 msecs timeout.

 All the timestamping inside the drmWaitVblank ioctl() and in
 vblank event handling now uses the timestamps calculated in this
 patch.

 2nd and 3rd patches add the new timestamping and scanout position
 functions to the i915 and radeon drivers.

 Wrt. what i showed you at xds, i made the following changes:

 I've moved the actual timestamping routine as a helper function
 into the core. kms drivers now optionally export the crtc scanout
 position query function in addition to the vblank timestamping function
 to the drm core. Whenever the core has to recalculate timestamps it
 goes like:

 core - kmsdriver-timestamping() - core-timestampinghelper() -
 kmsdriver-getscanoutposition()

 The kms driver can implement its own version of the timestamping function,
 e.g., using special hardware timestamping registers in some more recent
 gpu's, or it can simply export a getscanoutposition() function with
 standardized behaviour across drivers and call the timestamping routine
 implemented in the core. The routine in the core works in non-interlaced,
 non-doublescan video modes, with or without panel scaling. It can
 compensate for any random delay up to 1 video refresh duration. For
 more robustness one would need to use a gpu specific hardware method.

 I also moved the calculation of the constants needed for timetamping
 into the drm_crtc_helper routine, so they only get recalculated after
 a mode switch, not at each vblank. At modeset time i cache the
 adjusted_mode after validation/adjustment by the crtc and encoders
 inside the drm_crtc struct. Needed to account for panel scaling, and
 i have a few other ideas that would require that cached value.

 More details in the different commit messages and the code, just
 some more remarks.

 @Jesse: I replaced the n extra dynamically allocated spin-locks for n
 crtc's by one statically allocated lock shared by all crtc's and renamed
 it. I think i also worked all your other suggestions into the patches.
 Thanks a lot for your first review of the earlier version.

 The intel driver uses the timestamps inside the finish pageflip function
 for timestamps of bufferswap completion. I've tested with an Atom
 Mini netbook with Intel 945 GME gpu and there it works perfect. I don't
 have any other intel test machines, so the finish pageflip and scanout
 query functions for ironlake, gen6 and g4x aren't tested, only coded
 based on some of the intel manuals at xorg. In the pageflip irq
 handlers there is this uncertainty if pageflip irq's get delivered
 before or after the vblank irq's for the vblank interval of swap
 completion. The i945 delivers pagflip irq's before handling the
 vblank irq's so the completion handler needs to account for that.
 I guessed from the code, which ones do deliver before/after vblank,
 but that guesses may be wrong, so this needs testing.

 @Alex: Thanks for your feedback at xds. I think the radeon part
 should be as we discussed. The radeon patch builds onto what you
 committed already into drm-radeon-testing for the reclocking fixes.
 It slightly changes the interface between the scanout query function and
 radeon_pm_in_vbl(), but doesn't change the implementation.

 Testing of the timestamps on the Intel 945GME, a Radeon R500 and a R600
 against external measurement equipment shows that the timestamps are
 essentially perfect. Error wrt. to the external measurement is less
 than 20 microseconds (for the radeon's) and jitter is +/- 1 usec. The
 intel error is less

Re: [Bug 19012] Kernel Mode Setting Fails on Radeon X700

2010-09-25 Thread Alex Deucher
FWIW, the ddx has the pci id correctly associated with rv410, so it
looks like it was just improperly ported to the drm.

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: radeon kms on ppc status

2010-08-09 Thread Alex Deucher
2010/8/9 Benjamin Herrenschmidt b...@kernel.crashing.org:
 Just a quick status in case others are interested and want to help
 as I have -very- little time.


Unfortunately, I don't have much spare time to dedicate to this either
and I don't have any ppc machines.

 I'm currently testing on a rv350 based aluminium powerbooks.
 The basic stuff works provided you stay away from AGP. Here's
 things in no special order I noticed:

  - AGP: locks up before the console shows anything useful, that's
 going to be fun to debug without a serial port ... I'll see what I can
 with netconsole or some firewire hack. Works fine with PCI GART.

I think Michel had it working with 1x AGP.


  - transition from offb. If both kms and offb are built-in, the transition
 leads to panel blooming. Note that it seems broken with nouveau on the G5 as
 well, I suspect we are passing a crap mode when picking up from offb at boot.

  - Power Management.

    - Sleep/wakeup needs to be ported over from radeonfb (will also
 be useful for some x86 models).


It would be nice to get this ported over.

    - The other fancy stuff... well, we could make up profiles on powerbooks
 I suppose, at least dynclk can be enable always and I'm sure we can make up
 default profiles with something like half clock speed, what do you reckon ?

The dynclks in the drm should work on the ppc.  As for the power
profiles, something like a half clock should work.

Probably also useful to come up with some way to add backlight control
to the macs without conflicting with the acpi backlight stuff on x86.

Alex

--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: radeon kms on ppc status

2010-08-09 Thread Alex Deucher
On Mon, Aug 9, 2010 at 8:24 PM, Benjamin Herrenschmidt
b...@kernel.crashing.org wrote:

   - transition from offb. If both kms and offb are built-in, the transition
  leads to panel blooming. Note that it seems broken with nouveau on the G5 
  as
  well, I suspect we are passing a crap mode when picking up from offb at 
  boot.
 

 wierd offb-nouveau worked on my G5, handoff doesn't do anything
 technically other than just remove offb from the system,
 and start the driver, so it should be like setting an initial mode.
 Unless the newer early handover messed it up.

 Yeah, not sure what's up, I suspect the driver get passed a bogus mode
 in the initial set_par() when doing the handover. I'll see what I can
 find out once I dig out my dual G5 which has a serial port :-)

   - Power Management.
 
     - Sleep/wakeup needs to be ported over from radeonfb (will also
  be useful for some x86 models).

 I've started to port this on the M7 in a thinkpad on my desk, in
 theory it should save battery life as it appears currently the GPU
 doesn't go into D3 properly,
 however I haven't figured out exactly which bits are required, or
 proven its saving battery (the battery is a little old so I can't be
 sure).

 Ok. So there's basically two different things in that code. Merely D2
 sleep and re-POST (aka D3 cold).

 The former is supported on M6, M7 and M9 (at least some of these, the
 code might need tweaks to work on non-powerbooks). In this case, we are
 dealing with cases where the chip isn't powered down by the motherboard
 or firmware. I don't actually know for sure -what- happens to it on the
 relevant powerbooks actually, I suspect the clocks might go off, and/or
 the VRAM is off. IE. If I don't run that code, I don't come back.

 The code was essentially contributed by ATI btw.

 Then there's code for M10/M11 which re-POSTs the chip. It mostly relies
 on saving as much registers as can be and restoring things in the right
 order, along with the right magic to restart PLLs, MC, DLLs, ...

 This code was written after analyzing the MacOS driver IO traces. Some
 parts however cannot be saved/restored (memory init sequence), so in
 that case, I have a default sequence, and I have code to retreive a
 different one from the OF device-tree when available. For that code to
 work more generically/better on x86's, we might want to add code to
 extract that from the BIOS tables.


The drm can already post the chip using the bios tables on x86, so
we'd only need that for macs.

 Now, I need to figure out how to make all this fit in our driver
 architecture. Dave, can I see your patches ? That might give me some
 good hints to get started. Hopefully, most of that can be kept safely in
 the r100 files and we can avoid clobbering too much of the core
 drivers.


For chip init, you'd want to hook asic init stuff into
radeon_combios_asic_init() in radeon_combios.c.  That function uses
the bios tables to init the chip.  For the D2 stuff, you'd want to
hook that into the r100_suspend/resume functions in r100.c and
r300_suspend/resume in r300.c.

Alex

 Cheers,
 Ben.

 Dave.

 --
 This SF.net email is sponsored by

 Make an app they can't live without
 Enter the BlackBerry Developer Challenge
 http://p.sf.net/sfu/RIM-dev2dev
 --
 ___
 Dri-devel mailing list
 Dri-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/dri-devel




--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon/kms: fix legacy tv-out pal mode

2010-07-12 Thread Alex Deucher
It doesn't look like this patch slipped through the cracks.  Please apply.

Alex

On Sat, Mar 6, 2010 at 11:05 AM, Alex Deucher alexdeuc...@gmail.com wrote:
 From ad6fcd83e27499e35ef4975fe0e9319f73cbb49e Mon Sep 17 00:00:00 2001
 From: Alex Deucher alexdeuc...@gmail.com
 Date: Sat, 6 Mar 2010 09:43:41 -0500
 Subject: [PATCH] drm/radeon/kms: fix legacy tv-out pal mode

 fixes fdo bug 26915

 Signed-off-by: Alex Deucher alexdeuc...@gmail.com
 ---
  drivers/gpu/drm/radeon/radeon_legacy_tv.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

 diff --git a/drivers/gpu/drm/radeon/radeon_legacy_tv.c
 b/drivers/gpu/drm/radeon/radeon_legacy_tv.c
 index 417684d..fdce15b 100644
 --- a/drivers/gpu/drm/radeon/radeon_legacy_tv.c
 +++ b/drivers/gpu/drm/radeon/radeon_legacy_tv.c
 @@ -623,8 +623,8 @@ void radeon_legacy_tv_mode_set(struct drm_encoder 
 *encoder,
        }
        flicker_removal = (tmp + 500) / 1000;

 -       if (flicker_removal  2)
 -               flicker_removal = 2;
 +       if (flicker_removal  3)
 +               flicker_removal = 3;
        for (i = 0; i  ARRAY_SIZE(SLOPE_limit); ++i) {
                if (flicker_removal == SLOPE_limit[i])
                        break;
 --
 1.5.6.3

From ad6fcd83e27499e35ef4975fe0e9319f73cbb49e Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Sat, 6 Mar 2010 09:43:41 -0500
Subject: [PATCH] drm/radeon/kms: fix legacy tv-out pal mode

fixes fdo bug 26915

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_legacy_tv.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_legacy_tv.c b/drivers/gpu/drm/radeon/radeon_legacy_tv.c
index 417684d..fdce15b 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_tv.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_tv.c
@@ -623,8 +623,8 @@ void radeon_legacy_tv_mode_set(struct drm_encoder *encoder,
 	}
 	flicker_removal = (tmp + 500) / 1000;
 
-	if (flicker_removal  2)
-		flicker_removal = 2;
+	if (flicker_removal  3)
+		flicker_removal = 3;
 	for (i = 0; i  ARRAY_SIZE(SLOPE_limit); ++i) {
 		if (flicker_removal == SLOPE_limit[i])
 			break;
-- 
1.5.6.3

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [git pull] drm fixes + agp + one fb patch (bisected)

2010-06-30 Thread Alex Deucher
On Wed, Jun 30, 2010 at 3:31 AM, Markus Trippelsdorf
mar...@trippelsdorf.de wrote:
 On Wed, Jun 30, 2010 at 08:54:40AM +0200, Markus Trippelsdorf wrote:
 On Wed, Jun 30, 2010 at 02:03:04AM +0100, Dave Airlie wrote:
 
  one fb layer fix in a flag I introduced,
 
  the rest are drm fixes:
  radeon fixes: the larger ones in the command stream checker for older 
  cards,
  which was causing a lot of userspace apps to fail. Also some powerpc 
  server fixes.
  along with some updates to the evergreen command stream checker introduced 
  in -rc1.
 
  agp: fix issue with warning on memory allocation + fallback to vmalloc.
  ttm: fix regression introduced in -rc1 in memory allocation paths.
 
  The following changes since commit 
  7e27d6e778cd87b6f2415515d7127eba53fe5d02:
 
    Linux 2.6.35-rc3 (2010-06-11 19:14:04 -0700)
 

 I've tested these patches and they break my setup (RS780). On reboot, the
 monitor goes straight to powersaving mode and no framebuffer is shown.

 This is the result of the bisection:

 07d4190327b02ab3aaad25a2d168f79d92e8f8c2 is the first bad commit
 commit 07d4190327b02ab3aaad25a2d168f79d92e8f8c2
 Author: Alex Deucher alexdeuc...@gmail.com
 Date:   Sat Jun 12 11:50:13 2010 -0400

    drm/radeon/kms: fix bandwidth calculation when sideport is present

    Fixes fdo bug 27529:
    https://bugs.freedesktop.org/show_bug.cgi?id=27529

    Reported-by: steckde...@yahoo.fr
    Signed-off-by: Alex Deucher alexdeuc...@gmail.com
    Cc: stable sta...@kernel.org
    Signed-off-by: Dave Airlie airl...@redhat.com

Markus, can you send me a copy of your vbios? as root:
cd /sys/bus/pci/devices/pci bus id of video card
echo 1  rom
cat rom ? /tmp/vbio.rom
echo 0  rom

Also, when you say on reboot do you mean the card comes up ok
initially with the new kernel and then fails after a reboot, or fails
directly after booting the new kernel?  Also, is there an oops or
anything like that in dmesg?

Thanks,

Alex

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [git pull] drm fixes + agp + one fb patch (bisected)

2010-06-30 Thread Alex Deucher
On Wed, Jun 30, 2010 at 10:58 AM, Markus Trippelsdorf
mar...@trippelsdorf.de wrote:
 On Wed, Jun 30, 2010 at 10:49:41AM -0400, Alex Deucher wrote:
 On Wed, Jun 30, 2010 at 3:31 AM, Markus Trippelsdorf
 mar...@trippelsdorf.de wrote:
  On Wed, Jun 30, 2010 at 08:54:40AM +0200, Markus Trippelsdorf wrote:
  On Wed, Jun 30, 2010 at 02:03:04AM +0100, Dave Airlie wrote:
  
   one fb layer fix in a flag I introduced,
  
   the rest are drm fixes:
   radeon fixes: the larger ones in the command stream checker for older 
   cards,
   which was causing a lot of userspace apps to fail. Also some powerpc 
   server fixes.
   along with some updates to the evergreen command stream checker 
   introduced in -rc1.
  
   agp: fix issue with warning on memory allocation + fallback to vmalloc.
   ttm: fix regression introduced in -rc1 in memory allocation paths.
  
   The following changes since commit 
   7e27d6e778cd87b6f2415515d7127eba53fe5d02:
  
     Linux 2.6.35-rc3 (2010-06-11 19:14:04 -0700)
  
 
  I've tested these patches and they break my setup (RS780). On reboot, the
  monitor goes straight to powersaving mode and no framebuffer is shown.
 
  This is the result of the bisection:
 
  07d4190327b02ab3aaad25a2d168f79d92e8f8c2 is the first bad commit
  commit 07d4190327b02ab3aaad25a2d168f79d92e8f8c2
  Author: Alex Deucher alexdeuc...@gmail.com
  Date:   Sat Jun 12 11:50:13 2010 -0400
 
     drm/radeon/kms: fix bandwidth calculation when sideport is present
 
     Fixes fdo bug 27529:
     https://bugs.freedesktop.org/show_bug.cgi?id=27529
 
     Reported-by: steckde...@yahoo.fr
     Signed-off-by: Alex Deucher alexdeuc...@gmail.com
     Cc: stable sta...@kernel.org
     Signed-off-by: Dave Airlie airl...@redhat.com

 Markus, can you send me a copy of your vbios? as root:
 cd /sys/bus/pci/devices/pci bus id of video card
 echo 1  rom
 cat rom ? /tmp/vbio.rom
 echo 0  rom

 Attached.


 Also, when you say on reboot do you mean the card comes up ok
 initially with the new kernel and then fails after a reboot, or fails
 directly after booting the new kernel?  Also, is there an oops or
 anything like that in dmesg?

 It fails directly after booting the new kernel. There is no oops or
 anything like it in dmesg, because the kernel fails so early that it
 could not log anything.

Is the machine still pingable?  Can you ssh in? or is it completely dead?

Alex

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [git pull] drm fixes + agp + one fb patch (bisected)

2010-06-30 Thread Alex Deucher
On Wed, Jun 30, 2010 at 11:14 AM, Markus Trippelsdorf
mar...@trippelsdorf.de wrote:
 On Wed, Jun 30, 2010 at 11:03:33AM -0400, Alex Deucher wrote:
 On Wed, Jun 30, 2010 at 10:58 AM, Markus Trippelsdorf
 mar...@trippelsdorf.de wrote:
  On Wed, Jun 30, 2010 at 10:49:41AM -0400, Alex Deucher wrote:
  On Wed, Jun 30, 2010 at 3:31 AM, Markus Trippelsdorf
  mar...@trippelsdorf.de wrote:
   On Wed, Jun 30, 2010 at 08:54:40AM +0200, Markus Trippelsdorf wrote:
   On Wed, Jun 30, 2010 at 02:03:04AM +0100, Dave Airlie wrote:
   
one fb layer fix in a flag I introduced,
   
the rest are drm fixes:
radeon fixes: the larger ones in the command stream checker for 
older cards,
which was causing a lot of userspace apps to fail. Also some powerpc 
server fixes.
along with some updates to the evergreen command stream checker 
introduced in -rc1.
   
agp: fix issue with warning on memory allocation + fallback to 
vmalloc.
ttm: fix regression introduced in -rc1 in memory allocation paths.
   
The following changes since commit 
7e27d6e778cd87b6f2415515d7127eba53fe5d02:
   
  Linux 2.6.35-rc3 (2010-06-11 19:14:04 -0700)
   
  
   I've tested these patches and they break my setup (RS780). On reboot, 
   the
   monitor goes straight to powersaving mode and no framebuffer is shown.
  
   This is the result of the bisection:
  
   07d4190327b02ab3aaad25a2d168f79d92e8f8c2 is the first bad commit
   commit 07d4190327b02ab3aaad25a2d168f79d92e8f8c2
   Author: Alex Deucher alexdeuc...@gmail.com
   Date:   Sat Jun 12 11:50:13 2010 -0400
  
      drm/radeon/kms: fix bandwidth calculation when sideport is present
  
      Fixes fdo bug 27529:
      https://bugs.freedesktop.org/show_bug.cgi?id=27529
  
      Reported-by: steckde...@yahoo.fr
      Signed-off-by: Alex Deucher alexdeuc...@gmail.com
      Cc: stable sta...@kernel.org
      Signed-off-by: Dave Airlie airl...@redhat.com
 
  Markus, can you send me a copy of your vbios? as root:
  cd /sys/bus/pci/devices/pci bus id of video card
  echo 1  rom
  cat rom ? /tmp/vbio.rom
  echo 0  rom
 
  Attached.
 
 
  Also, when you say on reboot do you mean the card comes up ok
  initially with the new kernel and then fails after a reboot, or fails
  directly after booting the new kernel?  Also, is there an oops or
  anything like that in dmesg?
 
  It fails directly after booting the new kernel. There is no oops or
  anything like it in dmesg, because the kernel fails so early that it
  could not log anything.

 Is the machine still pingable?  Can you ssh in? or is it completely dead?

 I don't think so. There is no disk activivy after the hang, but maybe
 the kernel displays an oops, which I just can't see.

The attached patch should fix the issue.

Alex
From 3b2fef39e0172099a766ce536489d008b444c48b Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Wed, 30 Jun 2010 11:31:13 -0400
Subject: [PATCH] drm/radeon/kms/igp: fix possible divide by 0 in bandwidth code

Some IGP systems specify the system memory clock in the Firmware
table rather than the IGP info table.  Check both and make sure
we have a value system memory clock value.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/rs690.c |   35 +++
 1 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c
index 64b94a8..f4f0a61 100644
--- a/drivers/gpu/drm/radeon/rs690.c
+++ b/drivers/gpu/drm/radeon/rs690.c
@@ -79,7 +79,13 @@ void rs690_pm_info(struct radeon_device *rdev)
 			tmp.full = dfixed_const(100);
 			rdev-pm.igp_sideport_mclk.full = dfixed_const(info-info.ulBootUpMemoryClock);
 			rdev-pm.igp_sideport_mclk.full = dfixed_div(rdev-pm.igp_sideport_mclk, tmp);
-			rdev-pm.igp_system_mclk.full = dfixed_const(le16_to_cpu(info-info.usK8MemoryClock));
+			if (info-info.usK8MemoryClock)
+rdev-pm.igp_system_mclk.full = dfixed_const(le16_to_cpu(info-info.usK8MemoryClock));
+			else if (rdev-clock.default_mclk) {
+rdev-pm.igp_system_mclk.full = dfixed_const(rdev-clock.default_mclk);
+rdev-pm.igp_system_mclk.full = dfixed_div(rdev-pm.igp_system_mclk, tmp);
+			} else
+rdev-pm.igp_system_mclk.full = dfixed_const(400);
 			rdev-pm.igp_ht_link_clk.full = dfixed_const(le16_to_cpu(info-info.usFSBClock));
 			rdev-pm.igp_ht_link_width.full = dfixed_const(info-info.ucHTLinkWidth);
 			break;
@@ -87,34 +93,31 @@ void rs690_pm_info(struct radeon_device *rdev)
 			tmp.full = dfixed_const(100);
 			rdev-pm.igp_sideport_mclk.full = dfixed_const(info-info_v2.ulBootUpSidePortClock);
 			rdev-pm.igp_sideport_mclk.full = dfixed_div(rdev-pm.igp_sideport_mclk, tmp);
-			rdev-pm.igp_system_mclk.full = dfixed_const(info-info_v2.ulBootUpUMAClock);
+			if (info-info_v2.ulBootUpUMAClock)
+rdev-pm.igp_system_mclk.full = dfixed_const(info-info_v2.ulBootUpUMAClock);
+			else if (rdev-clock.default_mclk)
+rdev-pm.igp_system_mclk.full

Re: [git pull] drm fixes + agp + one fb patch

2010-06-30 Thread Alex Deucher
On Wed, Jun 30, 2010 at 6:13 AM, Rafael J. Wysocki r...@sisk.pl wrote:
 On Wednesday, June 30, 2010, Dave Airlie wrote:

 Hi Linus,

 one fb layer fix in a flag I introduced,

 the rest are drm fixes:
 radeon fixes: the larger ones in the command stream checker for older cards,
 which was causing a lot of userspace apps to fail. Also some powerpc server 
 fixes.
 along with some updates to the evergreen command stream checker introduced 
 in -rc1.

 agp: fix issue with warning on memory allocation + fallback to vmalloc.
 ttm: fix regression introduced in -rc1 in memory allocation paths.

 The following changes since commit 7e27d6e778cd87b6f2415515d7127eba53fe5d02:

   Linux 2.6.35-rc3 (2010-06-11 19:14:04 -0700)

 are available in the git repository at:
   ssh://master.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git 
 drm-fixes

 Adam Jackson (1):
       drm/fb: Fix video= mode computation

 Alex Deucher (7):
       drm/radeon/kms: fix bandwidth calculation when sideport is present
       drm/radeon/kms: fix DP after DPMS cycle
       drm/radeon/kms: fix typo in evergreen_gpu_init
       drm/radeon/kms: disable frac fb dividers for rs6xx
       drm/radeon/kms: avoid oops on mac r4xx cards
       drm/radeon/kms: fix typos in evergreen command checker
       drm/radeon/kms: add some missing regs to evergreen gpu init

 Cedric Godin (1):
       drm/radeon/kms: fix dpms state on resume

 Dave Airlie (7):
       drm/radeon: fix dual-head on rv250
       radeon/kms: fix powerpc/rn50 untiled behaviour.
       agp: drop vmalloc flag.
       agp: add no warn since we have a fallback to vmalloc paths
       drm/radeon: add fake RN50 table for powerpc
       drm/radeon/kms: don't read attempt to read bios from VRAM on unposted 
 GPU.
       fb: fix colliding defines for fb flags.

 Jerome Glisse (2):
       drm/ttm: non pooled page allocation should have GFP_USER set
       drm/radeon/kms: Force HDP_NONSURF to maximum size

 Matt Turner (1):
       drm/radeon/kms: return ret in cursor_set failure path

 Roland Scheidegger (3):
       drm/radeon/kms: CS checker texture fixes for r1xx/r2xx/r3xx
       drm/radeon/r200: handle more hw tex coord types
       drm/radeon/r100/r200: fix calculation of compressed cube maps

 Hmm.  What about:

 https://patchwork.kernel.org/patch/106757/ ?

 It fixes a regression from 2.6.34.

This patch should definitely go in as well.

Alex

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [git pull] drm fixes + agp + one fb patch (bisected)

2010-06-30 Thread Alex Deucher
On Wed, Jun 30, 2010 at 11:50 AM, Markus Trippelsdorf
mar...@trippelsdorf.de wrote:
 On Wed, Jun 30, 2010 at 11:34:53AM -0400, Alex Deucher wrote:
 On Wed, Jun 30, 2010 at 11:14 AM, Markus Trippelsdorf
 mar...@trippelsdorf.de wrote:
  On Wed, Jun 30, 2010 at 11:03:33AM -0400, Alex Deucher wrote:
  On Wed, Jun 30, 2010 at 10:58 AM, Markus Trippelsdorf
  mar...@trippelsdorf.de wrote:
   On Wed, Jun 30, 2010 at 10:49:41AM -0400, Alex Deucher wrote:
   On Wed, Jun 30, 2010 at 3:31 AM, Markus Trippelsdorf
   mar...@trippelsdorf.de wrote:
On Wed, Jun 30, 2010 at 08:54:40AM +0200, Markus Trippelsdorf wrote:
On Wed, Jun 30, 2010 at 02:03:04AM +0100, Dave Airlie wrote:

 one fb layer fix in a flag I introduced,

 the rest are drm fixes:
 radeon fixes: the larger ones in the command stream checker for 
 older cards,
 which was causing a lot of userspace apps to fail. Also some 
 powerpc server fixes.
 along with some updates to the evergreen command stream checker 
 introduced in -rc1.

 agp: fix issue with warning on memory allocation + fallback to 
 vmalloc.
 ttm: fix regression introduced in -rc1 in memory allocation paths.

 The following changes since commit 
 7e27d6e778cd87b6f2415515d7127eba53fe5d02:

   Linux 2.6.35-rc3 (2010-06-11 19:14:04 -0700)

   
I've tested these patches and they break my setup (RS780). On 
reboot, the
monitor goes straight to powersaving mode and no framebuffer is 
shown.
   
This is the result of the bisection:
   
07d4190327b02ab3aaad25a2d168f79d92e8f8c2 is the first bad commit
commit 07d4190327b02ab3aaad25a2d168f79d92e8f8c2
Author: Alex Deucher alexdeuc...@gmail.com
Date:   Sat Jun 12 11:50:13 2010 -0400
   
   drm/radeon/kms: fix bandwidth calculation when sideport is present
   
   Fixes fdo bug 27529:
   https://bugs.freedesktop.org/show_bug.cgi?id=27529
   
   Reported-by: steckde...@yahoo.fr
   Signed-off-by: Alex Deucher alexdeuc...@gmail.com
   Cc: stable sta...@kernel.org
   Signed-off-by: Dave Airlie airl...@redhat.com
  
   Markus, can you send me a copy of your vbios? as root:
   cd /sys/bus/pci/devices/pci bus id of video card
   echo 1  rom
   cat rom ? /tmp/vbio.rom
   echo 0  rom
  
   Attached.
  
  
   Also, when you say on reboot do you mean the card comes up ok
   initially with the new kernel and then fails after a reboot, or fails
   directly after booting the new kernel?  Also, is there an oops or
   anything like that in dmesg?
  
   It fails directly after booting the new kernel. There is no oops or
   anything like it in dmesg, because the kernel fails so early that it
   could not log anything.
 
  Is the machine still pingable?  Can you ssh in? or is it completely dead?
 
  I don't think so. There is no disk activivy after the hang, but maybe
  the kernel displays an oops, which I just can't see.

 The attached patch should fix the issue.

 Sorry, but it does not. I've still the same issue with your patch
 applied.

New patch attached.  The rs690_pm_info function wasn't getting called
at all on rs780/rs880 and it needs to be.

Alex
From b79c8299fec572953ef6d870990293c0ee4ca678 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Wed, 30 Jun 2010 12:02:03 -0400
Subject: [PATCH] drm/radeon/kms/igp: fix possible divide by 0 in bandwidth code (v2)

Some IGP systems specify the system memory clock in the Firmware
table rather than the IGP info table.  Check both and make sure
we have a value system memory clock value.

v2: make sure rs690_pm_info is called on rs780/rs880 as well.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/r600.c   |4 +++-
 drivers/gpu/drm/radeon/radeon.h |1 +
 drivers/gpu/drm/radeon/rs690.c  |   35 +++
 3 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 7f48593..1d5057b 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -1224,8 +1224,10 @@ int r600_mc_init(struct radeon_device *rdev)
 	rdev-mc.visible_vram_size = rdev-mc.aper_size;
 	r600_vram_gtt_location(rdev, rdev-mc);
 
-	if (rdev-flags  RADEON_IS_IGP)
+	if (rdev-flags  RADEON_IS_IGP) {
+		rs690_pm_info(rdev);
 		rdev-mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev);
+	}
 	radeon_update_bandwidth_info(rdev);
 	return 0;
 }
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 35f0800..9fcdba7 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -177,6 +177,7 @@ void radeon_pm_resume(struct radeon_device *rdev);
 void radeon_combios_get_power_modes(struct radeon_device *rdev);
 void radeon_atombios_get_power_modes(struct radeon_device *rdev);
 void radeon_atom_set_voltage(struct radeon_device *rdev, u16 level);
+void rs690_pm_info(struct radeon_device *rdev

Re: Radeon fail with DisplayPort

2010-06-15 Thread Alex Deucher
On Tue, Jun 15, 2010 at 10:54 AM, Sebastien Luttringer
sebastien.luttrin...@smartjog.com wrote:
 Hi,

 I would report you a bug with displayport and radeon module on recent linux
 kernel. When my card is plugged with displayport I have the following error in
 dmesg and screen stay black.
 [   18.493734] [drm:dp_link_train] *ERROR* clock recovery reached max voltage
 [   18.493735] [drm:dp_link_train] *ERROR* clock recovery failed
 [   18.510279] [drm:dp_link_train] *ERROR* channel eq failed: 5 tries
 [   18.510280] [drm:dp_link_train] *ERROR* channel eq failed

 When i plug my screen with (dell 27 2560*1440) a DVI cord everything is
 fabulous.

 This was tested with 2.6.35-rc3, 2.6.34, 2.6.32 and all is revelent. I've also
 tested with a patch from here :
 http://comments.gmane.org/gmane.comp.video.dri.devel/46851
 but nothing change.

 My test was done with a debian sid/experimental disto.
 # lspci|grep VGA
 01:00.0 VGA compatible controller: ATI Technologies Inc RV710 [Radeon HD 4550]
 # uname -a
 Linux sluttrin 2.6.35-rc3-seblu #5 SMP Mon Jun 14 15:43:18 CEST 2010 x86_64
 GNU/Linux
 # dpkg -l|grep -e radeon -e mesa
 (16:47)[2]
 ii  libdrm-radeon1                       2.4.21-1
 Userspace interface to radeon-specific kerne
 ii  libdrm-radeon1-dbg                   2.4.21-1
 Userspace interface to radeon-specific kerne
 ii  libgl1-mesa-dri                      7.8.1-2                         A
 free implementation of the OpenGL API -- D
 ii  libgl1-mesa-glx                      7.8.1-2                         A
 free implementation of the OpenGL API -- G
 ii  libglu1-mesa                         7.7.1-3                         The
 OpenGL utility library (GLU)
 ii  mesa-utils                           7.7.1-3
 Miscellaneous Mesa GL utilities
 ii  xserver-xorg-video-radeon            1:6.13.0-2                      X.Org
 X server -- AMD/ATI Radeon display dri
 ii  xserver-xorg-video-radeon-dbg        1:6.13.0-2                      X.Org
 X server -- AMD/ATI Radeon display dri
 ii  xserver-xorg-video-radeonhd          1.3.0-3                         X.Org
 X server -- AMD/ATI r5xx-r7xx alternat
 ii  xserver-xorg-video-radeonhd-dbg      1.3.0-3                         X.Org
 X server -- AMD/ATI r5xx-r7xx alternat

 II can provide more information on request and offer help testing patches.

Please file a bug (https://bugs.freedesktop.org product DRI, component
DRM/Radeon) and attach your xorg log and dmesg.  Also, does ums work
any better (boot with rdeon.modeset=0)?

Alex

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon: fix dual-head on rv250

2010-06-08 Thread Alex Deucher
On Wed, Jun 9, 2010 at 12:02 AM, Dave Airlie airl...@gmail.com wrote:
 From: Dave Airlie airl...@redhat.com

 Plugged in FireMV with the rv250 on it, and the second crtc/dac didn't work,
 we were reading/writing different registers than we were modifying in the 
 code.

 Signed-off-by: Dave Airlie airl...@redhat.com

Signed-off-by: Alex Deucher alexdeuc...@gmail.com

 ---
  drivers/gpu/drm/radeon/radeon_legacy_encoders.c |   22 +-
  1 files changed, 9 insertions(+), 13 deletions(-)

 diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c 
 b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
 index 9b5f62b..23ea127 100644
 --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
 +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
 @@ -931,16 +931,14 @@ static void radeon_legacy_tv_dac_mode_set(struct 
 drm_encoder *encoder,
        if (ASIC_IS_R300(rdev)) {
                gpiopad_a = RREG32(RADEON_GPIOPAD_A) | 1;
                disp_output_cntl = RREG32(RADEON_DISP_OUTPUT_CNTL);
 -       }
 -
 -       if (rdev-family == CHIP_R200 || ASIC_IS_R300(rdev))
 -               disp_tv_out_cntl = RREG32(RADEON_DISP_TV_OUT_CNTL);
 -       else
 +       } else if (rdev-family != CHIP_R200)
                disp_hw_debug = RREG32(RADEON_DISP_HW_DEBUG);
 -
 -       if (rdev-family == CHIP_R200)
 +       else if (rdev-family == CHIP_R200)
                fp2_gen_cntl = RREG32(RADEON_FP2_GEN_CNTL);

 +       if (rdev-family = CHIP_R200)
 +               disp_tv_out_cntl = RREG32(RADEON_DISP_TV_OUT_CNTL);
 +
        if (is_tv) {
                uint32_t dac_cntl;

 @@ -1005,15 +1003,13 @@ static void radeon_legacy_tv_dac_mode_set(struct 
 drm_encoder *encoder,
        if (ASIC_IS_R300(rdev)) {
                WREG32_P(RADEON_GPIOPAD_A, gpiopad_a, ~1);
                WREG32(RADEON_DISP_OUTPUT_CNTL, disp_output_cntl);
 -       }
 +       } else if (rdev-family != CHIP_R200)
 +               WREG32(RADEON_DISP_HW_DEBUG, disp_hw_debug);
 +       else if (rdev-family == CHIP_R200)
 +               WREG32(RADEON_FP2_GEN_CNTL, fp2_gen_cntl);

        if (rdev-family = CHIP_R200)
                WREG32(RADEON_DISP_TV_OUT_CNTL, disp_tv_out_cntl);
 -       else
 -               WREG32(RADEON_DISP_HW_DEBUG, disp_hw_debug);
 -
 -       if (rdev-family == CHIP_R200)
 -               WREG32(RADEON_FP2_GEN_CNTL, fp2_gen_cntl);

        if (is_tv)
                radeon_legacy_tv_mode_set(encoder, mode, adjusted_mode);
 --
 1.6.5.2


 --
 ThinkGeek and WIRED's GeekDad team up for the Ultimate
 GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
 lucky parental unit.  See the prize list and enter to win:
 http://p.sf.net/sfu/thinkgeek-promo
 --
 ___
 Dri-devel mailing list
 Dri-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/dri-devel


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Regression, post-rc1] Multiple issues after enabling SetVoltage on rs780m

2010-06-07 Thread Alex Deucher
On Mon, Jun 7, 2010 at 6:15 AM, Dave Airlie airl...@gmail.com wrote:
 On Mon, Jun 7, 2010 at 7:29 PM, Rafael J. Wysocki r...@sisk.pl wrote:
 Hi Alex,

 Your commit 9349d5cc920c10845693f906ebd67f394f1d0d04
 (drm/radeon/kms/pm: enable SetVoltage on r7xx/evergreen) has caused my 
 test-bed
 Acer Ferrari One to behave quite unreliably.  The symptoms are:

 - the system hangs hard (~ 50% of the time) when starting Xorg
 - the system hangs hard (~ 50% of the time) when stopping Xorg during system
  reboot
 - the system sometimes hangs hard during suspend to RAM

 These problems are not reproducible with the commit above reverted.

 Below is the information about the graphics adapter from lspci.

 Reverting that commit on master fixes it?

 that commit touches code paths in rv770 and evergreen that in no way
 should affect that chipset which is an rs780, so takes the r600 paths.

 are you sure its not 7ac9aa5a1f1b87adb69bcbec2b89e228f074103a?

It should be that commit if it is indeed the voltage adjust.  That
said, I just took a closer look at the voltage adjust on newer IGPs
and unfortunately, it doesn't work the same as the discrete cards, so
for now we should disable it.  The attached patch should do the trick.
 There weren't any problems on my IGP chips, but they don't have a
SetVoltage table, so nothing is touching the hw.

Alex
From 8c055a2a5c0bd063fe2bf4797c585fd1cd59a673 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Mon, 7 Jun 2010 11:35:53 -0400
Subject: [PATCH] drm/radeon/kms/pm: Disable voltage adjust on RS780/RS880

The vddc value in the power tables is not an actual voltage
like on discrete r6xx/r7xx/evergreen systems, but instead has
a symbolic meaning (e.g., NONE, LOW, HIGH, etc.).  See atombios.h

Most RS780/RS880 vbioses don't have a SetVoltage table anyway,
so it shouldn't be doing anything to the hardware at the moment.

I need to figure out how voltage is supposed to work on the newer
IGPs; until then, disable it.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_atombios.c |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index 0616e39..5dd86b9 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -1841,10 +1841,7 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
 		/* skip invalid modes */
 		if (rdev-pm.power_state[state_index].clock_info[mode_index].sclk == 0)
 			continue;
-		rdev-pm.power_state[state_index].clock_info[mode_index].voltage.type =
-			VOLTAGE_SW;
-		rdev-pm.power_state[state_index].clock_info[mode_index].voltage.voltage =
-			clock_info-usVDDC;
+		/* voltage works differently on IGPs */
 		mode_index++;
 	} else if (ASIC_IS_DCE4(rdev)) {
 		struct _ATOM_PPLIB_EVERGREEN_CLOCK_INFO *clock_info =
-- 
1.7.0.1

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms: more atom parser fixes

2010-04-09 Thread Alex Deucher
From 44cc309323e38fc4fa7b7c7bea190aeaa0abd224 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Fri, 9 Apr 2010 14:27:18 -0400
Subject: [PATCH] drm/radeon/kms: more atom parser fixes

shr/shl ops need the full dst rather than the pre-masked
version.  Fixes fdo bug 27478 and kernel bug 15738.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/atom.c |   12 ++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
index 58845e0..44c8cbd 100644
--- a/drivers/gpu/drm/radeon/atom.c
+++ b/drivers/gpu/drm/radeon/atom.c
@@ -905,13 +905,17 @@ static void
atom_op_shift_right(atom_exec_context *ctx, int *ptr, int arg)
 static void atom_op_shl(atom_exec_context *ctx, int *ptr, int arg)
 {
uint8_t attr = U8((*ptr)++), shift;
-   uint32_t saved, dst;
+   uint32_t saved, dst, tmp;
int dptr = *ptr;
+   uint32_t dst_align = atom_dst_to_src[(attr  3)  7][(attr  6)  3];
SDEBUG(   dst: );
dst = atom_get_dst(ctx, arg, attr, ptr, saved, 1);
+   dst = saved;
shift = atom_get_src(ctx, attr, ptr);
SDEBUG(   shift: %d\n, shift);
dst = shift;
+   dst = atom_arg_mask[dst_align];
+   dst = atom_arg_shift[dst_align];
SDEBUG(   dst: );
atom_put_dst(ctx, arg, attr, dptr, dst, saved);
 }
@@ -919,13 +923,17 @@ static void atom_op_shl(atom_exec_context *ctx,
int *ptr, int arg)
 static void atom_op_shr(atom_exec_context *ctx, int *ptr, int arg)
 {
uint8_t attr = U8((*ptr)++), shift;
-   uint32_t saved, dst;
+   uint32_t saved, dst, tmp;
int dptr = *ptr;
+   uint32_t dst_align = atom_dst_to_src[(attr  3)  7][(attr  6)  3];
SDEBUG(   dst: );
dst = atom_get_dst(ctx, arg, attr, ptr, saved, 1);
+   dst = saved;
shift = atom_get_src(ctx, attr, ptr);
SDEBUG(   shift: %d\n, shift);
dst = shift;
+   dst = atom_arg_mask[dst_align];
+   dst = atom_arg_shift[dst_align];
SDEBUG(   dst: );
atom_put_dst(ctx, arg, attr, dptr, dst, saved);
 }
-- 
1.5.6.3
From 44cc309323e38fc4fa7b7c7bea190aeaa0abd224 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Fri, 9 Apr 2010 14:27:18 -0400
Subject: [PATCH] drm/radeon/kms: more atom parser fixes

shr/shl ops need the full dst rather than the pre-masked
version.  Fixes fdo bug 27478 and kernel bug 15738.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/atom.c |   12 ++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
index 58845e0..44c8cbd 100644
--- a/drivers/gpu/drm/radeon/atom.c
+++ b/drivers/gpu/drm/radeon/atom.c
@@ -905,13 +905,17 @@ static void atom_op_shift_right(atom_exec_context *ctx, int *ptr, int arg)
 static void atom_op_shl(atom_exec_context *ctx, int *ptr, int arg)
 {
 	uint8_t attr = U8((*ptr)++), shift;
-	uint32_t saved, dst;
+	uint32_t saved, dst, tmp;
 	int dptr = *ptr;
+	uint32_t dst_align = atom_dst_to_src[(attr  3)  7][(attr  6)  3];
 	SDEBUG(   dst: );
 	dst = atom_get_dst(ctx, arg, attr, ptr, saved, 1);
+	dst = saved;
 	shift = atom_get_src(ctx, attr, ptr);
 	SDEBUG(   shift: %d\n, shift);
 	dst = shift;
+	dst = atom_arg_mask[dst_align];
+	dst = atom_arg_shift[dst_align];
 	SDEBUG(   dst: );
 	atom_put_dst(ctx, arg, attr, dptr, dst, saved);
 }
@@ -919,13 +923,17 @@ static void atom_op_shl(atom_exec_context *ctx, int *ptr, int arg)
 static void atom_op_shr(atom_exec_context *ctx, int *ptr, int arg)
 {
 	uint8_t attr = U8((*ptr)++), shift;
-	uint32_t saved, dst;
+	uint32_t saved, dst, tmp;
 	int dptr = *ptr;
+	uint32_t dst_align = atom_dst_to_src[(attr  3)  7][(attr  6)  3];
 	SDEBUG(   dst: );
 	dst = atom_get_dst(ctx, arg, attr, ptr, saved, 1);
+	dst = saved;
 	shift = atom_get_src(ctx, attr, ptr);
 	SDEBUG(   shift: %d\n, shift);
 	dst = shift;
+	dst = atom_arg_mask[dst_align];
+	dst = atom_arg_shift[dst_align];
 	SDEBUG(   dst: );
 	atom_put_dst(ctx, arg, attr, dptr, dst, saved);
 }
-- 
1.5.6.3

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon/kms: more atom parser fixes

2010-04-09 Thread Alex Deucher
This should go to stable as well.  Forgot to add the stable cc.

Alex

On Fri, Apr 9, 2010 at 2:41 PM, Alex Deucher alexdeuc...@gmail.com wrote:
 From 44cc309323e38fc4fa7b7c7bea190aeaa0abd224 Mon Sep 17 00:00:00 2001
 From: Alex Deucher alexdeuc...@gmail.com
 Date: Fri, 9 Apr 2010 14:27:18 -0400
 Subject: [PATCH] drm/radeon/kms: more atom parser fixes

 shr/shl ops need the full dst rather than the pre-masked
 version.  Fixes fdo bug 27478 and kernel bug 15738.

 Signed-off-by: Alex Deucher alexdeuc...@gmail.com
 ---
  drivers/gpu/drm/radeon/atom.c |   12 ++--
  1 files changed, 10 insertions(+), 2 deletions(-)

 diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
 index 58845e0..44c8cbd 100644
 --- a/drivers/gpu/drm/radeon/atom.c
 +++ b/drivers/gpu/drm/radeon/atom.c
 @@ -905,13 +905,17 @@ static void
 atom_op_shift_right(atom_exec_context *ctx, int *ptr, int arg)
  static void atom_op_shl(atom_exec_context *ctx, int *ptr, int arg)
  {
        uint8_t attr = U8((*ptr)++), shift;
 -       uint32_t saved, dst;
 +       uint32_t saved, dst, tmp;
        int dptr = *ptr;
 +       uint32_t dst_align = atom_dst_to_src[(attr  3)  7][(attr  6)  
 3];
        SDEBUG(   dst: );
        dst = atom_get_dst(ctx, arg, attr, ptr, saved, 1);
 +       dst = saved;
        shift = atom_get_src(ctx, attr, ptr);
        SDEBUG(   shift: %d\n, shift);
        dst = shift;
 +       dst = atom_arg_mask[dst_align];
 +       dst = atom_arg_shift[dst_align];
        SDEBUG(   dst: );
        atom_put_dst(ctx, arg, attr, dptr, dst, saved);
  }
 @@ -919,13 +923,17 @@ static void atom_op_shl(atom_exec_context *ctx,
 int *ptr, int arg)
  static void atom_op_shr(atom_exec_context *ctx, int *ptr, int arg)
  {
        uint8_t attr = U8((*ptr)++), shift;
 -       uint32_t saved, dst;
 +       uint32_t saved, dst, tmp;
        int dptr = *ptr;
 +       uint32_t dst_align = atom_dst_to_src[(attr  3)  7][(attr  6)  
 3];
        SDEBUG(   dst: );
        dst = atom_get_dst(ctx, arg, attr, ptr, saved, 1);
 +       dst = saved;
        shift = atom_get_src(ctx, attr, ptr);
        SDEBUG(   shift: %d\n, shift);
        dst = shift;
 +       dst = atom_arg_mask[dst_align];
 +       dst = atom_arg_shift[dst_align];
        SDEBUG(   dst: );
        atom_put_dst(ctx, arg, attr, dptr, dst, saved);
  }
 --
 1.5.6.3


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon/kms: more atom parser fixes

2010-04-09 Thread Alex Deucher
Updated version with stable cc and remove some leftover unused vars
noticed by roysjosh on IRC.

Alex

On Fri, Apr 9, 2010 at 2:41 PM, Alex Deucher alexdeuc...@gmail.com wrote:
 From 44cc309323e38fc4fa7b7c7bea190aeaa0abd224 Mon Sep 17 00:00:00 2001
 From: Alex Deucher alexdeuc...@gmail.com
 Date: Fri, 9 Apr 2010 14:27:18 -0400
 Subject: [PATCH] drm/radeon/kms: more atom parser fixes

 shr/shl ops need the full dst rather than the pre-masked
 version.  Fixes fdo bug 27478 and kernel bug 15738.

 Signed-off-by: Alex Deucher alexdeuc...@gmail.com
 ---
  drivers/gpu/drm/radeon/atom.c |   12 ++--
  1 files changed, 10 insertions(+), 2 deletions(-)

 diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
 index 58845e0..44c8cbd 100644
 --- a/drivers/gpu/drm/radeon/atom.c
 +++ b/drivers/gpu/drm/radeon/atom.c
 @@ -905,13 +905,17 @@ static void
 atom_op_shift_right(atom_exec_context *ctx, int *ptr, int arg)
  static void atom_op_shl(atom_exec_context *ctx, int *ptr, int arg)
  {
        uint8_t attr = U8((*ptr)++), shift;
 -       uint32_t saved, dst;
 +       uint32_t saved, dst, tmp;
        int dptr = *ptr;
 +       uint32_t dst_align = atom_dst_to_src[(attr  3)  7][(attr  6)  
 3];
        SDEBUG(   dst: );
        dst = atom_get_dst(ctx, arg, attr, ptr, saved, 1);
 +       dst = saved;
        shift = atom_get_src(ctx, attr, ptr);
        SDEBUG(   shift: %d\n, shift);
        dst = shift;
 +       dst = atom_arg_mask[dst_align];
 +       dst = atom_arg_shift[dst_align];
        SDEBUG(   dst: );
        atom_put_dst(ctx, arg, attr, dptr, dst, saved);
  }
 @@ -919,13 +923,17 @@ static void atom_op_shl(atom_exec_context *ctx,
 int *ptr, int arg)
  static void atom_op_shr(atom_exec_context *ctx, int *ptr, int arg)
  {
        uint8_t attr = U8((*ptr)++), shift;
 -       uint32_t saved, dst;
 +       uint32_t saved, dst, tmp;
        int dptr = *ptr;
 +       uint32_t dst_align = atom_dst_to_src[(attr  3)  7][(attr  6)  
 3];
        SDEBUG(   dst: );
        dst = atom_get_dst(ctx, arg, attr, ptr, saved, 1);
 +       dst = saved;
        shift = atom_get_src(ctx, attr, ptr);
        SDEBUG(   shift: %d\n, shift);
        dst = shift;
 +       dst = atom_arg_mask[dst_align];
 +       dst = atom_arg_shift[dst_align];
        SDEBUG(   dst: );
        atom_put_dst(ctx, arg, attr, dptr, dst, saved);
  }
 --
 1.5.6.3

From abf2bcf1318e0170bf1f891ab7e5a7acf64091d8 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Fri, 9 Apr 2010 15:01:25 -0400
Subject: [PATCH] drm/radeon/kms: more atom parser fixes (v2)

shr/shl ops need the full dst rather than the pre-masked
version.  Fixes fdo bug 27478 and kernel bug 15738.

v2: remove some unsed vars, add comments

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
Cc: stable sta...@kernel.org
---
 drivers/gpu/drm/radeon/atom.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
index 58845e0..a8bf500 100644
--- a/drivers/gpu/drm/radeon/atom.c
+++ b/drivers/gpu/drm/radeon/atom.c
@@ -907,11 +907,16 @@ static void atom_op_shl(atom_exec_context *ctx, int *ptr, int arg)
 	uint8_t attr = U8((*ptr)++), shift;
 	uint32_t saved, dst;
 	int dptr = *ptr;
+	uint32_t dst_align = atom_dst_to_src[(attr  3)  7][(attr  6)  3];
 	SDEBUG(   dst: );
 	dst = atom_get_dst(ctx, arg, attr, ptr, saved, 1);
+	/* op needs to full dst value */
+	dst = saved;
 	shift = atom_get_src(ctx, attr, ptr);
 	SDEBUG(   shift: %d\n, shift);
 	dst = shift;
+	dst = atom_arg_mask[dst_align];
+	dst = atom_arg_shift[dst_align];
 	SDEBUG(   dst: );
 	atom_put_dst(ctx, arg, attr, dptr, dst, saved);
 }
@@ -921,11 +926,16 @@ static void atom_op_shr(atom_exec_context *ctx, int *ptr, int arg)
 	uint8_t attr = U8((*ptr)++), shift;
 	uint32_t saved, dst;
 	int dptr = *ptr;
+	uint32_t dst_align = atom_dst_to_src[(attr  3)  7][(attr  6)  3];
 	SDEBUG(   dst: );
 	dst = atom_get_dst(ctx, arg, attr, ptr, saved, 1);
+	/* op needs to full dst value */
+	dst = saved;
 	shift = atom_get_src(ctx, attr, ptr);
 	SDEBUG(   shift: %d\n, shift);
 	dst = shift;
+	dst = atom_arg_mask[dst_align];
+	dst = atom_arg_shift[dst_align];
 	SDEBUG(   dst: );
 	atom_put_dst(ctx, arg, attr, dptr, dst, saved);
 }
-- 
1.5.6.3

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 0/8] Add evergreen CP/interrupt/gfx init support

2010-04-08 Thread Alex Deucher
This patch set adds support for the command processor, interrupts, and
gfx init on evergreen asics.  It requires the new ucode available
here:
http://people.freedesktop.org/~agd5f/radeon_ucode/
These patches lay the groundwork for acceleration.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 1/8] drm/radeon/kms: update atombios.h power tables for evergreen

2010-04-08 Thread Alex Deucher
From bb78a06ab42e00b1fe6c260cdd9c1394872628ce Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Wed, 10 Feb 2010 17:30:05 -0500
Subject: [PATCH] drm/radeon/kms: update atombios.h power tables for evergreen

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/atombios.h |   76 -
 1 files changed, 74 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atombios.h
b/drivers/gpu/drm/radeon/atombios.h
index 6732b5d..26986c8 100644
--- a/drivers/gpu/drm/radeon/atombios.h
+++ b/drivers/gpu/drm/radeon/atombios.h
@@ -5742,6 +5742,9 @@ typedef struct _ATOM_PPLIB_THERMALCONTROLLER
 #define ATOM_PP_THERMALCONTROLLER_RV6xx 7
 #define ATOM_PP_THERMALCONTROLLER_RV770 8
 #define ATOM_PP_THERMALCONTROLLER_ADT7473   9
+#define ATOM_PP_THERMALCONTROLLER_EXTERNAL_GPIO 11
+#define ATOM_PP_THERMALCONTROLLER_EVERGREEN 12
+#define ATOM_PP_THERMALCONTROLLER_ADT7473_WITH_INTERNAL   0x89//
ADT7473 Fan Control + Internal Thermal Controller

 typedef struct _ATOM_PPLIB_STATE
 {
@@ -5749,6 +5752,26 @@ typedef struct _ATOM_PPLIB_STATE
 UCHAR ucClockStateIndices[1]; // variable-sized
 } ATOM_PPLIB_STATE;

+typedef struct _ATOM_PPLIB_FANTABLE
+{
+UCHAR   ucFanTableFormat;// Change this if the
table format changes or version changes so that the other fields are
not the same.
+UCHAR   ucTHyst; // Temperature
hysteresis. Integer.
+USHORT  usTMin;  // The temperature, in
0.01 centigrades, below which we just run at a minimal PWM.
+USHORT  usTMed;  // The middle
temperature where we change slopes.
+USHORT  usTHigh; // The high point above
TMed for adjusting the second slope.
+USHORT  usPWMMin;// The minimum PWM value
in percent (0.01% increments).
+USHORT  usPWMMed;// The PWM value (in
percent) at TMed.
+USHORT  usPWMHigh;   // The PWM value at THigh.
+} ATOM_PPLIB_FANTABLE;
+
+typedef struct _ATOM_PPLIB_EXTENDEDHEADER
+{
+USHORT  usSize;
+ULONG   ulMaxEngineClock;   // For Overdrive.
+ULONG   ulMaxMemoryClock;   // For Overdrive.
+// Add extra system parameters here, always adjust size to
include all fields.
+} ATOM_PPLIB_EXTENDEDHEADER;
+
  ATOM_PPLIB_POWERPLAYTABLE::ulPlatformCaps
 #define ATOM_PP_PLATFORM_CAP_BACKBIAS 1
 #define ATOM_PP_PLATFORM_CAP_POWERPLAY 2
@@ -5762,6 +5785,12 @@ typedef struct _ATOM_PPLIB_STATE
 #define ATOM_PP_PLATFORM_CAP_SIDEPORTCONTROL 512
 #define ATOM_PP_PLATFORM_CAP_TURNOFFPLL_ASPML1 1024
 #define ATOM_PP_PLATFORM_CAP_HTLINKCONTROL 2048
+#define ATOM_PP_PLATFORM_CAP_MVDDCONTROL 4096
+#define ATOM_PP_PLATFORM_CAP_GOTO_BOOT_ON_ALERT 0x2000
// Go to boot state on alerts, e.g. on an AC-DC transition.
+#define ATOM_PP_PLATFORM_CAP_DONT_WAIT_FOR_VBLANK_ON_ALERT 0x4000
// Do NOT wait for VBLANK during an alert (e.g. AC-DC transition).
+#define ATOM_PP_PLATFORM_CAP_VDDCI_CONTROL 0x8000
// Does the driver control VDDCI independently from VDDC.
+#define ATOM_PP_PLATFORM_CAP_REGULATOR_HOT 0x0001
// Enable the 'regulator hot' feature.
+#define ATOM_PP_PLATFORM_CAP_BACO  0x0002
// Does the driver supports BACO state.

 typedef struct _ATOM_PPLIB_POWERPLAYTABLE
 {
@@ -5797,6 +5826,21 @@ typedef struct _ATOM_PPLIB_POWERPLAYTABLE

 } ATOM_PPLIB_POWERPLAYTABLE;

+typedef struct _ATOM_PPLIB_POWERPLAYTABLE2
+{
+ATOM_PPLIB_POWERPLAYTABLE basicTable;
+UCHAR   ucNumCustomThermalPolicy;
+USHORT  usCustomThermalPolicyArrayOffset;
+}ATOM_PPLIB_POWERPLAYTABLE2, *LPATOM_PPLIB_POWERPLAYTABLE2;
+
+typedef struct _ATOM_PPLIB_POWERPLAYTABLE3
+{
+ATOM_PPLIB_POWERPLAYTABLE2 basicTable2;
+USHORT usFormatID;  // To
be used ONLY by PPGen.
+USHORT usFanTableOffset;
+USHORT usExtendendedHeaderOffset;
+} ATOM_PPLIB_POWERPLAYTABLE3, *LPATOM_PPLIB_POWERPLAYTABLE3;
+
  ATOM_PPLIB_NONCLOCK_INFO::usClassification
 #define ATOM_PPLIB_CLASSIFICATION_UI_MASK  0x0007
 #define ATOM_PPLIB_CLASSIFICATION_UI_SHIFT 0
@@ -5816,7 +5860,9 @@ typedef struct _ATOM_PPLIB_POWERPLAYTABLE
 #define ATOM_PPLIB_CLASSIFICATION_UVDSTATE   0x0400
 #define ATOM_PPLIB_CLASSIFICATION_3DLOW  0x0800
 #define ATOM_PPLIB_CLASSIFICATION_ACPI   0x1000
-// remaining 3 bits are reserved
+#define ATOM_PPLIB_CLASSIFICATION_HD2STATE   0x2000
+#define ATOM_PPLIB_CLASSIFICATION_HDSTATE0x4000
+#define ATOM_PPLIB_CLASSIFICATION_SDSTATE0x8000

  ATOM_PPLIB_NONCLOCK_INFO::ulCapsAndSettings
 #define ATOM_PPLIB_SINGLE_DISPLAY_ONLY   0x0001
@@ -5840,9 +5886,15 @@ typedef struct _ATOM_PPLIB_POWERPLAYTABLE

 #define ATOM_PPLIB_SOFTWARE_DISABLE_LOADBALANCING0x1000
 #define

[PATCH 2/8] drm/radeon/kms: add support for evergreen power tables

2010-04-08 Thread Alex Deucher
From 9fb9f6315e26372359963fff9bdd676ff38cb457 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Wed, 24 Mar 2010 16:39:45 -0400
Subject: [PATCH] drm/radeon/kms: add support for evergreen power tables

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_atombios.c |   44 -
 1 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c
b/drivers/gpu/drm/radeon/radeon_atombios.c
index 5673665..2730199 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -1462,6 +1462,10 @@ static const char *pp_lib_thermal_controller_names[] = {
RV6xx,
RV770,
ADT7473,
+   External GPIO,
+   Evergreen,
+   ADT7473 with internal,
+
 };

 union power_info {
@@ -1707,15 +1711,21 @@ void radeon_atombios_get_power_modes(struct
radeon_device *rdev)
break;
}
}
-   } else if (frev == 4) {
+   } else {
/* add the i2c bus for thermal/fan chip */
/* no support for internal controller yet */
if (power_info-info_4.sThermalController.ucType  0) {
if 
((power_info-info_4.sThermalController.ucType ==
ATOM_PP_THERMALCONTROLLER_RV6xx) ||
-   
(power_info-info_4.sThermalController.ucType ==
ATOM_PP_THERMALCONTROLLER_RV770)) {
+   
(power_info-info_4.sThermalController.ucType ==
ATOM_PP_THERMALCONTROLLER_RV770) ||
+   
(power_info-info_4.sThermalController.ucType ==
ATOM_PP_THERMALCONTROLLER_EVERGREEN)) {
DRM_INFO(Internal thermal controller 
%s fan control\n,
 
(power_info-info_4.sThermalController.ucFanParameters 
  ATOM_PP_FANPARAMETERS_NOFAN) 
? without : with);
+   } else if 
((power_info-info_4.sThermalController.ucType ==
+   
ATOM_PP_THERMALCONTROLLER_EXTERNAL_GPIO) ||
+  
(power_info-info_4.sThermalController.ucType ==
+   
ATOM_PP_THERMALCONTROLLER_ADT7473_WITH_INTERNAL)) {
+   DRM_INFO(Special thermal controller 
config\n);
} else {
DRM_INFO(Possible %s thermal 
controller at 0x%02x %s fan control\n,
 
pp_lib_thermal_controller_names[power_info-info_4.sThermalController.ucType],
@@ -1763,6 +1773,36 @@ void radeon_atombios_get_power_modes(struct
radeon_device *rdev)

rdev-pm.power_state[state_index].clock_info[mode_index].voltage.voltage
=
clock_info-usVDDC;
mode_index++;
+   } else if (ASIC_IS_DCE4(rdev)) {
+   struct 
_ATOM_PPLIB_EVERGREEN_CLOCK_INFO *clock_info =
+   (struct 
_ATOM_PPLIB_EVERGREEN_CLOCK_INFO *)
+   
(mode_info-atom_context-bios +
+data_offset +
+
le16_to_cpu(power_info-info_4.usClockInfoArrayOffset) +
+
(power_state-ucClockStateIndices[j] *
+ 
power_info-info_4.ucClockInfoSize));
+   sclk = 
le16_to_cpu(clock_info-usEngineClockLow);
+   sclk |= 
clock_info-ucEngineClockHigh  16;
+   mclk = 
le16_to_cpu(clock_info-usMemoryClockLow);
+   mclk |= 
clock_info-ucMemoryClockHigh  16;
+   
rdev-pm.power_state[state_index].clock_info[mode_index].mclk = mclk;
+   
rdev-pm.power_state[state_index].clock_info[mode_index].sclk = sclk;
+   /* skip invalid modes */
+   if 
((rdev-pm.power_state[state_index].clock_info[mode_index].mclk
== 0) ||
+   
(rdev-pm.power_state[state_index].clock_info[mode_index].sclk == 0))
+   continue

[PATCH 3/8] drm/radeon/kms/evergreen: add gart support

2010-04-08 Thread Alex Deucher
From 72005e636405fd7577ee6303c3ea95a227e5dc51 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Wed, 24 Mar 2010 13:20:41 -0400
Subject: [PATCH] drm/radeon/kms/evergreen: add gart support

Gart setup is more or less like r7xx.  Copy
rv770d.h to evergreend.h and fix up changes.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/evergreen.c   |   58 +---
 drivers/gpu/drm/radeon/evergreend.h  |  270 ++
 drivers/gpu/drm/radeon/radeon_asic.c |2 +-
 drivers/gpu/drm/radeon/radeon_asic.h |1 +
 4 files changed, 311 insertions(+), 20 deletions(-)
 create mode 100644 drivers/gpu/drm/radeon/evergreend.h

diff --git a/drivers/gpu/drm/radeon/evergreen.c
b/drivers/gpu/drm/radeon/evergreen.c
index 48e0dfb..022ef73 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -27,7 +27,7 @@
 #include radeon.h
 #include radeon_asic.h
 #include radeon_drm.h
-#include rv770d.h
+#include evergreend.h
 #include atom.h
 #include avivod.h
 #include evergreen_reg.h
@@ -82,10 +82,31 @@ static int evergreen_mc_wait_for_idle(struct
radeon_device *rdev)
 /*
  * GART
  */
+void evergreen_pcie_gart_tlb_flush(struct radeon_device *rdev)
+{
+   unsigned i;
+   u32 tmp;
+
+   WREG32(VM_CONTEXT0_REQUEST_RESPONSE, REQUEST_TYPE(1));
+   for (i = 0; i  rdev-usec_timeout; i++) {
+   /* read MC_STATUS */
+   tmp = RREG32(VM_CONTEXT0_REQUEST_RESPONSE);
+   tmp = (tmp  RESPONSE_TYPE_MASK)  RESPONSE_TYPE_SHIFT;
+   if (tmp == 2) {
+   printk(KERN_WARNING [drm] r600 flush TLB failed\n);
+   return;
+   }
+   if (tmp) {
+   return;
+   }
+   udelay(1);
+   }
+}
+
 int evergreen_pcie_gart_enable(struct radeon_device *rdev)
 {
u32 tmp;
-   int r, i;
+   int r;

if (rdev-gart.table.vram.robj == NULL) {
dev_err(rdev-dev, No VRAM object for PCIE GART.\n);
@@ -120,10 +141,9 @@ int evergreen_pcie_gart_enable(struct radeon_device *rdev)
RANGE_PROTECTION_FAULT_ENABLE_DEFAULT);
WREG32(VM_CONTEXT0_PROTECTION_FAULT_DEFAULT_ADDR,
(u32)(rdev-dummy_page.addr  12));
-   for (i = 1; i  7; i++)
-   WREG32(VM_CONTEXT0_CNTL + (i * 4), 0);
+   WREG32(VM_CONTEXT1_CNTL, 0);

-   r600_pcie_gart_tlb_flush(rdev);
+   evergreen_pcie_gart_tlb_flush(rdev);
rdev-gart.ready = true;
return 0;
 }
@@ -131,11 +151,11 @@ int evergreen_pcie_gart_enable(struct radeon_device *rdev)
 void evergreen_pcie_gart_disable(struct radeon_device *rdev)
 {
u32 tmp;
-   int i, r;
+   int r;

/* Disable all tables */
-   for (i = 0; i  7; i++)
-   WREG32(VM_CONTEXT0_CNTL + (i * 4), 0);
+   WREG32(VM_CONTEXT0_CNTL, 0);
+   WREG32(VM_CONTEXT1_CNTL, 0);

/* Setup L2 cache */
WREG32(VM_L2_CNTL, ENABLE_L2_FRAGMENT_PROCESSING |
@@ -172,7 +192,6 @@ void evergreen_pcie_gart_fini(struct radeon_device *rdev)
 void evergreen_agp_enable(struct radeon_device *rdev)
 {
u32 tmp;
-   int i;

/* Setup L2 cache */
WREG32(VM_L2_CNTL, ENABLE_L2_CACHE | ENABLE_L2_FRAGMENT_PROCESSING |
@@ -192,8 +211,8 @@ void evergreen_agp_enable(struct radeon_device *rdev)
WREG32(MC_VM_MB_L1_TLB1_CNTL, tmp);
WREG32(MC_VM_MB_L1_TLB2_CNTL, tmp);
WREG32(MC_VM_MB_L1_TLB3_CNTL, tmp);
-   for (i = 0; i  7; i++)
-   WREG32(VM_CONTEXT0_CNTL + (i * 4), 0);
+   WREG32(VM_CONTEXT0_CNTL, 0);
+   WREG32(VM_CONTEXT1_CNTL, 0);
 }

 static void evergreen_mc_stop(struct radeon_device *rdev, struct
evergreen_mc_save *save)
@@ -495,9 +514,9 @@ int evergreen_asic_reset(struct radeon_device *rdev)

 static int evergreen_startup(struct radeon_device *rdev)
 {
-#if 0
int r;

+#if 0
if (!rdev-me_fw || !rdev-pfp_fw || !rdev-rlc_fw) {
r = r600_init_microcode(rdev);
if (r) {
@@ -507,15 +526,13 @@ static int evergreen_startup(struct radeon_device *rdev)
}
 #endif
evergreen_mc_program(rdev);
-#if 0
if (rdev-flags  RADEON_IS_AGP) {
-   evergreem_agp_enable(rdev);
+   evergreen_agp_enable(rdev);
} else {
r = evergreen_pcie_gart_enable(rdev);
if (r)
return r;
}
-#endif
evergreen_gpu_init(rdev);
 #if 0
if (!rdev-r600_blit.shader_obj) {
@@ -602,7 +619,10 @@ int evergreen_suspend(struct radeon_device *rdev)
r700_cp_stop(rdev);
rdev-cp.ready = false;
r600_wb_disable(rdev);
+#endif
+
evergreen_pcie_gart_disable(rdev);
+#if 0
/* unpin shaders bo */
r = radeon_bo_reserve(rdev-r600_blit.shader_obj, false);
if (likely(r == 0)) {
@@ -712,18 +732,18 @@ int

[PATCH 4/8] drm/radeon/kms/evergreen: add soft reset function

2010-04-08 Thread Alex Deucher
From a86580ec5a6145cea7d6fda92deb104c0ad3fe0c Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Wed, 24 Mar 2010 13:26:36 -0400
Subject: [PATCH] drm/radeon/kms/evergreen: add soft reset function

Works pretty similarly to r6xx/r7xx.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/evergreen.c  |   73 ++-
 drivers/gpu/drm/radeon/evergreend.h |   63 +-
 2 files changed, 132 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen.c
b/drivers/gpu/drm/radeon/evergreen.c
index 022ef73..ac38d29 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -506,12 +506,81 @@ bool evergreen_gpu_is_lockup(struct radeon_device *rdev)
return false;
 }

-int evergreen_asic_reset(struct radeon_device *rdev)
+static int evergreen_gpu_soft_reset(struct radeon_device *rdev)
 {
-   /* FIXME: implement for evergreen */
+   struct evergreen_mc_save save;
+   u32 srbm_reset = 0;
+   u32 grbm_reset = 0;
+
+   dev_info(rdev-dev, GPU softreset \n);
+   dev_info(rdev-dev,   GRBM_STATUS=0x%08X\n,
+   RREG32(GRBM_STATUS));
+   dev_info(rdev-dev,   GRBM_STATUS_SE0=0x%08X\n,
+   RREG32(GRBM_STATUS_SE0));
+   dev_info(rdev-dev,   GRBM_STATUS_SE1=0x%08X\n,
+   RREG32(GRBM_STATUS_SE1));
+   dev_info(rdev-dev,   SRBM_STATUS=0x%08X\n,
+   RREG32(SRBM_STATUS));
+   evergreen_mc_stop(rdev, save);
+   if (evergreen_mc_wait_for_idle(rdev)) {
+   dev_warn(rdev-dev, Wait for MC idle timedout !\n);
+   }
+   /* Disable CP parsing/prefetching */
+   WREG32(CP_ME_CNTL, CP_ME_HALT | CP_PFP_HALT);
+
+   /* reset all the gfx blocks */
+   grbm_reset = (SOFT_RESET_CP |
+ SOFT_RESET_CB |
+ SOFT_RESET_DB |
+ SOFT_RESET_PA |
+ SOFT_RESET_SC |
+ SOFT_RESET_SPI |
+ SOFT_RESET_SH |
+ SOFT_RESET_SX |
+ SOFT_RESET_TC |
+ SOFT_RESET_TA |
+ SOFT_RESET_VC |
+ SOFT_RESET_VGT);
+
+   dev_info(rdev-dev,   GRBM_SOFT_RESET=0x%08X\n, grbm_reset);
+   WREG32(GRBM_SOFT_RESET, grbm_reset);
+   (void)RREG32(GRBM_SOFT_RESET);
+   udelay(50);
+   WREG32(GRBM_SOFT_RESET, 0);
+   (void)RREG32(GRBM_SOFT_RESET);
+
+   /* reset all the system blocks */
+   srbm_reset = SRBM_SOFT_RESET_ALL_MASK;
+
+   dev_info(rdev-dev,   SRBM_SOFT_RESET=0x%08X\n, srbm_reset);
+   WREG32(SRBM_SOFT_RESET, srbm_reset);
+   (void)RREG32(SRBM_SOFT_RESET);
+   udelay(50);
+   WREG32(SRBM_SOFT_RESET, 0);
+   (void)RREG32(SRBM_SOFT_RESET);
+   /* Wait a little for things to settle down */
+   udelay(50);
+   dev_info(rdev-dev,   GRBM_STATUS=0x%08X\n,
+   RREG32(GRBM_STATUS));
+   dev_info(rdev-dev,   GRBM_STATUS_SE0=0x%08X\n,
+   RREG32(GRBM_STATUS_SE0));
+   dev_info(rdev-dev,   GRBM_STATUS_SE1=0x%08X\n,
+   RREG32(GRBM_STATUS_SE1));
+   dev_info(rdev-dev,   SRBM_STATUS=0x%08X\n,
+   RREG32(SRBM_STATUS));
+   /* After reset we need to reinit the asic as GPU often endup in an
+* incoherent state.
+*/
+   atom_asic_init(rdev-mode_info.atom_context);
+   evergreen_mc_resume(rdev, save);
return 0;
 }

+int evergreen_asic_reset(struct radeon_device *rdev)
+{
+   return evergreen_gpu_soft_reset(rdev);
+}
+
 static int evergreen_startup(struct radeon_device *rdev)
 {
int r;
diff --git a/drivers/gpu/drm/radeon/evergreend.h
b/drivers/gpu/drm/radeon/evergreend.h
index 5cf707a..7c290a6 100644
--- a/drivers/gpu/drm/radeon/evergreend.h
+++ b/drivers/gpu/drm/radeon/evergreend.h
@@ -78,10 +78,53 @@
 #defineGRBM_CNTL   0x8000
 #defineGRBM_READ_TIMEOUT(x)((x)  
0)
 #defineGRBM_SOFT_RESET 0x8020
-#defineSOFT_RESET_CP   (10)
+#defineSOFT_RESET_CP   (1  0)
+#defineSOFT_RESET_CB   (1  1)
+#defineSOFT_RESET_DB   (1  3)
+#defineSOFT_RESET_PA   (1  5)
+#defineSOFT_RESET_SC   (1  6)
+#defineSOFT_RESET_SPI  (1  8)
+#defineSOFT_RESET_SH   (1  9)
+#defineSOFT_RESET_SX   (1  
10)
+#defineSOFT_RESET_TC   (1  
11)
+#defineSOFT_RESET_TA

[PATCH 6/8] drm/radeon/kms/evergreen: setup and enable the CP

2010-04-08 Thread Alex Deucher
From dda5b59f3adc61900e9fa5846e844be406343b86 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Wed, 24 Mar 2010 13:36:43 -0400
Subject: [PATCH] drm/radeon/kms/evergreen: setup and enable the CP

The command processor (CP) fetches command buffers and
feeds the GPU.  This patch requires the evergreen
family me and pfp ucode files.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/evergreen.c   |  117 --
 drivers/gpu/drm/radeon/evergreend.h  |2 +
 drivers/gpu/drm/radeon/r600.c|   47 --
 drivers/gpu/drm/radeon/radeon.h  |4 +
 drivers/gpu/drm/radeon/radeon_asic.c |6 +-
 drivers/gpu/drm/radeon/rv770.c   |   10 ++-
 6 files changed, 154 insertions(+), 32 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen.c
b/drivers/gpu/drm/radeon/evergreen.c
index c9289d9..54b346d 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -32,6 +32,9 @@
 #include avivod.h
 #include evergreen_reg.h

+#define EVERGREEN_PFP_UCODE_SIZE 1120
+#define EVERGREEN_PM4_UCODE_SIZE 1376
+
 static void evergreen_gpu_init(struct radeon_device *rdev);
 void evergreen_fini(struct radeon_device *rdev);

@@ -418,23 +421,91 @@ static void evergreen_mc_program(struct
radeon_device *rdev)
rv515_vga_render_disable(rdev);
 }

-#if 0
 /*
  * CP.
  */
-static void evergreen_cp_stop(struct radeon_device *rdev)
-{
-   /* XXX */
-}
-

 static int evergreen_cp_load_microcode(struct radeon_device *rdev)
 {
-   /* XXX */
+   const __be32 *fw_data;
+   int i;
+
+   if (!rdev-me_fw || !rdev-pfp_fw)
+   return -EINVAL;

+   r700_cp_stop(rdev);
+   WREG32(CP_RB_CNTL, RB_NO_UPDATE | (15  8) | (3  0));
+
+   fw_data = (const __be32 *)rdev-pfp_fw-data;
+   WREG32(CP_PFP_UCODE_ADDR, 0);
+   for (i = 0; i  EVERGREEN_PFP_UCODE_SIZE; i++)
+   WREG32(CP_PFP_UCODE_DATA, be32_to_cpup(fw_data++));
+   WREG32(CP_PFP_UCODE_ADDR, 0);
+
+   fw_data = (const __be32 *)rdev-me_fw-data;
+   WREG32(CP_ME_RAM_WADDR, 0);
+   for (i = 0; i  EVERGREEN_PM4_UCODE_SIZE; i++)
+   WREG32(CP_ME_RAM_DATA, be32_to_cpup(fw_data++));
+
+   WREG32(CP_PFP_UCODE_ADDR, 0);
+   WREG32(CP_ME_RAM_WADDR, 0);
+   WREG32(CP_ME_RAM_RADDR, 0);
return 0;
 }
+
+int evergreen_cp_resume(struct radeon_device *rdev)
+{
+   u32 tmp;
+   u32 rb_bufsz;
+   int r;
+
+   /* Reset cp; if cp is reset, then PA, SH, VGT also need to be reset */
+   WREG32(GRBM_SOFT_RESET, (SOFT_RESET_CP |
+SOFT_RESET_PA |
+SOFT_RESET_SH |
+SOFT_RESET_VGT |
+SOFT_RESET_SX));
+   RREG32(GRBM_SOFT_RESET);
+   mdelay(15);
+   WREG32(GRBM_SOFT_RESET, 0);
+   RREG32(GRBM_SOFT_RESET);
+
+   /* Set ring buffer size */
+   rb_bufsz = drm_order(rdev-cp.ring_size / 8);
+   tmp = RB_NO_UPDATE | (drm_order(RADEON_GPU_PAGE_SIZE/8)  8) | 
rb_bufsz;
+#ifdef __BIG_ENDIAN
+   tmp |= BUF_SWAP_32BIT;
 #endif
+   WREG32(CP_RB_CNTL, tmp);
+   WREG32(CP_SEM_WAIT_TIMER, 0x4);
+
+   /* Set the write pointer delay */
+   WREG32(CP_RB_WPTR_DELAY, 0);
+
+   /* Initialize the ring buffer's read and write pointers */
+   WREG32(CP_RB_CNTL, tmp | RB_RPTR_WR_ENA);
+   WREG32(CP_RB_RPTR_WR, 0);
+   WREG32(CP_RB_WPTR, 0);
+   WREG32(CP_RB_RPTR_ADDR, rdev-cp.gpu_addr  0x);
+   WREG32(CP_RB_RPTR_ADDR_HI, upper_32_bits(rdev-cp.gpu_addr));
+   mdelay(1);
+   WREG32(CP_RB_CNTL, tmp);
+
+   WREG32(CP_RB_BASE, rdev-cp.gpu_addr  8);
+   WREG32(CP_DEBUG, (1  27) | (1  28));
+
+   rdev-cp.rptr = RREG32(CP_RB_RPTR);
+   rdev-cp.wptr = RREG32(CP_RB_WPTR);
+
+   r600_cp_start(rdev);
+   rdev-cp.ready = true;
+   r = radeon_ring_test(rdev);
+   if (r) {
+   rdev-cp.ready = false;
+   return r;
+   }
+   return 0;
+}

 /*
  * Core functions
@@ -1133,15 +1204,15 @@ static int evergreen_startup(struct radeon_device *rdev)
 {
int r;

-#if 0
-   if (!rdev-me_fw || !rdev-pfp_fw || !rdev-rlc_fw) {
+   /* XXX until interrupts are supported */
+   if (!rdev-me_fw || !rdev-pfp_fw /*|| !rdev-rlc_fw*/) {
r = r600_init_microcode(rdev);
if (r) {
DRM_ERROR(Failed to load firmware!\n);
return r;
}
}
-#endif
+
evergreen_mc_program(rdev);
if (rdev-flags  RADEON_IS_AGP) {
evergreen_agp_enable(rdev);
@@ -1179,6 +1250,7 @@ static int evergreen_startup(struct radeon_device *rdev)
return r;
}
r600_irq_set(rdev);
+#endif

r = radeon_ring_init(rdev, rdev-cp.ring_size);
if (r)
@@ -1186,12 +1258,12 @@ static int evergreen_startup(struct

[PATCH 8/8] drm/radeon/kms/evergreen: add hpd support

2010-04-08 Thread Alex Deucher
From ada50ea25d5f80b83968d74cda1a9b70f614b849 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Fri, 26 Feb 2010 13:57:45 -0500
Subject: [PATCH] drm/radeon/kms/evergreen: add hpd support

Hot plug detect (hpd) for digital monitors

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/evergreen.c |  166 ++--
 drivers/gpu/drm/radeon/radeon.h|3 +-
 2 files changed, 161 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen.c
b/drivers/gpu/drm/radeon/evergreen.c
index 99e6505..acae0ea 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -41,28 +41,180 @@ void evergreen_fini(struct radeon_device *rdev);
 bool evergreen_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd)
 {
bool connected = false;
-   /* XXX */
+
+   switch (hpd) {
+   case RADEON_HPD_1:
+   if (RREG32(DC_HPD1_INT_STATUS)  DC_HPDx_SENSE)
+   connected = true;
+   break;
+   case RADEON_HPD_2:
+   if (RREG32(DC_HPD2_INT_STATUS)  DC_HPDx_SENSE)
+   connected = true;
+   break;
+   case RADEON_HPD_3:
+   if (RREG32(DC_HPD3_INT_STATUS)  DC_HPDx_SENSE)
+   connected = true;
+   break;
+   case RADEON_HPD_4:
+   if (RREG32(DC_HPD4_INT_STATUS)  DC_HPDx_SENSE)
+   connected = true;
+   break;
+   case RADEON_HPD_5:
+   if (RREG32(DC_HPD5_INT_STATUS)  DC_HPDx_SENSE)
+   connected = true;
+   break;
+   case RADEON_HPD_6:
+   if (RREG32(DC_HPD6_INT_STATUS)  DC_HPDx_SENSE)
+   connected = true;
+   break;
+   default:
+   break;
+   }
+
return connected;
 }

 void evergreen_hpd_set_polarity(struct radeon_device *rdev,
enum radeon_hpd_id hpd)
 {
-   /* XXX */
+   u32 tmp;
+   bool connected = evergreen_hpd_sense(rdev, hpd);
+
+   switch (hpd) {
+   case RADEON_HPD_1:
+   tmp = RREG32(DC_HPD1_INT_CONTROL);
+   if (connected)
+   tmp = ~DC_HPDx_INT_POLARITY;
+   else
+   tmp |= DC_HPDx_INT_POLARITY;
+   WREG32(DC_HPD1_INT_CONTROL, tmp);
+   break;
+   case RADEON_HPD_2:
+   tmp = RREG32(DC_HPD2_INT_CONTROL);
+   if (connected)
+   tmp = ~DC_HPDx_INT_POLARITY;
+   else
+   tmp |= DC_HPDx_INT_POLARITY;
+   WREG32(DC_HPD2_INT_CONTROL, tmp);
+   break;
+   case RADEON_HPD_3:
+   tmp = RREG32(DC_HPD3_INT_CONTROL);
+   if (connected)
+   tmp = ~DC_HPDx_INT_POLARITY;
+   else
+   tmp |= DC_HPDx_INT_POLARITY;
+   WREG32(DC_HPD3_INT_CONTROL, tmp);
+   break;
+   case RADEON_HPD_4:
+   tmp = RREG32(DC_HPD4_INT_CONTROL);
+   if (connected)
+   tmp = ~DC_HPDx_INT_POLARITY;
+   else
+   tmp |= DC_HPDx_INT_POLARITY;
+   WREG32(DC_HPD4_INT_CONTROL, tmp);
+   break;
+   case RADEON_HPD_5:
+   tmp = RREG32(DC_HPD5_INT_CONTROL);
+   if (connected)
+   tmp = ~DC_HPDx_INT_POLARITY;
+   else
+   tmp |= DC_HPDx_INT_POLARITY;
+   WREG32(DC_HPD5_INT_CONTROL, tmp);
+   break;
+   case RADEON_HPD_6:
+   tmp = RREG32(DC_HPD6_INT_CONTROL);
+   if (connected)
+   tmp = ~DC_HPDx_INT_POLARITY;
+   else
+   tmp |= DC_HPDx_INT_POLARITY;
+   WREG32(DC_HPD6_INT_CONTROL, tmp);
+   break;
+   default:
+   break;
+   }
 }

 void evergreen_hpd_init(struct radeon_device *rdev)
 {
-   /* XXX */
+   struct drm_device *dev = rdev-ddev;
+   struct drm_connector *connector;
+   u32 tmp = DC_HPDx_CONNECTION_TIMER(0x9c4) |
+   DC_HPDx_RX_INT_TIMER(0xfa) | DC_HPDx_EN;
+
+   list_for_each_entry(connector, dev-mode_config.connector_list, head) {
+   struct radeon_connector *radeon_connector = 
to_radeon_connector(connector);
+   switch (radeon_connector-hpd.hpd) {
+   case RADEON_HPD_1:
+   WREG32(DC_HPD1_CONTROL, tmp);
+   rdev-irq.hpd[0] = true;
+   break;
+   case RADEON_HPD_2:
+   WREG32(DC_HPD2_CONTROL, tmp);
+   rdev-irq.hpd[1] = true;
+   break;
+   case RADEON_HPD_3:
+   WREG32(DC_HPD3_CONTROL

Re: Move lists to freedesktop.org?

2010-04-08 Thread Alex Deucher
On Thu, Apr 8, 2010 at 6:21 PM, Brian Paul bri...@vmware.com wrote:

 Unless there's some objection I'm going to subscribe everyone to the
 new FD.O-based mesa-dev mailing list who's on the mesa3d-dev list.
 Probably in the next 24 hours.

 Then, some of you may have to log into the mailman interface
 (http://lists.freedesktop.org/mailman/listinfo/mesa-dev) to set digest
 mode, etc.

 -Brian

Are there plans to move dri-devel as well?

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms/combios: verify dac_adj values are valid

2010-04-06 Thread Alex Deucher
From 8a5f015013cf87433f59383e08cf7757647c0eb0 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Tue, 6 Apr 2010 12:35:26 -0400
Subject: [PATCH] drm/radeon/kms/combios: verify dac_adj values are valid

Some vbios dac_adj tables are all zeros.  Check for that
case and use the default table if so.

Should fix fdo bug 27478.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
Cc: stable sta...@kernel.org
---
 drivers/gpu/drm/radeon/radeon_combios.c |   20 +++-
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_combios.c
b/drivers/gpu/drm/radeon/radeon_combios.c
index ecef5b4..a80abc4 100644
--- a/drivers/gpu/drm/radeon/radeon_combios.c
+++ b/drivers/gpu/drm/radeon/radeon_combios.c
@@ -760,7 +760,9 @@ struct radeon_encoder_primary_dac
*radeon_combios_get_primary_dac_info(struct
dac = RBIOS8(dac_info + 0x3)  0xf;
p_dac-ps2_pdac_adj = (bg  8) | (dac);
}
-   found = 1;
+   /* if the values are all zeros, use the table */
+   if (p_dac-ps2_pdac_adj)
+   found = 1;
}

if (!found) /* fallback to defaults */
@@ -895,7 +897,9 @@ struct radeon_encoder_tv_dac
*radeon_combios_get_tv_dac_info(struct
bg = RBIOS8(dac_info + 0x10)  0xf;
dac = RBIOS8(dac_info + 0x11)  0xf;
tv_dac-ntsc_tvdac_adj = (bg  16) | (dac  20);
-   found = 1;
+   /* if the values are all zeros, use the table */
+   if (tv_dac-ps2_tvdac_adj)
+   found = 1;
} else if (rev  1) {
bg = RBIOS8(dac_info + 0xc)  0xf;
dac = (RBIOS8(dac_info + 0xc)  4)  0xf;
@@ -908,7 +912,9 @@ struct radeon_encoder_tv_dac
*radeon_combios_get_tv_dac_info(struct
bg = RBIOS8(dac_info + 0xe)  0xf;
dac = (RBIOS8(dac_info + 0xe)  4)  0xf;
tv_dac-ntsc_tvdac_adj = (bg  16) | (dac  20);
-   found = 1;
+   /* if the values are all zeros, use the table */
+   if (tv_dac-ps2_tvdac_adj)
+   found = 1;
}
tv_dac-tv_std = radeon_combios_get_tv_info(rdev);
}
@@ -925,7 +931,9 @@ struct radeon_encoder_tv_dac
*radeon_combios_get_tv_dac_info(struct
(bg  16) | (dac  20);
tv_dac-pal_tvdac_adj = tv_dac-ps2_tvdac_adj;
tv_dac-ntsc_tvdac_adj = tv_dac-ps2_tvdac_adj;
-   found = 1;
+   /* if the values are all zeros, use the table */
+   if (tv_dac-ps2_tvdac_adj)
+   found = 1;
} else {
bg = RBIOS8(dac_info + 0x4)  0xf;
dac = RBIOS8(dac_info + 0x5)  0xf;
@@ -933,7 +941,9 @@ struct radeon_encoder_tv_dac
*radeon_combios_get_tv_dac_info(struct
(bg  16) | (dac  20);
tv_dac-pal_tvdac_adj = tv_dac-ps2_tvdac_adj;
tv_dac-ntsc_tvdac_adj = tv_dac-ps2_tvdac_adj;
-   found = 1;
+   /* if the values are all zeros, use the table */
+   if (tv_dac-ps2_tvdac_adj)
+   found = 1;
}
} else {
DRM_INFO(No TV DAC info found in BIOS\n);
-- 
1.5.6.3


0001-drm-radeon-kms-combios-verify-dac_adj-values-are-va.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms: fix washed out image on legacy tv dac

2010-04-05 Thread Alex Deucher
From dd3c60875d551a2381a6819203a5f6cc2936f678 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Mon, 5 Apr 2010 23:57:52 -0400
Subject: [PATCH] drm/radeon/kms: fix washed out image on legacy tv dac

bad cast was overwriting the tvdac adj values
Fixes fdo bug 27478

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_connectors.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c
b/drivers/gpu/drm/radeon/radeon_connectors.c
index 60d5981..3fba505 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -315,7 +315,7 @@ int radeon_connector_set_property(struct
drm_connector *connector, struct drm_pr
radeon_encoder = to_radeon_encoder(encoder);
if (!radeon_encoder-enc_priv)
return 0;
-   if (rdev-is_atom_bios) {
+   if (ASIC_IS_AVIVO(rdev) || radeon_r4xx_atom) {
struct radeon_encoder_atom_dac *dac_int;
dac_int = radeon_encoder-enc_priv;
dac_int-tv_std = val;
-- 
1.5.6.3


0001-drm-radeon-kms-fix-washed-out-image-on-legacy-tv-da.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon/kms: fix washed out image on legacy tv dac

2010-04-05 Thread Alex Deucher
This should go to stable.  I can re-sent with the stable cc if you want.

Alex

On Tue, Apr 6, 2010 at 12:02 AM, Alex Deucher alexdeuc...@gmail.com wrote:
 From dd3c60875d551a2381a6819203a5f6cc2936f678 Mon Sep 17 00:00:00 2001
 From: Alex Deucher alexdeuc...@gmail.com
 Date: Mon, 5 Apr 2010 23:57:52 -0400
 Subject: [PATCH] drm/radeon/kms: fix washed out image on legacy tv dac

 bad cast was overwriting the tvdac adj values
 Fixes fdo bug 27478

 Signed-off-by: Alex Deucher alexdeuc...@gmail.com
 ---
  drivers/gpu/drm/radeon/radeon_connectors.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

 diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c
 b/drivers/gpu/drm/radeon/radeon_connectors.c
 index 60d5981..3fba505 100644
 --- a/drivers/gpu/drm/radeon/radeon_connectors.c
 +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
 @@ -315,7 +315,7 @@ int radeon_connector_set_property(struct
 drm_connector *connector, struct drm_pr
                radeon_encoder = to_radeon_encoder(encoder);
                if (!radeon_encoder-enc_priv)
                        return 0;
 -               if (rdev-is_atom_bios) {
 +               if (ASIC_IS_AVIVO(rdev) || radeon_r4xx_atom) {
                        struct radeon_encoder_atom_dac *dac_int;
                        dac_int = radeon_encoder-enc_priv;
                        dac_int-tv_std = val;
 --
 1.5.6.3


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms: legacy tv dac cleanup

2010-04-05 Thread Alex Deucher
From 86a4f52d0387851b73cd41c3fde515c5d35f9935 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Tue, 6 Apr 2010 00:05:46 -0400
Subject: [PATCH] drm/radeon/kms: legacy tv dac cleanup

- fix formatting
- clean up tv_dac_cntl handling for tv

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_legacy_encoders.c |   58 +--
 1 files changed, 33 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
index f4f15dd..341df86 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
@@ -817,8 +817,8 @@ static void radeon_legacy_tv_dac_dpms(struct
drm_encoder *encoder, int mode)
crtc2_gen_cntl = ~RADEON_CRTC2_CRT2_ON;

if (rdev-family == CHIP_R420 ||
-   rdev-family == CHIP_R423 ||
-   rdev-family == CHIP_RV410)
+   rdev-family == CHIP_R423 ||
+   rdev-family == CHIP_RV410)
tv_dac_cntl |= (R420_TV_DAC_RDACPD |
R420_TV_DAC_GDACPD |
R420_TV_DAC_BDACPD |
@@ -892,35 +892,43 @@ static void radeon_legacy_tv_dac_mode_set(struct
drm_encoder *encoder,
if (rdev-family != CHIP_R200) {
tv_dac_cntl = RREG32(RADEON_TV_DAC_CNTL);
if (rdev-family == CHIP_R420 ||
-   rdev-family == CHIP_R423 ||
-   rdev-family == CHIP_RV410) {
+   rdev-family == CHIP_R423 ||
+   rdev-family == CHIP_RV410) {
tv_dac_cntl = ~(RADEON_TV_DAC_STD_MASK |
-   RADEON_TV_DAC_BGADJ_MASK |
-   R420_TV_DAC_DACADJ_MASK |
-   R420_TV_DAC_RDACPD |
-   R420_TV_DAC_GDACPD |
-   R420_TV_DAC_BDACPD |
-   R420_TV_DAC_TVENABLE);
+RADEON_TV_DAC_BGADJ_MASK |
+R420_TV_DAC_DACADJ_MASK |
+R420_TV_DAC_RDACPD |
+R420_TV_DAC_GDACPD |
+R420_TV_DAC_BDACPD |
+R420_TV_DAC_TVENABLE);
} else {
tv_dac_cntl = ~(RADEON_TV_DAC_STD_MASK |
-   RADEON_TV_DAC_BGADJ_MASK |
-   RADEON_TV_DAC_DACADJ_MASK |
-   RADEON_TV_DAC_RDACPD |
-   RADEON_TV_DAC_GDACPD |
-   RADEON_TV_DAC_BDACPD);
+RADEON_TV_DAC_BGADJ_MASK |
+RADEON_TV_DAC_DACADJ_MASK |
+RADEON_TV_DAC_RDACPD |
+RADEON_TV_DAC_GDACPD |
+RADEON_TV_DAC_BDACPD);
}

-   /*  FIXME TV */
-   if (tv_dac) {
-   struct radeon_encoder_tv_dac *tv_dac = 
radeon_encoder-enc_priv;
-   tv_dac_cntl |= (RADEON_TV_DAC_NBLANK |
-   RADEON_TV_DAC_NHOLD |
-   RADEON_TV_DAC_STD_PS2 |
-   tv_dac-ps2_tvdac_adj);
+   tv_dac_cntl |= RADEON_TV_DAC_NBLANK | RADEON_TV_DAC_NHOLD;
+
+   if (is_tv) {
+   if (tv_dac-tv_std == TV_STD_NTSC ||
+   tv_dac-tv_std == TV_STD_NTSC_J ||
+   tv_dac-tv_std == TV_STD_PAL_M ||
+   tv_dac-tv_std == TV_STD_PAL_60)
+   tv_dac_cntl |= tv_dac-ntsc_tvdac_adj;
+   else
+   tv_dac_cntl |= tv_dac-pal_tvdac_adj;
+
+   if (tv_dac-tv_std == TV_STD_NTSC ||
+   tv_dac-tv_std == TV_STD_NTSC_J)
+   tv_dac_cntl |= RADEON_TV_DAC_STD_NTSC;
+   else
+   tv_dac_cntl |= RADEON_TV_DAC_STD_PAL;
} else
-   tv_dac_cntl |= (RADEON_TV_DAC_NBLANK |
-   RADEON_TV_DAC_NHOLD |
-   RADEON_TV_DAC_STD_PS2);
+   tv_dac_cntl |= (RADEON_TV_DAC_STD_PS2 |
+   tv_dac-ps2_tvdac_adj

[PATCH] drm/radeon/kms: clean up atom dac handling

2010-04-05 Thread Alex Deucher
From affc52fe492309291ca14902cb88e156ff3bb9ea Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Tue, 6 Apr 2010 01:22:41 -0400
Subject: [PATCH] drm/radeon/kms: clean up atom dac handling

- make sure legacy dac1 has an enc priv
- remove unused num var
- no need for extra tv_dac var in atom dac functions

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_encoders.c |   21 +++--
 1 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c
b/drivers/gpu/drm/radeon/radeon_encoders.c
index b89e287..ea1045b 100644
--- a/drivers/gpu/drm/radeon/radeon_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_encoders.c
@@ -314,12 +314,8 @@ atombios_dac_setup(struct drm_encoder *encoder, int action)
struct radeon_device *rdev = dev-dev_private;
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
DAC_ENCODER_CONTROL_PS_ALLOCATION args;
-   int index = 0, num = 0;
+   int index = 0;
struct radeon_encoder_atom_dac *dac_info = radeon_encoder-enc_priv;
-   enum radeon_tv_std tv_std = TV_STD_NTSC;
-
-   if (dac_info-tv_std)
-   tv_std = dac_info-tv_std;

memset(args, 0, sizeof(args));

@@ -327,12 +323,10 @@ atombios_dac_setup(struct drm_encoder *encoder,
int action)
case ENCODER_OBJECT_ID_INTERNAL_DAC1:
case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1:
index = GetIndexIntoMasterTable(COMMAND, DAC1EncoderControl);
-   num = 1;
break;
case ENCODER_OBJECT_ID_INTERNAL_DAC2:
case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC2:
index = GetIndexIntoMasterTable(COMMAND, DAC2EncoderControl);
-   num = 2;
break;
}

@@ -343,7 +337,7 @@ atombios_dac_setup(struct drm_encoder *encoder, int action)
else if (radeon_encoder-active_device  (ATOM_DEVICE_CV_SUPPORT))
args.ucDacStandard = ATOM_DAC1_CV;
else {
-   switch (tv_std) {
+   switch (dac_info-tv_std) {
case TV_STD_PAL:
case TV_STD_PAL_M:
case TV_STD_SCART_PAL:
@@ -374,10 +368,6 @@ atombios_tv_setup(struct drm_encoder *encoder, int action)
TV_ENCODER_CONTROL_PS_ALLOCATION args;
int index = 0;
struct radeon_encoder_atom_dac *dac_info = radeon_encoder-enc_priv;
-   enum radeon_tv_std tv_std = TV_STD_NTSC;
-
-   if (dac_info-tv_std)
-   tv_std = dac_info-tv_std;

memset(args, 0, sizeof(args));

@@ -388,7 +378,7 @@ atombios_tv_setup(struct drm_encoder *encoder, int action)
if (radeon_encoder-active_device  (ATOM_DEVICE_CV_SUPPORT))
args.sTVEncoder.ucTvStandard = ATOM_TV_CV;
else {
-   switch (tv_std) {
+   switch (dac_info-tv_std) {
case TV_STD_NTSC:
args.sTVEncoder.ucTvStandard = ATOM_TV_NTSC;
break;
@@ -1556,12 +1546,14 @@ static const struct drm_encoder_funcs
radeon_atom_enc_funcs = {
 struct radeon_encoder_atom_dac *
 radeon_atombios_set_dac_info(struct radeon_encoder *radeon_encoder)
 {
+   struct drm_device *dev = radeon_encoder-base.dev;
+   struct radeon_device *rdev = dev-dev_private;
struct radeon_encoder_atom_dac *dac = kzalloc(sizeof(struct
radeon_encoder_atom_dac), GFP_KERNEL);

if (!dac)
return NULL;

-   dac-tv_std = TV_STD_NTSC;
+   dac-tv_std = radeon_atombios_get_tv_info(rdev);
return dac;
 }

@@ -1639,6 +1631,7 @@ radeon_add_atom_encoder(struct drm_device *dev,
uint32_t encoder_id, uint32_t su
break;
case ENCODER_OBJECT_ID_INTERNAL_DAC1:
drm_encoder_init(dev, encoder, radeon_atom_enc_funcs, 
DRM_MODE_ENCODER_DAC);
+   radeon_encoder-enc_priv = 
radeon_atombios_set_dac_info(radeon_encoder);
drm_encoder_helper_add(encoder, radeon_atom_dac_helper_funcs);
break;
case ENCODER_OBJECT_ID_INTERNAL_DAC2:
-- 
1.5.6.3


0001-drm-radeon-kms-clean-up-atom-dac-handling.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Regression, post-rc2] Commit a5ee4eb7541 breaks OpenGL on RS780 (was: Re: Linux 2.6.34-rc3)

2010-04-01 Thread Alex Deucher
On Thu, Apr 1, 2010 at 2:36 AM, Clemens Ladisch clem...@ladisch.de wrote:
 Alex Deucher wrote:
 On Wed, Mar 31, 2010 at 9:13 PM, Rafael J. Wysocki r...@sisk.pl wrote:
 On Tuesday 30 March 2010, Rafael J. Wysocki wrote:
        PCI quirk: RS780/RS880: work around missing MSI initialization

 This one (commit a5ee4eb7541) broke OpenGL acceleration on my new test box
 which happens to have a RS780.

 So it's better to disable MSI unconditionally.

 Rafael, can you check if MSI works for the HDMI audio device?
 (I'd guess it doesn't.)

 I also have the attached patch queued in via Dave's tree to disable
 MSI on all IGP chips for the time being.

 This disables MSI only for the graphics device.  I'd prefer to have
 the quirk on its bridge so that MSI gets disabled for the HDMI audio
 device too, to avoid having to duplicate this quirk in the snd-hda-intel
 driver.

 ==

 PCI quirk: RS780/RS880: disable MSI completely

 The missing initialization of the nb_cntl.strap_msi_enable does not seem
 to be the only problem that prevents MSI, so that quirk is not
 sufficient to enable MSI on all machines.  To be safe, unconditionally
 disable MSI for the internal graphics and HDMI audio on these chipsets.

 Signed-off-by: Clemens Ladisch clem...@ladisch.de

Works fine here.

Tested-by: Alex Deucher alexdeuc...@gmail.com


 --- a/drivers/pci/quirks.c
 +++ b/drivers/pci/quirks.c
 @@ -2123,6 +2123,8 @@ static void __devinit quirk_disable_msi(struct pci_dev 
 *dev)
        }
  }
  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, 
 quirk_disable_msi);
 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x9602, quirk_disable_msi);
 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASUSTEK, 0x9602, quirk_disable_msi);
  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, 0xa238, quirk_disable_msi);

  /* Go through the list of Hypertransport capabilities and
 @@ -2495,39 +2497,6 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4374,
  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4375,
                        quirk_msi_intx_disable_bug);

 -/*
 - * MSI does not work with the AMD RS780/RS880 internal graphics and HDMI 
 audio
 - * devices unless the BIOS has initialized the nb_cntl.strap_msi_enable bit.
 - */
 -static void __init rs780_int_gfx_disable_msi(struct pci_dev *int_gfx_bridge)
 -{
 -       u32 nb_cntl;
 -
 -       if (!int_gfx_bridge-subordinate)
 -               return;
 -
 -       pci_bus_write_config_dword(int_gfx_bridge-bus, PCI_DEVFN(0, 0),
 -                                  0x60, 0);
 -       pci_bus_read_config_dword(int_gfx_bridge-bus, PCI_DEVFN(0, 0),
 -                                 0x64, nb_cntl);
 -
 -       if (!(nb_cntl  BIT(10))) {
 -               dev_warn(int_gfx_bridge-dev,
 -                        FW_WARN RS780: MSI for internal graphics 
 disabled\n);
 -               int_gfx_bridge-subordinate-bus_flags |= 
 PCI_BUS_FLAGS_NO_MSI;
 -       }
 -}
 -
 -#define PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX    0x9602
 -
 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD,
 -                       PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX,
 -                       rs780_int_gfx_disable_msi);
 -/* wrong vendor ID on M4A785TD motherboard: */
 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASUSTEK,
 -                       PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX,
 -                       rs780_int_gfx_disable_msi);
 -
  #endif /* CONFIG_PCI_MSI */

  #ifdef CONFIG_PCI_IOV


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms/atom: fix gpio i2c table overrun

2010-04-01 Thread Alex Deucher
From 540daa603d7fa968b858c04f32ebad7d256b480c Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Thu, 1 Apr 2010 12:55:34 -0400
Subject: [PATCH] drm/radeon/kms/atom: fix gpio i2c table overrun

The GPIO_I2C_INFO table does not always have
ATOM_MAX_SUPPORTED_DEVICE entries. Limit
the number of indices to the size of the
table.

Should fix Novell bug 589022.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
Cc: Stable sta...@kernel.org
---
 drivers/gpu/drm/radeon/radeon_atombios.c |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c
b/drivers/gpu/drm/radeon/radeon_atombios.c
index b969eda..bb37da4 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -69,16 +69,19 @@ static inline struct radeon_i2c_bus_rec
radeon_lookup_i2c_gpio(struct radeon_dev
struct radeon_i2c_bus_rec i2c;
int index = GetIndexIntoMasterTable(DATA, GPIO_I2C_Info);
struct _ATOM_GPIO_I2C_INFO *i2c_info;
-   uint16_t data_offset;
-   int i;
+   uint16_t data_offset, size;
+   int i, num_indices;

memset(i2c, 0, sizeof(struct radeon_i2c_bus_rec));
i2c.valid = false;

-   if (atom_parse_data_header(ctx, index, NULL, NULL, NULL, data_offset)) 
{
+   if (atom_parse_data_header(ctx, index, size, NULL, NULL, 
data_offset)) {
i2c_info = (struct _ATOM_GPIO_I2C_INFO *)(ctx-bios + 
data_offset);

-   for (i = 0; i  ATOM_MAX_SUPPORTED_DEVICE; i++) {
+   num_indices = (size - sizeof(ATOM_COMMON_TABLE_HEADER)) /
+   sizeof(ATOM_GPIO_I2C_INFO);
+
+   for (i = 0; i  num_indices; i++) {
gpio = i2c_info-asGPIO_Info[i];

if (gpio-sucI2cId.ucAccess == id) {
-- 
1.5.6.3


0001-drm-radeon-kms-atom-fix-gpio-i2c-table-overrun.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Regression, post-rc2] Commit a5ee4eb7541 breaks OpenGL on RS780 (was: Re: Linux 2.6.34-rc3)

2010-04-01 Thread Alex Deucher
On Thu, Apr 1, 2010 at 1:24 PM, Linus Torvalds
torva...@linux-foundation.org wrote:


 On Thu, 1 Apr 2010, Alex Deucher wrote:

 Clemems' PCI quirk: RS780/RS880: disable MSI completely patch is the
 right approach I think.  Note that it's only devices hung off the int
 gfx pci to pci bridge that have broken MSI (gfx and audio).  MSI works
 fine on the PCIE slots.  I have a similar patch for rs400 chips on bug
 15626:
 https://bugzilla.kernel.org/show_bug.cgi?id=15626

 Hmm. Does 'pci_msi_enable' only cover regular PCI devices? Or will that
 pci_no_msi() quirk disable MSI for PCIE too? I think it will trigger for
 PCIE drivers too.

 Put another way: it sounds like the quirk now disables MSI for all
 devices. Maybe there would some more targeted mode?


What I meant to say was MSI works fine on bridges other than the
bridge the internal gfx lives on.  quirk_disable_msi() just disables
MSI on the devices on that particular bridge as far as I understand
it, but I'm by no means an expert on the PCI code.  E.g., on my RS780
board, MSIs are only problematic on the integrated gfx chip.  MSIs
work fine on PCI/PCIE add-on cards and the integrated Ethernet.

Alex

                Linus


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon/kms/atom: fix gpio i2c table overrun

2010-04-01 Thread Alex Deucher
ARGH!  typo in the last one.  fixed version attached.

From e8c539f60ae55d002a19534a375448a2cd3aa2b3 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Thu, 1 Apr 2010 15:06:11 -0400
Subject: [PATCH] drm/radeon/kms/atom: fix gpio i2c table overrun (v2)

The GPIO_I2C_INFO table does not always have
ATOM_MAX_SUPPORTED_DEVICE entries. Limit
the number of indices to the size of the
table.

Should fix Novell bug 589022.

v2: fix typo

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
Cc: Stable sta...@kernel.org
---
 drivers/gpu/drm/radeon/radeon_atombios.c |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c
b/drivers/gpu/drm/radeon/radeon_atombios.c
index b969eda..2730199 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -69,16 +69,19 @@ static inline struct radeon_i2c_bus_rec
radeon_lookup_i2c_gpio(struct radeon_dev
struct radeon_i2c_bus_rec i2c;
int index = GetIndexIntoMasterTable(DATA, GPIO_I2C_Info);
struct _ATOM_GPIO_I2C_INFO *i2c_info;
-   uint16_t data_offset;
-   int i;
+   uint16_t data_offset, size;
+   int i, num_indices;

memset(i2c, 0, sizeof(struct radeon_i2c_bus_rec));
i2c.valid = false;

-   if (atom_parse_data_header(ctx, index, NULL, NULL, NULL, data_offset)) 
{
+   if (atom_parse_data_header(ctx, index, size, NULL, NULL, 
data_offset)) {
i2c_info = (struct _ATOM_GPIO_I2C_INFO *)(ctx-bios + 
data_offset);

-   for (i = 0; i  ATOM_MAX_SUPPORTED_DEVICE; i++) {
+   num_indices = (size - sizeof(ATOM_COMMON_TABLE_HEADER)) /
+   sizeof(ATOM_GPIO_I2C_ASSIGMENT);
+
+   for (i = 0; i  num_indices; i++) {
gpio = i2c_info-asGPIO_Info[i];

if (gpio-sucI2cId.ucAccess == id) {
-- 
1.5.6.3



On Thu, Apr 1, 2010 at 12:57 PM, Alex Deucher alexdeuc...@gmail.com wrote:
 From 540daa603d7fa968b858c04f32ebad7d256b480c Mon Sep 17 00:00:00 2001
 From: Alex Deucher alexdeuc...@gmail.com
 Date: Thu, 1 Apr 2010 12:55:34 -0400
 Subject: [PATCH] drm/radeon/kms/atom: fix gpio i2c table overrun

 The GPIO_I2C_INFO table does not always have
 ATOM_MAX_SUPPORTED_DEVICE entries. Limit
 the number of indices to the size of the
 table.

 Should fix Novell bug 589022.

 Signed-off-by: Alex Deucher alexdeuc...@gmail.com
 Cc: Stable sta...@kernel.org
 ---
  drivers/gpu/drm/radeon/radeon_atombios.c |   11 +++
  1 files changed, 7 insertions(+), 4 deletions(-)

 diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c
 b/drivers/gpu/drm/radeon/radeon_atombios.c
 index b969eda..bb37da4 100644
 --- a/drivers/gpu/drm/radeon/radeon_atombios.c
 +++ b/drivers/gpu/drm/radeon/radeon_atombios.c
 @@ -69,16 +69,19 @@ static inline struct radeon_i2c_bus_rec
 radeon_lookup_i2c_gpio(struct radeon_dev
        struct radeon_i2c_bus_rec i2c;
        int index = GetIndexIntoMasterTable(DATA, GPIO_I2C_Info);
        struct _ATOM_GPIO_I2C_INFO *i2c_info;
 -       uint16_t data_offset;
 -       int i;
 +       uint16_t data_offset, size;
 +       int i, num_indices;

        memset(i2c, 0, sizeof(struct radeon_i2c_bus_rec));
        i2c.valid = false;

 -       if (atom_parse_data_header(ctx, index, NULL, NULL, NULL, 
 data_offset)) {
 +       if (atom_parse_data_header(ctx, index, size, NULL, NULL, 
 data_offset)) {
                i2c_info = (struct _ATOM_GPIO_I2C_INFO *)(ctx-bios + 
 data_offset);

 -               for (i = 0; i  ATOM_MAX_SUPPORTED_DEVICE; i++) {
 +               num_indices = (size - sizeof(ATOM_COMMON_TABLE_HEADER)) /
 +                       sizeof(ATOM_GPIO_I2C_INFO);
 +
 +               for (i = 0; i  num_indices; i++) {
                        gpio = i2c_info-asGPIO_Info[i];

                        if (gpio-sucI2cId.ucAccess == id) {
 --
 1.5.6.3



0001-drm-radeon-kms-atom-fix-gpio-i2c-table-overrun-v2.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Regression, post-rc2] Commit a5ee4eb7541 breaks OpenGL on RS780 (was: Re: Linux 2.6.34-rc3)

2010-04-01 Thread Alex Deucher
On Thu, Apr 1, 2010 at 4:17 PM, Linus Torvalds
torva...@linux-foundation.org wrote:


 On Thu, 1 Apr 2010, Alex Deucher wrote:

 What I meant to say was MSI works fine on bridges other than the
 bridge the internal gfx lives on.  quirk_disable_msi() just disables
 MSI on the devices on that particular bridge as far as I understand
 it, but I'm by no means an expert on the PCI code.

 Yes, it disabled MSI only on devices under that bridge. But if it's the
 northbridge, that would be everything, no?

 But I don't know what devices those

        PCI_VENDOR_ID_AMD, 0x9602,
        PCI_VENDOR_ID_ASUSTEK, 0x9602,

 things are. If they are just a PCIE-PCI bridge rather than the root
 bridge, then everything looks fine to me.


Yup, those are just the pci to pci bridges used for the internal gfx.
Really there's only one, 0x9602, but some asus oem boards have the
vendor id wrong.

                        Linus


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Regression, post-rc2] Commit a5ee4eb7541 breaks OpenGL on RS780 (was: Re: Linux 2.6.34-rc3)

2010-04-01 Thread Alex Deucher
On Thu, Apr 1, 2010 at 4:28 PM, Rafael J. Wysocki r...@sisk.pl wrote:
 On Thursday 01 April 2010, Alex Deucher wrote:
 On Thu, Apr 1, 2010 at 2:36 AM, Clemens Ladisch clem...@ladisch.de wrote:
  Alex Deucher wrote:
  On Wed, Mar 31, 2010 at 9:13 PM, Rafael J. Wysocki r...@sisk.pl wrote:
  On Tuesday 30 March 2010, Rafael J. Wysocki wrote:
         PCI quirk: RS780/RS880: work around missing MSI initialization
 
  This one (commit a5ee4eb7541) broke OpenGL acceleration on my new test 
  box
  which happens to have a RS780.
 
  So it's better to disable MSI unconditionally.
 
  Rafael, can you check if MSI works for the HDMI audio device?
  (I'd guess it doesn't.)
 
  I also have the attached patch queued in via Dave's tree to disable
  MSI on all IGP chips for the time being.
 
  This disables MSI only for the graphics device.  I'd prefer to have
  the quirk on its bridge so that MSI gets disabled for the HDMI audio
  device too, to avoid having to duplicate this quirk in the snd-hda-intel
  driver.
 
  ==
 
  PCI quirk: RS780/RS880: disable MSI completely
 
  The missing initialization of the nb_cntl.strap_msi_enable does not seem
  to be the only problem that prevents MSI, so that quirk is not
  sufficient to enable MSI on all machines.  To be safe, unconditionally
  disable MSI for the internal graphics and HDMI audio on these chipsets.
 
  Signed-off-by: Clemens Ladisch clem...@ladisch.de

 Works fine here.

 Tested-by: Alex Deucher alexdeuc...@gmail.com

 Unfortunately it doesn't work for me without the

 if ((rdev-family = CHIP_RV380) 
            (!(rdev-flags  RADEON_IS_IGP)))

 radeon quirk.

what are your pci ids?

Alex


 Thanks,
 Rafael


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Regression, post-rc2] Commit a5ee4eb7541 breaks OpenGL on RS780 (was: Re: Linux 2.6.34-rc3)

2010-04-01 Thread Alex Deucher
On Thu, Apr 1, 2010 at 4:48 PM, Rafael J. Wysocki r...@sisk.pl wrote:
 On Thursday 01 April 2010, Alex Deucher wrote:
 On Thu, Apr 1, 2010 at 4:28 PM, Rafael J. Wysocki r...@sisk.pl wrote:
  On Thursday 01 April 2010, Alex Deucher wrote:
  On Thu, Apr 1, 2010 at 2:36 AM, Clemens Ladisch clem...@ladisch.de 
  wrote:
   Alex Deucher wrote:
   On Wed, Mar 31, 2010 at 9:13 PM, Rafael J. Wysocki r...@sisk.pl 
   wrote:
   On Tuesday 30 March 2010, Rafael J. Wysocki wrote:
      PCI quirk: RS780/RS880: work around missing MSI 
initialization
  
   This one (commit a5ee4eb7541) broke OpenGL acceleration on my new 
   test box
   which happens to have a RS780.
  
   So it's better to disable MSI unconditionally.
  
   Rafael, can you check if MSI works for the HDMI audio device?
   (I'd guess it doesn't.)
  
   I also have the attached patch queued in via Dave's tree to disable
   MSI on all IGP chips for the time being.
  
   This disables MSI only for the graphics device.  I'd prefer to have
   the quirk on its bridge so that MSI gets disabled for the HDMI audio
   device too, to avoid having to duplicate this quirk in the snd-hda-intel
   driver.
  
   ==
  
   PCI quirk: RS780/RS880: disable MSI completely
  
   The missing initialization of the nb_cntl.strap_msi_enable does not seem
   to be the only problem that prevents MSI, so that quirk is not
   sufficient to enable MSI on all machines.  To be safe, unconditionally
   disable MSI for the internal graphics and HDMI audio on these chipsets.
  
   Signed-off-by: Clemens Ladisch clem...@ladisch.de
 
  Works fine here.
 
  Tested-by: Alex Deucher alexdeuc...@gmail.com
 
  Unfortunately it doesn't work for me without the
 
  if ((rdev-family = CHIP_RV380) 
             (!(rdev-flags  RADEON_IS_IGP)))
 
  radeon quirk.

 what are your pci ids?

 1022:960b

 I guess 1022 is AMD.

 OK, I'll try to add that.

0x960b won't affect the internal gfx.  That bridge is for the pcie x16 gfx slot.

0x9600   Host bridge
0x9602   Internal GFX PCI-PCI bridge ID
0x9603   External GFX - port 0
0x960B   External GFX - port 1
0x9604   PCI-PCI bridge - Port 0
0x9605   PCI-PCI bridge - Port 1
0x9606   PCI-PCI bridge - Port 2
0x9607   PCI-PCI bridge - Port 3
0x9608   PCI-PCI bridge - Port 4
0x9609   PCI-PCI bridge - Port 5
0x960A   PCI-PCI bridge (SB)
0x960F   HD Audio controller
0x791A   HDMI Audio codec

Alex


 Rafael


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Regression, post-rc2] Commit a5ee4eb7541 breaks OpenGL on RS780 (was: Re: Linux 2.6.34-rc3)

2010-04-01 Thread Alex Deucher
On Thu, Apr 1, 2010 at 4:48 PM, Rafael J. Wysocki r...@sisk.pl wrote:
 On Thursday 01 April 2010, Alex Deucher wrote:
 On Thu, Apr 1, 2010 at 4:28 PM, Rafael J. Wysocki r...@sisk.pl wrote:
  On Thursday 01 April 2010, Alex Deucher wrote:
  On Thu, Apr 1, 2010 at 2:36 AM, Clemens Ladisch clem...@ladisch.de 
  wrote:
   Alex Deucher wrote:
   On Wed, Mar 31, 2010 at 9:13 PM, Rafael J. Wysocki r...@sisk.pl 
   wrote:
   On Tuesday 30 March 2010, Rafael J. Wysocki wrote:
      PCI quirk: RS780/RS880: work around missing MSI 
initialization
  
   This one (commit a5ee4eb7541) broke OpenGL acceleration on my new 
   test box
   which happens to have a RS780.
  
   So it's better to disable MSI unconditionally.
  
   Rafael, can you check if MSI works for the HDMI audio device?
   (I'd guess it doesn't.)
  
   I also have the attached patch queued in via Dave's tree to disable
   MSI on all IGP chips for the time being.
  
   This disables MSI only for the graphics device.  I'd prefer to have
   the quirk on its bridge so that MSI gets disabled for the HDMI audio
   device too, to avoid having to duplicate this quirk in the snd-hda-intel
   driver.
  
   ==
  
   PCI quirk: RS780/RS880: disable MSI completely
  
   The missing initialization of the nb_cntl.strap_msi_enable does not seem
   to be the only problem that prevents MSI, so that quirk is not
   sufficient to enable MSI on all machines.  To be safe, unconditionally
   disable MSI for the internal graphics and HDMI audio on these chipsets.
  
   Signed-off-by: Clemens Ladisch clem...@ladisch.de
 
  Works fine here.
 
  Tested-by: Alex Deucher alexdeuc...@gmail.com
 
  Unfortunately it doesn't work for me without the
 
  if ((rdev-family = CHIP_RV380) 
             (!(rdev-flags  RADEON_IS_IGP)))
 
  radeon quirk.

 what are your pci ids?

 1022:960b

 I guess 1022 is AMD.

 OK, I'll try to add that.

It's possible your oem has the wrong vendor id for the 0x9602 bridge.

Alex


 Rafael


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Regression, post-rc2] Commit a5ee4eb7541 breaks OpenGL on RS780 (was: Re: Linux 2.6.34-rc3)

2010-04-01 Thread Alex Deucher
On Thu, Apr 1, 2010 at 5:08 PM, Rafael J. Wysocki r...@sisk.pl wrote:
 On Thursday 01 April 2010, Alex Deucher wrote:
 On Thu, Apr 1, 2010 at 4:48 PM, Rafael J. Wysocki r...@sisk.pl wrote:
  On Thursday 01 April 2010, Alex Deucher wrote:
  On Thu, Apr 1, 2010 at 4:28 PM, Rafael J. Wysocki r...@sisk.pl wrote:
   On Thursday 01 April 2010, Alex Deucher wrote:
   On Thu, Apr 1, 2010 at 2:36 AM, Clemens Ladisch clem...@ladisch.de 
   wrote:
Alex Deucher wrote:
On Wed, Mar 31, 2010 at 9:13 PM, Rafael J. Wysocki r...@sisk.pl 
wrote:
On Tuesday 30 March 2010, Rafael J. Wysocki wrote:
       PCI quirk: RS780/RS880: work around missing MSI 
 initialization
   
This one (commit a5ee4eb7541) broke OpenGL acceleration on my new 
test box
which happens to have a RS780.
   
So it's better to disable MSI unconditionally.
   
Rafael, can you check if MSI works for the HDMI audio device?
(I'd guess it doesn't.)
   
I also have the attached patch queued in via Dave's tree to disable
MSI on all IGP chips for the time being.
   
This disables MSI only for the graphics device.  I'd prefer to have
the quirk on its bridge so that MSI gets disabled for the HDMI audio
device too, to avoid having to duplicate this quirk in the 
snd-hda-intel
driver.
   
==
   
PCI quirk: RS780/RS880: disable MSI completely
   
The missing initialization of the nb_cntl.strap_msi_enable does not 
seem
to be the only problem that prevents MSI, so that quirk is not
sufficient to enable MSI on all machines.  To be safe, 
unconditionally
disable MSI for the internal graphics and HDMI audio on these 
chipsets.
   
Signed-off-by: Clemens Ladisch clem...@ladisch.de
  
   Works fine here.
  
   Tested-by: Alex Deucher alexdeuc...@gmail.com
  
   Unfortunately it doesn't work for me without the
  
   if ((rdev-family = CHIP_RV380) 
              (!(rdev-flags  RADEON_IS_IGP)))
  
   radeon quirk.
 
  what are your pci ids?
 
  1022:960b
 
  I guess 1022 is AMD.
 
  OK, I'll try to add that.

 It's possible your oem has the wrong vendor id for the 0x9602 bridge.

 Yes, the patch below works.

 Thanks,
 Rafael


 ---
  drivers/gpu/drm/radeon/radeon_irq_kms.c |    3 --
  drivers/pci/quirks.c                    |   36 
 ++--
  2 files changed, 4 insertions(+), 35 deletions(-)

 Index: linux-2.6/drivers/pci/quirks.c
 ===
 --- linux-2.6.orig/drivers/pci/quirks.c
 +++ linux-2.6/drivers/pci/quirks.c
 @@ -2123,6 +2123,9 @@ static void __devinit quirk_disable_msi(
        }
  }
  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, 
 quirk_disable_msi);
 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x9602, quirk_disable_msi);
 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASUSTEK, 0x9602, quirk_disable_msi);
 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AI, 0x9602, quirk_disable_msi);
  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, 0xa238, quirk_disable_msi);

  /* Go through the list of Hypertransport capabilities and
 @@ -2495,39 +2498,6 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AT
  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4375,
                        quirk_msi_intx_disable_bug);

 -/*
 - * MSI does not work with the AMD RS780/RS880 internal graphics and HDMI 
 audio
 - * devices unless the BIOS has initialized the nb_cntl.strap_msi_enable bit.
 - */
 -static void __init rs780_int_gfx_disable_msi(struct pci_dev *int_gfx_bridge)
 -{
 -       u32 nb_cntl;
 -
 -       if (!int_gfx_bridge-subordinate)
 -               return;
 -
 -       pci_bus_write_config_dword(int_gfx_bridge-bus, PCI_DEVFN(0, 0),
 -                                  0x60, 0);
 -       pci_bus_read_config_dword(int_gfx_bridge-bus, PCI_DEVFN(0, 0),
 -                                 0x64, nb_cntl);
 -
 -       if (!(nb_cntl  BIT(10))) {
 -               dev_warn(int_gfx_bridge-dev,
 -                        FW_WARN RS780: MSI for internal graphics 
 disabled\n);
 -               int_gfx_bridge-subordinate-bus_flags |= 
 PCI_BUS_FLAGS_NO_MSI;
 -       }
 -}
 -
 -#define PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX    0x9602
 -
 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD,
 -                       PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX,
 -                       rs780_int_gfx_disable_msi);
 -/* wrong vendor ID on M4A785TD motherboard: */
 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASUSTEK,
 -                       PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX,
 -                       rs780_int_gfx_disable_msi);
 -
  #endif /* CONFIG_PCI_MSI */

  #ifdef CONFIG_PCI_IOV
 Index: linux-2.6/drivers/gpu/drm/radeon/radeon_irq_kms.c
 ===
 --- linux-2.6.orig/drivers/gpu/drm/radeon/radeon_irq_kms.c
 +++ linux-2.6/drivers/gpu/drm/radeon/radeon_irq_kms.c
 @@ -117,8 +117,7 @@ int radeon_irq_kms_init(struct radeon_de
        /* MSIs don't seem to work reliably

Re: [Regression, post-rc2] Commit a5ee4eb7541 breaks OpenGL on RS780 (was: Re: Linux 2.6.34-rc3)

2010-04-01 Thread Alex Deucher
On Thu, Apr 1, 2010 at 5:46 PM, Rafael J. Wysocki r...@sisk.pl wrote:
 On Thursday 01 April 2010, Alex Deucher wrote:
 On Thu, Apr 1, 2010 at 5:08 PM, Rafael J. Wysocki r...@sisk.pl wrote:
  On Thursday 01 April 2010, Alex Deucher wrote:
  On Thu, Apr 1, 2010 at 4:48 PM, Rafael J. Wysocki r...@sisk.pl wrote:
   On Thursday 01 April 2010, Alex Deucher wrote:
   On Thu, Apr 1, 2010 at 4:28 PM, Rafael J. Wysocki r...@sisk.pl wrote:
On Thursday 01 April 2010, Alex Deucher wrote:
On Thu, Apr 1, 2010 at 2:36 AM, Clemens Ladisch 
clem...@ladisch.de wrote:
 Alex Deucher wrote:
 On Wed, Mar 31, 2010 at 9:13 PM, Rafael J. Wysocki 
 r...@sisk.pl wrote:
 On Tuesday 30 March 2010, Rafael J. Wysocki wrote:
        PCI quirk: RS780/RS880: work around missing MSI 
  initialization

 This one (commit a5ee4eb7541) broke OpenGL acceleration on my 
 new test box
 which happens to have a RS780.

 So it's better to disable MSI unconditionally.

 Rafael, can you check if MSI works for the HDMI audio device?
 (I'd guess it doesn't.)

 I also have the attached patch queued in via Dave's tree to 
 disable
 MSI on all IGP chips for the time being.

 This disables MSI only for the graphics device.  I'd prefer to 
 have
 the quirk on its bridge so that MSI gets disabled for the HDMI 
 audio
 device too, to avoid having to duplicate this quirk in the 
 snd-hda-intel
 driver.

 ==

 PCI quirk: RS780/RS880: disable MSI completely

 The missing initialization of the nb_cntl.strap_msi_enable does 
 not seem
 to be the only problem that prevents MSI, so that quirk is not
 sufficient to enable MSI on all machines.  To be safe, 
 unconditionally
 disable MSI for the internal graphics and HDMI audio on these 
 chipsets.

 Signed-off-by: Clemens Ladisch clem...@ladisch.de
   
Works fine here.
   
Tested-by: Alex Deucher alexdeuc...@gmail.com
   
Unfortunately it doesn't work for me without the
   
if ((rdev-family = CHIP_RV380) 
           (!(rdev-flags  RADEON_IS_IGP)))
   
radeon quirk.
  
   what are your pci ids?
  
   1022:960b
  
   I guess 1022 is AMD.
  
   OK, I'll try to add that.
 
  It's possible your oem has the wrong vendor id for the 0x9602 bridge.
 
  Yes, the patch below works.
 
  Thanks,
  Rafael
 
 
  ---
   drivers/gpu/drm/radeon/radeon_irq_kms.c |    3 --
   drivers/pci/quirks.c                    |   36 
  ++--
   2 files changed, 4 insertions(+), 35 deletions(-)
 
  Index: linux-2.6/drivers/pci/quirks.c
  ===
  --- linux-2.6.orig/drivers/pci/quirks.c
  +++ linux-2.6/drivers/pci/quirks.c
  @@ -2123,6 +2123,9 @@ static void __devinit quirk_disable_msi(
         }
   }
   DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, 
  quirk_disable_msi);
  +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x9602, quirk_disable_msi);
  +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASUSTEK, 0x9602, quirk_disable_msi);
  +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AI, 0x9602, quirk_disable_msi);
   DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, 0xa238, quirk_disable_msi);
 
   /* Go through the list of Hypertransport capabilities and
  @@ -2495,39 +2498,6 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AT
   DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4375,
                         quirk_msi_intx_disable_bug);
 
  -/*
  - * MSI does not work with the AMD RS780/RS880 internal graphics and HDMI 
  audio
  - * devices unless the BIOS has initialized the nb_cntl.strap_msi_enable 
  bit.
  - */
  -static void __init rs780_int_gfx_disable_msi(struct pci_dev 
  *int_gfx_bridge)
  -{
  -       u32 nb_cntl;
  -
  -       if (!int_gfx_bridge-subordinate)
  -               return;
  -
  -       pci_bus_write_config_dword(int_gfx_bridge-bus, PCI_DEVFN(0, 0),
  -                                  0x60, 0);
  -       pci_bus_read_config_dword(int_gfx_bridge-bus, PCI_DEVFN(0, 0),
  -                                 0x64, nb_cntl);
  -
  -       if (!(nb_cntl  BIT(10))) {
  -               dev_warn(int_gfx_bridge-dev,
  -                        FW_WARN RS780: MSI for internal graphics 
  disabled\n);
  -               int_gfx_bridge-subordinate-bus_flags |= 
  PCI_BUS_FLAGS_NO_MSI;
  -       }
  -}
  -
  -#define PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX    0x9602
  -
  -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD,
  -                       PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX,
  -                       rs780_int_gfx_disable_msi);
  -/* wrong vendor ID on M4A785TD motherboard: */
  -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASUSTEK,
  -                       PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX,
  -                       rs780_int_gfx_disable_msi);
  -
   #endif /* CONFIG_PCI_MSI */
 
   #ifdef CONFIG_PCI_IOV
  Index: linux-2.6/drivers/gpu/drm/radeon/radeon_irq_kms.c

Re: Signalling no-audio for HDMI

2010-03-31 Thread Alex Deucher
2010/3/30 Hendrik Sattler p...@hendrik-sattler.de:
 Am Dienstag 30 März 2010 19:30:38 schrieb Christian König:
   It seems your TV refuses to use audio from analog stereo cable, when
   it detects audio enabled over/in HDMI (just enabled, even purely
   silent as in your case). And it seems we enable HDMI mode even when
   you use radeon.audio=0.
  
   I've no idea what could affect this between 2.6.33-rc8 and 2.6.33
   (stable). The list of changes for drm/radeon taken from
   http://lkml.org/lkml/2010/2/24/301 :
 
  It doesn't seem to be the kernel, actually. I already tried with
  booting rc8
  and it is the same. Must be one of the other parts, then...

 I also have no idea which change caused this, but the fix is rather
 simple, just also disable the HDMI encoders when the audio codec gets
 disabled by the module option. A patch is attached.

  Can you provide lspci output by the way?

 This is the second laptop where I see this strange configuration. From
 the video drivers point of view everything is present (audio codec, HDMI
 encoders, etc...), but the audio codec doesn't seems to be connected to
 the PCI bus, so alsa can't see it.

 I have no idea how we could auto detect this case, but the attached
 patch should be a good workaround.

 Yes. But didn't work. I will test something else (different computer with
 definitely DVI-only) or maybe you have some other ideas.

Some TVs always assume audio will come over hdmi if the port is in
use.  There may be an option in your TV's setup menus to disable that.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms/evergreen: get DP working

2010-03-31 Thread Alex Deucher
This patch may help with DP issues on pre-evergreen cards as well
since you're supposed to turn the DP VID stream on after you do link
training.

Alex

From 091fdd6e5f236e2112201d3be5287476866e7492 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Wed, 31 Mar 2010 14:42:11 -0400
Subject: [PATCH] drm/radeon/kms/evergreen: get DP working

Need to enable the VID stream after link training

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_encoders.c |   15 ---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c
b/drivers/gpu/drm/radeon/radeon_encoders.c
index cbc6fa2..52d6f96 100644
--- a/drivers/gpu/drm/radeon/radeon_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_encoders.c
@@ -1044,16 +1044,25 @@ radeon_atom_encoder_dpms(struct drm_encoder
*encoder, int mode)
if (is_dig) {
switch (mode) {
case DRM_MODE_DPMS_ON:
-   atombios_dig_transmitter_setup(encoder,
ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0);
-   {
+   if (atombios_get_encoder_mode(encoder) == 
ATOM_ENCODER_MODE_DP) {
struct drm_connector *connector =
radeon_get_connector_for_encoder(encoder);
+
dp_link_train(encoder, connector);
+   if (ASIC_IS_DCE4(rdev))
+   atombios_dig_encoder_setup(encoder, 
ATOM_ENCODER_CMD_DP_VIDEO_ON);
}
+   if (!ASIC_IS_DCE4(rdev))
+   atombios_dig_transmitter_setup(encoder,
ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0);
break;
case DRM_MODE_DPMS_STANDBY:
case DRM_MODE_DPMS_SUSPEND:
case DRM_MODE_DPMS_OFF:
-   atombios_dig_transmitter_setup(encoder,
ATOM_TRANSMITTER_ACTION_DISABLE_OUTPUT, 0, 0);
+   if (!ASIC_IS_DCE4(rdev))
+   atombios_dig_transmitter_setup(encoder,
ATOM_TRANSMITTER_ACTION_DISABLE_OUTPUT, 0, 0);
+   if (atombios_get_encoder_mode(encoder) == 
ATOM_ENCODER_MODE_DP) {
+   if (ASIC_IS_DCE4(rdev))
+   atombios_dig_encoder_setup(encoder, 
ATOM_ENCODER_CMD_DP_VIDEO_OFF);
+   }
break;
}
} else {
-- 
1.5.6.3


0001-drm-radeon-kms-evergreen-get-DP-working.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Regression, post-rc2] Commit a5ee4eb7541 breaks OpenGL on RS780 (was: Re: Linux 2.6.34-rc3)

2010-03-31 Thread Alex Deucher
On Wed, Mar 31, 2010 at 9:13 PM, Rafael J. Wysocki r...@sisk.pl wrote:
 On Tuesday 30 March 2010, Rafael J. Wysocki wrote:
 On Tuesday 30 March 2010, Linus Torvalds wrote:
 ...
  Other than that? Random fixes and updates all over. Mostly drivers and
  filesystems, and mostly fairly small things. If you had PCI resource
  conflict problems with the early -rc's due to the _CRS window thing, for
  example, that should hopefully be fixed. See the appended shortlog for
  other details.

 ...

  Clemens Ladisch (4):
        firewire: core: fw_iso_resource_manage: fix error handling
        firewire: ohci: add cycle timer quirk for the TI TSB12LV22
        ALSA: cmipci: work around invalid PCM pointer
        PCI quirk: RS780/RS880: work around missing MSI initialization

 This one (commit a5ee4eb7541) broke OpenGL acceleration on my new test box
 which happens to have a RS780.

 The symptom is that every operation involving the GPU is _very_ slow, so the
 window manager eventually disables compositing.  Reverting this commit makes
 things work flawlessly again.

 So, please revert.

 BTW, I don't think it's a -stable material.

 OK, I've verified that partial revert (below) is sufficient.

 Rafael

 ---
 From: Rafael J. Wysocki r...@sisk.pl
 Subject: DRM / radeon: Really do not try to enable MSI on RS780 and RS880

 Commit a5ee4eb75413c145334c30e43f1af9875dad6fd7
 (PCI quirk: RS780/RS880: work around missing MSI initialization)
 removed a quirk to disable MSI on RS780 and RS880, which still is
 necessary on my Acer Ferrari One, because pci_enable_msi() attempts
 to enable the MSI and apparently succeeds despite the PCI quirk
 added by that commit.  Add the removed radeon quirk again.

 Signed-off-by: Rafael J. Wysocki r...@sisk.pl
 ---
  drivers/gpu/drm/radeon/radeon_irq_kms.c |    8 +++-
  1 file changed, 7 insertions(+), 1 deletion(-)

 Index: linux-2.6/drivers/gpu/drm/radeon/radeon_irq_kms.c
 ===
 --- linux-2.6.orig/drivers/gpu/drm/radeon/radeon_irq_kms.c
 +++ linux-2.6/drivers/gpu/drm/radeon/radeon_irq_kms.c
 @@ -116,7 +116,13 @@ int radeon_irq_kms_init(struct radeon_de
        }
        /* enable msi */
        rdev-msi_enabled = 0;
 -       if (rdev-family = CHIP_RV380) {
 +       /* MSIs don't seem to work on my rs780;
 +        * not sure about rs880 or other rs780s.
 +        * Needs more investigation.
 +        */
 +       if ((rdev-family = CHIP_RV380) 
 +           (rdev-family != CHIP_RS780) 
 +           (rdev-family != CHIP_RS880)) {
                int ret = pci_enable_msi(rdev-pdev);
                if (!ret) {
                        rdev-msi_enabled = 1;

I also have the attached patch queued in via Dave's tree to disable
MSI on all IGP chips for the time being.

Alex


0001-drm-radeon-kms-disable-MSI-on-IGP-chips.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [patch] radeon: range check issues

2010-03-31 Thread Alex Deucher
On Sun, Mar 28, 2010 at 7:23 AM, Dan Carpenter erro...@gmail.com wrote:
 This change makes the array larger, MAX_SUPPORTED_TV_TIMING_V1_2 is 3
 and the original size MAX_SUPPORTED_TV_TIMING is 2.

 Also there were checks that were off by one.

 Signed-off-by: Dan Carpenter erro...@gmail.com
 ---
 Compile tested only.  Changing the array size seemed like the right
 thing to do, in the context, but please review carefully.

That patch is correct and corresponds to the actual table sizes in the vbios.

Alex



 diff --git a/drivers/gpu/drm/radeon/atombios.h 
 b/drivers/gpu/drm/radeon/atombios.h
 index 6732b5d..27e2c71 100644
 --- a/drivers/gpu/drm/radeon/atombios.h
 +++ b/drivers/gpu/drm/radeon/atombios.h
 @@ -2912,7 +2912,7 @@ typedef struct _ATOM_ANALOG_TV_INFO_V1_2
   UCHAR                    ucTV_BootUpDefaultStandard;
   UCHAR                    ucExt_TV_ASIC_ID;
   UCHAR                    ucExt_TV_ASIC_SlaveAddr;
 -  ATOM_DTD_FORMAT          aModeTimings[MAX_SUPPORTED_TV_TIMING];
 +  ATOM_DTD_FORMAT          aModeTimings[MAX_SUPPORTED_TV_TIMING_V1_2];
  }ATOM_ANALOG_TV_INFO_V1_2;

  typedef struct _ATOM_DPCD_INFO
 diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c 
 b/drivers/gpu/drm/radeon/radeon_atombios.c
 index 93783b1..bdc0ab3 100644
 --- a/drivers/gpu/drm/radeon/radeon_atombios.c
 +++ b/drivers/gpu/drm/radeon/radeon_atombios.c
 @@ -1275,7 +1275,7 @@ bool radeon_atom_get_tv_timings(struct radeon_device 
 *rdev, int index,
        switch (crev) {
        case 1:
                tv_info = (ATOM_ANALOG_TV_INFO 
 *)(mode_info-atom_context-bios + data_offset);
 -               if (index  MAX_SUPPORTED_TV_TIMING)
 +               if (index = MAX_SUPPORTED_TV_TIMING)
                        return false;

                mode-crtc_htotal = 
 le16_to_cpu(tv_info-aModeTimings[index].usCRTC_H_Total);
 @@ -1313,7 +1313,7 @@ bool radeon_atom_get_tv_timings(struct radeon_device 
 *rdev, int index,
                break;
        case 2:
                tv_info_v1_2 = (ATOM_ANALOG_TV_INFO_V1_2 
 *)(mode_info-atom_context-bios + data_offset);
 -               if (index  MAX_SUPPORTED_TV_TIMING_V1_2)
 +               if (index = MAX_SUPPORTED_TV_TIMING_V1_2)
                        return false;

                dtd_timings = tv_info_v1_2-aModeTimings[index];



--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms/dp: disable training pattern on the sink at the end of link training

2010-03-30 Thread Alex Deucher
From 25f6a40d0acc51bc3437838ecea88e63b8c32b40 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Tue, 30 Mar 2010 02:03:48 -0400
Subject: [PATCH] drm/radeon/kms/dp: disable training pattern on the
sink at the end of link training

Seems to have gotten lost in the evergreen merge.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/atombios_dp.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atombios_dp.c
b/drivers/gpu/drm/radeon/atombios_dp.c
index ca776b2..28b31c6 100644
--- a/drivers/gpu/drm/radeon/atombios_dp.c
+++ b/drivers/gpu/drm/radeon/atombios_dp.c
@@ -745,6 +745,9 @@ void dp_link_train(struct drm_encoder *encoder,
   DP_TRAIN_PRE_EMPHASIS_SHIFT);

/* disable the training pattern on the sink */
+   dp_set_training(radeon_connector, DP_TRAINING_PATTERN_DISABLE);
+
+   /* disable the training pattern on the source */
if (ASIC_IS_DCE4(rdev))
atombios_dig_encoder_setup(encoder,
ATOM_ENCODER_CMD_DP_LINK_TRAINING_COMPLETE);
else
-- 
1.5.6.3


0001-drm-radeon-kms-dp-disable-training-pattern-on-the-s.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms: display watermark updates

2010-03-30 Thread Alex Deucher
From 0d2509130004624ffdc21f0d1666d5ac869d124a Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Tue, 30 Mar 2010 12:22:17 -0400
Subject: [PATCH] drm/radeon/kms: display watermark updates

- Add module option to force the display priority
  0 = auto, 1 = normal, 2 = high
- Default to high on r3xx/r4xx/rv515 chips
  Fixes flickering problems during heavy acceleration
  due to underflow to the display controllers
- Fill in minimal support for RS600

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon.h |1 +
 drivers/gpu/drm/radeon/radeon_display.c |   13 +++
 drivers/gpu/drm/radeon/radeon_drv.c |4 ++
 drivers/gpu/drm/radeon/rs600.c  |   23 +-
 drivers/gpu/drm/radeon/rs600d.h |   53 +++
 drivers/gpu/drm/radeon/rs690.c  |   33 +--
 drivers/gpu/drm/radeon/rs690d.h |3 ++
 drivers/gpu/drm/radeon/rv515.c  |   33 +--
 8 files changed, 142 insertions(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 55da095..d300486 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -91,6 +91,7 @@ extern int radeon_tv;
 extern int radeon_new_pll;
 extern int radeon_dynpm;
 extern int radeon_audio;
+extern int radeon_disp_priority;

 /*
  * Copy from radeon_drv.h so we don't have to include both and have conflicting
diff --git a/drivers/gpu/drm/radeon/radeon_display.c
b/drivers/gpu/drm/radeon/radeon_display.c
index eca714c..600f7b1 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -996,6 +996,19 @@ int radeon_modeset_init(struct radeon_device *rdev)
return ret;
}

+   /* adjustment options for the display watermarks */
+   if ((radeon_disp_priority == 0) || (radeon_disp_priority  2)) {
+   /* set display priority to high for r3xx, rv515 chips
+* this avoids flickering due to underflow to the
+* display controllers during heavy acceleration.
+*/
+   if (ASIC_IS_R300(rdev) || (rdev-family == CHIP_RV515))
+   rdev-disp_priority = 2;
+   else
+   rdev-disp_priority = 0;
+   } else
+   rdev-disp_priority = radeon_disp_priority;
+
/* check combios for a valid hardcoded EDID - Sun servers */
if (!rdev-is_atom_bios) {
/* check for hardcoded EDID in BIOS */
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c
b/drivers/gpu/drm/radeon/radeon_drv.c
index 54ec049..6fd511e 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -92,6 +92,7 @@ int radeon_tv = 1;
 int radeon_new_pll = -1;
 int radeon_dynpm = -1;
 int radeon_audio = 1;
+int radeon_disp_priority = 0;

 MODULE_PARM_DESC(no_wb, Disable AGP writeback for scratch registers);
 module_param_named(no_wb, radeon_no_wb, int, 0444);
@@ -135,6 +136,9 @@ module_param_named(dynpm, radeon_dynpm, int, 0444);
 MODULE_PARM_DESC(audio, Audio enable (0 = disable));
 module_param_named(audio, radeon_audio, int, 0444);

+MODULE_PARM_DESC(disp_priority, Display Priority (0 = auto, 1 =
normal, 2 = high));
+module_param_named(disp_priority, radeon_disp_priority, int, 0444);
+
 static int radeon_suspend(struct drm_device *dev, pm_message_t state)
 {
drm_radeon_private_t *dev_priv = dev-dev_private;
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
index 7d8ae42..edd5cd8 100644
--- a/drivers/gpu/drm/radeon/rs600.c
+++ b/drivers/gpu/drm/radeon/rs600.c
@@ -554,7 +554,28 @@ void rs600_mc_init(struct radeon_device *rdev)

 void rs600_bandwidth_update(struct radeon_device *rdev)
 {
-   /* FIXME: implement, should this be like rs690 ? */
+   struct drm_display_mode *mode0 = NULL;
+   struct drm_display_mode *mode1 = NULL;
+   u32 d1mode_priority_a_cnt, d2mode_priority_a_cnt;
+   /* FIXME: implement full support */
+
+   if (rdev-mode_info.crtcs[0]-base.enabled)
+   mode0 = rdev-mode_info.crtcs[0]-base.mode;
+   if (rdev-mode_info.crtcs[1]-base.enabled)
+   mode1 = rdev-mode_info.crtcs[1]-base.mode;
+
+   rs690_line_buffer_adjust(rdev, mode0, mode1);
+
+   if (rdev-disp_priority == 2) {
+   d1mode_priority_a_cnt = RREG32(R_006548_D1MODE_PRIORITY_A_CNT);
+   d2mode_priority_a_cnt = RREG32(R_006D48_D2MODE_PRIORITY_A_CNT);
+   d1mode_priority_a_cnt |= 
S_006548_D1MODE_PRIORITY_A_ALWAYS_ON(1);
+   d2mode_priority_a_cnt |= 
S_006D48_D2MODE_PRIORITY_A_ALWAYS_ON(1);
+   WREG32(R_006548_D1MODE_PRIORITY_A_CNT, d1mode_priority_a_cnt);
+   WREG32(R_00654C_D1MODE_PRIORITY_B_CNT, d1mode_priority_a_cnt);
+   WREG32(R_006D48_D2MODE_PRIORITY_A_CNT, d2mode_priority_a_cnt

Re: Signalling no-audio for HDMI

2010-03-30 Thread Alex Deucher
On Tue, Mar 30, 2010 at 1:30 PM, Christian König
deathsim...@vodafone.de wrote:
 Hi,

  It seems your TV refuses to use audio from analog stereo cable, when
  it detects audio enabled over/in HDMI (just enabled, even purely
  silent as in your case). And it seems we enable HDMI mode even when
  you use radeon.audio=0.
 
  I've no idea what could affect this between 2.6.33-rc8 and 2.6.33
  (stable). The list of changes for drm/radeon taken from
  http://lkml.org/lkml/2010/2/24/301 :

 It doesn't seem to be the kernel, actually. I already tried with
 booting rc8
 and it is the same. Must be one of the other parts, then...
 I also have no idea which change caused this, but the fix is rather
 simple, just also disable the HDMI encoders when the audio codec gets
 disabled by the module option. A patch is attached.

 Can you provide lspci output by the way?
 This is the second laptop where I see this strange configuration. From
 the video drivers point of view everything is present (audio codec, HDMI
 encoders, etc...), but the audio codec doesn't seems to be connected to
 the PCI bus, so alsa can't see it.

 I have no idea how we could auto detect this case, but the attached
 patch should be a good workaround.

We should probably also only enable the audio timer when we enable
audio otherwise it just keeps the CPU awake.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: Signalling no-audio for HDMI

2010-03-30 Thread Alex Deucher
On Tue, Mar 30, 2010 at 5:09 PM, Rafał Miłecki zaj...@gmail.com wrote:
 2010/3/30 Alex Deucher alexdeuc...@gmail.com:
 On Tue, Mar 30, 2010 at 1:30 PM, Christian König
 deathsim...@vodafone.de wrote:
 Hi,

  It seems your TV refuses to use audio from analog stereo cable, when
  it detects audio enabled over/in HDMI (just enabled, even purely
  silent as in your case). And it seems we enable HDMI mode even when
  you use radeon.audio=0.
 
  I've no idea what could affect this between 2.6.33-rc8 and 2.6.33
  (stable). The list of changes for drm/radeon taken from
  http://lkml.org/lkml/2010/2/24/301 :

 It doesn't seem to be the kernel, actually. I already tried with
 booting rc8
 and it is the same. Must be one of the other parts, then...
 I also have no idea which change caused this, but the fix is rather
 simple, just also disable the HDMI encoders when the audio codec gets
 disabled by the module option. A patch is attached.

 Can you provide lspci output by the way?
 This is the second laptop where I see this strange configuration. From
 the video drivers point of view everything is present (audio codec, HDMI
 encoders, etc...), but the audio codec doesn't seems to be connected to
 the PCI bus, so alsa can't see it.

 I have no idea how we could auto detect this case, but the attached
 patch should be a good workaround.

 We should probably also only enable the audio timer when we enable
 audio otherwise it just keeps the CPU awake.

 Could you explain when we enable audio, please?

No need to have the timer running if we aren't currently using hdmi
audio (e.g., dpms off, analog encoder in use, digital encoder in
non-hdmi mode, etc.).  So probably turn it on/off when we dpms on/off
a digital output in hdmi mode.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms: disable MSI on IGP chips

2010-03-30 Thread Alex Deucher
From dba40a55ac5c33b157dee7b5fa53000d19ffca6c Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Tue, 30 Mar 2010 17:22:32 -0400
Subject: [PATCH] drm/radeon/kms: disable MSI on IGP chips

Doesn't seem to work reliably and the pci quirks don't
always work.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_irq_kms.c |8 +++-
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c
b/drivers/gpu/drm/radeon/radeon_irq_kms.c
index 68519b4..a212041 100644
--- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
@@ -114,13 +114,11 @@ int radeon_irq_kms_init(struct radeon_device *rdev)
}
/* enable msi */
rdev-msi_enabled = 0;
-   /* MSIs don't seem to work on my rs780;
-* not sure about rs880 or other rs780s.
-* Needs more investigation.
+   /* MSIs don't seem to work reliably on all IGP
+* chips.  Disable MSI on them for now.
 */
if ((rdev-family = CHIP_RV380) 
-   (rdev-family != CHIP_RS780) 
-   (rdev-family != CHIP_RS880)) {
+   (!(rdev-flags  RADEON_IS_IGP))) {
int ret = pci_enable_msi(rdev-pdev);
if (!ret) {
rdev-msi_enabled = 1;
-- 
1.5.6.3


0001-drm-radeon-kms-disable-MSI-on-IGP-chips.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon/kms: display watermark updates

2010-03-30 Thread Alex Deucher
Updated patch to allow you to change the display priority at runtime.

Alex


On Tue, Mar 30, 2010 at 12:29 PM, Alex Deucher alexdeuc...@gmail.com wrote:
 From 0d2509130004624ffdc21f0d1666d5ac869d124a Mon Sep 17 00:00:00 2001
 From: Alex Deucher alexdeuc...@gmail.com
 Date: Tue, 30 Mar 2010 12:22:17 -0400
 Subject: [PATCH] drm/radeon/kms: display watermark updates

 - Add module option to force the display priority
  0 = auto, 1 = normal, 2 = high
 - Default to high on r3xx/r4xx/rv515 chips
  Fixes flickering problems during heavy acceleration
  due to underflow to the display controllers
 - Fill in minimal support for RS600

 Signed-off-by: Alex Deucher alexdeuc...@gmail.com
 ---
  drivers/gpu/drm/radeon/radeon.h         |    1 +
  drivers/gpu/drm/radeon/radeon_display.c |   13 +++
  drivers/gpu/drm/radeon/radeon_drv.c     |    4 ++
  drivers/gpu/drm/radeon/rs600.c          |   23 +-
  drivers/gpu/drm/radeon/rs600d.h         |   53 
 +++
  drivers/gpu/drm/radeon/rs690.c          |   33 +--
  drivers/gpu/drm/radeon/rs690d.h         |    3 ++
  drivers/gpu/drm/radeon/rv515.c          |   33 +--
  8 files changed, 142 insertions(+), 21 deletions(-)

 diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
 index 55da095..d300486 100644
 --- a/drivers/gpu/drm/radeon/radeon.h
 +++ b/drivers/gpu/drm/radeon/radeon.h
 @@ -91,6 +91,7 @@ extern int radeon_tv;
  extern int radeon_new_pll;
  extern int radeon_dynpm;
  extern int radeon_audio;
 +extern int radeon_disp_priority;

  /*
  * Copy from radeon_drv.h so we don't have to include both and have 
 conflicting
 diff --git a/drivers/gpu/drm/radeon/radeon_display.c
 b/drivers/gpu/drm/radeon/radeon_display.c
 index eca714c..600f7b1 100644
 --- a/drivers/gpu/drm/radeon/radeon_display.c
 +++ b/drivers/gpu/drm/radeon/radeon_display.c
 @@ -996,6 +996,19 @@ int radeon_modeset_init(struct radeon_device *rdev)
                return ret;
        }

 +       /* adjustment options for the display watermarks */
 +       if ((radeon_disp_priority == 0) || (radeon_disp_priority  2)) {
 +               /* set display priority to high for r3xx, rv515 chips
 +                * this avoids flickering due to underflow to the
 +                * display controllers during heavy acceleration.
 +                */
 +               if (ASIC_IS_R300(rdev) || (rdev-family == CHIP_RV515))
 +                       rdev-disp_priority = 2;
 +               else
 +                       rdev-disp_priority = 0;
 +       } else
 +               rdev-disp_priority = radeon_disp_priority;
 +
        /* check combios for a valid hardcoded EDID - Sun servers */
        if (!rdev-is_atom_bios) {
                /* check for hardcoded EDID in BIOS */
 diff --git a/drivers/gpu/drm/radeon/radeon_drv.c
 b/drivers/gpu/drm/radeon/radeon_drv.c
 index 54ec049..6fd511e 100644
 --- a/drivers/gpu/drm/radeon/radeon_drv.c
 +++ b/drivers/gpu/drm/radeon/radeon_drv.c
 @@ -92,6 +92,7 @@ int radeon_tv = 1;
  int radeon_new_pll = -1;
  int radeon_dynpm = -1;
  int radeon_audio = 1;
 +int radeon_disp_priority = 0;

  MODULE_PARM_DESC(no_wb, Disable AGP writeback for scratch registers);
  module_param_named(no_wb, radeon_no_wb, int, 0444);
 @@ -135,6 +136,9 @@ module_param_named(dynpm, radeon_dynpm, int, 0444);
  MODULE_PARM_DESC(audio, Audio enable (0 = disable));
  module_param_named(audio, radeon_audio, int, 0444);

 +MODULE_PARM_DESC(disp_priority, Display Priority (0 = auto, 1 =
 normal, 2 = high));
 +module_param_named(disp_priority, radeon_disp_priority, int, 0444);
 +
  static int radeon_suspend(struct drm_device *dev, pm_message_t state)
  {
        drm_radeon_private_t *dev_priv = dev-dev_private;
 diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
 index 7d8ae42..edd5cd8 100644
 --- a/drivers/gpu/drm/radeon/rs600.c
 +++ b/drivers/gpu/drm/radeon/rs600.c
 @@ -554,7 +554,28 @@ void rs600_mc_init(struct radeon_device *rdev)

  void rs600_bandwidth_update(struct radeon_device *rdev)
  {
 -       /* FIXME: implement, should this be like rs690 ? */
 +       struct drm_display_mode *mode0 = NULL;
 +       struct drm_display_mode *mode1 = NULL;
 +       u32 d1mode_priority_a_cnt, d2mode_priority_a_cnt;
 +       /* FIXME: implement full support */
 +
 +       if (rdev-mode_info.crtcs[0]-base.enabled)
 +               mode0 = rdev-mode_info.crtcs[0]-base.mode;
 +       if (rdev-mode_info.crtcs[1]-base.enabled)
 +               mode1 = rdev-mode_info.crtcs[1]-base.mode;
 +
 +       rs690_line_buffer_adjust(rdev, mode0, mode1);
 +
 +       if (rdev-disp_priority == 2) {
 +               d1mode_priority_a_cnt = 
 RREG32(R_006548_D1MODE_PRIORITY_A_CNT);
 +               d2mode_priority_a_cnt = 
 RREG32(R_006D48_D2MODE_PRIORITY_A_CNT);
 +               d1mode_priority_a_cnt |= 
 S_006548_D1MODE_PRIORITY_A_ALWAYS_ON(1);
 +               d2mode_priority_a_cnt |= 
 S_006D48_D2MODE_PRIORITY_A_ALWAYS_ON(1

[PATCH] drm/radeon/kms/dp: remove extraneous training complete call

2010-03-29 Thread Alex Deucher
From 68d4af64689277ca1d71ff160022e17b482b07d4 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Mon, 29 Mar 2010 14:06:10 -0400
Subject: [PATCH] drm/radeon/kms/dp: remove extraneous training complete call

Looks like a copy/paste typo from when evergreen support
was added.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/atombios_dp.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atombios_dp.c
b/drivers/gpu/drm/radeon/atombios_dp.c
index 8a133bd..ca776b2 100644
--- a/drivers/gpu/drm/radeon/atombios_dp.c
+++ b/drivers/gpu/drm/radeon/atombios_dp.c
@@ -750,9 +750,6 @@ void dp_link_train(struct drm_encoder *encoder,
else
radeon_dp_encoder_service(rdev, 
ATOM_DP_ACTION_TRAINING_COMPLETE,
  dig_connector-dp_clock, enc_id, 0);
-
-   radeon_dp_encoder_service(rdev, ATOM_DP_ACTION_TRAINING_COMPLETE,
- dig_connector-dp_clock, enc_id, 0);
 }

 int radeon_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
-- 
1.5.6.3


0001-drm-radeon-kms-dp-remove-extraneous-training-comple.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms/atom: minor fixes to transmitter setup

2010-03-29 Thread Alex Deucher
From c3b9aba0e276d7113155462f46608599cdecc937 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Mon, 29 Mar 2010 17:39:44 -0400
Subject: [PATCH] drm/radeon/kms/atom: minor fixes to transmitter setup

- 8 lane links are not valid for DP
- remove unused num var

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_encoders.c |   54 +++--
 1 files changed, 21 insertions(+), 33 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c
b/drivers/gpu/drm/radeon/radeon_encoders.c
index 3330e11..6d6fbd1 100644
--- a/drivers/gpu/drm/radeon/radeon_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_encoders.c
@@ -708,7 +708,7 @@ atombios_dig_encoder_setup(struct drm_encoder
*encoder, int action)
struct radeon_connector_atom_dig *dig_connector =
radeon_get_atom_connector_priv_from_encoder(encoder);
union dig_encoder_control args;
-   int index = 0, num = 0;
+   int index = 0;
uint8_t frev, crev;

if (!dig || !dig_connector)
@@ -724,7 +724,6 @@ atombios_dig_encoder_setup(struct drm_encoder
*encoder, int action)
else
index = GetIndexIntoMasterTable(COMMAND, 
DIG1EncoderControl);
}
-   num = dig-dig_encoder + 1;

if (!atom_parse_cmd_header(rdev-mode_info.atom_context, index, frev, 
crev))
return;
@@ -786,7 +785,7 @@ atombios_dig_transmitter_setup(struct drm_encoder
*encoder, int action, uint8_t
struct drm_connector *connector;
struct radeon_connector *radeon_connector;
union dig_transmitter_control args;
-   int index = 0, num = 0;
+   int index = 0;
uint8_t frev, crev;
bool is_dp = false;
int pll_id = 0;
@@ -862,15 +861,12 @@ atombios_dig_transmitter_setup(struct
drm_encoder *encoder, int action, uint8_t
switch (radeon_encoder-encoder_id) {
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
args.v3.acConfig.ucTransmitterSel = 0;
-   num = 0;
break;
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
args.v3.acConfig.ucTransmitterSel = 1;
-   num = 1;
break;
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2:
args.v3.acConfig.ucTransmitterSel = 2;
-   num = 2;
break;
}

@@ -881,23 +877,19 @@ atombios_dig_transmitter_setup(struct
drm_encoder *encoder, int action, uint8_t
args.v3.acConfig.fCoherentMode = 1;
}
} else if (ASIC_IS_DCE32(rdev)) {
-   if (dig-dig_encoder == 1)
-   args.v2.acConfig.ucEncoderSel = 1;
+   args.v2.acConfig.ucEncoderSel = dig-dig_encoder;
if (dig_connector-linkb)
args.v2.acConfig.ucLinkSel = 1;

switch (radeon_encoder-encoder_id) {
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
args.v2.acConfig.ucTransmitterSel = 0;
-   num = 0;
break;
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
args.v2.acConfig.ucTransmitterSel = 1;
-   num = 1;
break;
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2:
args.v2.acConfig.ucTransmitterSel = 2;
-   num = 2;
break;
}

@@ -915,31 +907,25 @@ atombios_dig_transmitter_setup(struct
drm_encoder *encoder, int action, uint8_t
else
args.v1.ucConfig |= 
ATOM_TRANSMITTER_CONFIG_DIG1_ENCODER;

-   switch (radeon_encoder-encoder_id) {
-   case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
-   if (rdev-flags  RADEON_IS_IGP) {
-   if (radeon_encoder-pixel_clock  165000) {
-   if (dig_connector-igp_lane_info  0x3)
-   args.v1.ucConfig |= 
ATOM_TRANSMITTER_CONFIG_LANE_0_7;
-   else if (dig_connector-igp_lane_info  
0xc)
-   args.v1.ucConfig |= 
ATOM_TRANSMITTER_CONFIG_LANE_8_15;
-   } else {
-   if (dig_connector-igp_lane_info  0x1)
-   args.v1.ucConfig |= 
ATOM_TRANSMITTER_CONFIG_LANE_0_3;
-   else if (dig_connector-igp_lane_info  
0x2)
-   args.v1.ucConfig |= 
ATOM_TRANSMITTER_CONFIG_LANE_4_7;
-   else if (dig_connector-igp_lane_info  
0x4)
-   args.v1

Re: [PATCH] drm/radeon/kms: minor fixes for eDP with LCD* device tags

2010-03-29 Thread Alex Deucher
Fix a typo in the last patch.  new version attached.

Alex

On Fri, Mar 26, 2010 at 2:04 AM, Alex Deucher alexdeuc...@gmail.com wrote:
 From 6ff965f44f6c0540e29e616621abac627b506436 Mon Sep 17 00:00:00 2001
 From: Alex Deucher alexdeuc...@gmail.com
 Date: Fri, 26 Mar 2010 01:57:34 -0400
 Subject: [PATCH] drm/radeon/kms: minor fixes for eDP with LCD* device tags

 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.

 Signed-off-by: Alex Deucher alexdeuc...@gmail.com
 ---
  drivers/gpu/drm/radeon/atombios_crtc.c   |   13 +
  drivers/gpu/drm/radeon/radeon_encoders.c |    2 +-
  2 files changed, 10 insertions(+), 5 deletions(-)

 diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c
 b/drivers/gpu/drm/radeon/atombios_crtc.c
 index 791db2e..6300675 100644
 --- a/drivers/gpu/drm/radeon/atombios_crtc.c
 +++ b/drivers/gpu/drm/radeon/atombios_crtc.c
 @@ -577,11 +577,16 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
                                        }
                                } else if (radeon_encoder-devices  
 (ATOM_DEVICE_LCD_SUPPORT)) {
                                        /* may want to enable SS on DP/eDP 
 eventually */
 -                                       args.v3.sInput.ucDispPllConfig |=
 -                                               DISPPLL_CONFIG_SS_ENABLE;
 -                                       if (mode-clock  165000)
 +                                       /*args.v3.sInput.ucDispPllConfig |=
 +                                               DISPPLL_CONFIG_SS_ENABLE;*/
 +                                       if (encoder_mode == 
 ATOM_ENCODER_MODE_DP)
                                                args.v3.sInput.ucDispPllConfig 
 |=
 -                                                       
 DISPPLL_CONFIG_DUAL_LINK;
 +                                                       
 DISPPLL_CONFIG_COHERENT_MODE;
 +                                       else {
 +                                               if (mode-clock  165000)
 +                                                       
 args.v3.sInput.ucDispPllConfig |=
 +                                                               
 DISPPLL_CONFIG_DUAL_LINK;
 +                                       }
                                }
                                
 atom_execute_table(rdev-mode_info.atom_context,
                                                   index, (uint32_t *)args);
 diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c
 b/drivers/gpu/drm/radeon/radeon_encoders.c
 index fd4052f..3330e11 100644
 --- a/drivers/gpu/drm/radeon/radeon_encoders.c
 +++ b/drivers/gpu/drm/radeon/radeon_encoders.c
 @@ -302,7 +302,7 @@ static bool radeon_atom_mode_fixup(struct
 drm_encoder *encoder,
        }

        if (ASIC_IS_DCE3(rdev) 
 -           (radeon_encoder-active_device  (ATOM_DEVICE_DFP_SUPPORT))) {
 +           (radeon_encoder-active_device  (ATOM_DEVICE_DFP_SUPPORT ||
 ATOM_DEVICE_LCD_SUPPORT))) {
                struct drm_connector *connector = 
 radeon_get_connector_for_encoder(encoder);
                radeon_dp_set_link_config(connector, mode);
        }
 --
 1.5.6.3



0001-drm-radeon-kms-minor-fixes-for-eDP-with-LCD-device.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCHES] r6xx/r7xx: CS parser fixes

2010-03-26 Thread Alex Deucher
These patches include the following fixes:
- Drop some more safe regs that userspace shouldn't hit
- Shader constant base regs need relocs.  This allows us to use
constant buffers rather than the constant register file.
Also we don't want userspace to be able to set arbitrary
mc addresses for the const caches.
- Track SQ_CONFIG so we know whether userspace is using
the constant register file or constant buffers.
- bump the UMS/KMS version numbers

It'd be nice to get these into 2.6.34.

Alex


0001-drm-radeon-r6xx-r7xx-CS-parser-fixes.patch
Description: application/mbox


0002-drm-radeon-kms-bump-the-version-for-r6xx-r7xx-const.patch
Description: application/mbox


0003-drm-radeon-bump-the-UMS-driver-version-for-r6xx-r7x.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCHES] radeon kms pm patches

2010-03-26 Thread Alex Deucher
2010/3/26 Rafał Miłecki zaj...@gmail.com:
 W dniu 18 marca 2010 17:40 użytkownik Alex Deucher
 alexdeuc...@gmail.com napisał:
 2010/3/18 Rafał Miłecki zaj...@gmail.com:
 W dniu 18 marca 2010 10:05 użytkownik Rafał Miłecki zaj...@gmail.com 
 napisał:
 Whoops, I missed one patch. My mistake.

 I've just applied all patches dated as 17-Mar-2010 22:42 and tested.

 Now memory reclocking is really enabled, but it causes corruptions for
 me. Maybe that's the same thing you experienced with dual head?

 Video is *far* from perfect, but maybe will give you some idea of what
 do I experience:
 http://estudent.put.poznan.pl/rafal.milecki/kernel/MOV00225.MP4

 The same happened for me before all your patches, when I tried to
 enable memory reclocking on my own.

 yeah, the similar to what I saw with dualhead.  I guess we are either
 missing the vblank window or the reclock is taking too much time.  I
 wonder if it would make sense to wait for a vline rather than vblank,
 say a vline 1/2 or 2/3 of the way down the screen, to give us some
 buffer time between calling the reclock function and whatever setup it
 does and the beginning of the actual vblank period.

 Did you play with this some more?

 Is this possible reclocking memory in wrong moment (so missing VBLANK
 probably) cause lock up? I experienced few already, when I forced
 myself to use this code ignoring corruptions. Any other idea what can
 cause lock up? I'm 100% sure it's memory reclocking code related.

I get occasional lockups as well with the memory reclock.  I suspect
we may have to disable crtc mem requests when changing the mclk, but I
haven't really had a change to play more with this.  Matthew's been
looking it some more this week.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms: fix macbookpro connector quirk

2010-03-26 Thread Alex Deucher
From 4295056894f84fa3da4aaa7e59be8bde1f1b533c Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Fri, 26 Mar 2010 17:14:37 -0400
Subject: [PATCH] drm/radeon/kms: fix macbookpro connector quirk

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_atombios.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c
b/drivers/gpu/drm/radeon/radeon_atombios.c
index 2f6c139..b969eda 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -264,6 +264,8 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev,
if ((supported_device == ATOM_DEVICE_CRT1_SUPPORT) ||
(supported_device == ATOM_DEVICE_DFP2_SUPPORT))
return false;
+   if (supported_device == ATOM_DEVICE_CRT2_SUPPORT)
+   *line_mux = 0x90;
}

/* ASUS HD 3600 XT board lists the DVI port as HDMI */
-- 
1.5.6.3


0001-drm-radeon-kms-fix-macbookpro-connector-quirk.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/r6x/r7xx: further safe reg clean up

2010-03-26 Thread Alex Deucher
From 158b12e0691a3f00b8bf315946e799d38d18daf7 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Fri, 26 Mar 2010 19:36:33 -0400
Subject: [PATCH] drm/radeon/r6x/r7xx: further safe reg clean up

- remove a few more drm only regs
- remove sampler, alu, bool, loop constant regs.
  They are set via separate packet3's already

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/reg_srcs/r600 |   19 ---
 1 files changed, 0 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/radeon/reg_srcs/r600
b/drivers/gpu/drm/radeon/reg_srcs/r600
index bc062f9..af0da4a 100644
--- a/drivers/gpu/drm/radeon/reg_srcs/r600
+++ b/drivers/gpu/drm/radeon/reg_srcs/r600
@@ -26,20 +26,16 @@ r600 0x9400
 0x00028408 VGT_INDX_OFFSET
 0x00028AA0 VGT_INSTANCE_STEP_RATE_0
 0x00028AA4 VGT_INSTANCE_STEP_RATE_1
-0x88C0 VGT_LAST_COPY_STATE
 0x00028400 VGT_MAX_VTX_INDX
-0x88D8 VGT_MC_LAT_CNTL
 0x00028404 VGT_MIN_VTX_INDX
 0x00028A94 VGT_MULTI_PRIM_IB_RESET_EN
 0x0002840C VGT_MULTI_PRIM_IB_RESET_INDX
 0x8970 VGT_NUM_INDICES
 0x8974 VGT_NUM_INSTANCES
 0x00028A10 VGT_OUTPUT_PATH_CNTL
-0x00028C5C VGT_OUT_DEALLOC_CNTL
 0x00028A84 VGT_PRIMITIVEID_EN
 0x8958 VGT_PRIMITIVE_TYPE
 0x00028AB4 VGT_REUSE_OFF
-0x00028C58 VGT_VERTEX_REUSE_BLOCK_CNTL
 0x00028AB8 VGT_VTX_CNT_EN
 0x88B0 VGT_VTX_VECT_EJECT_REG
 0x00028810 PA_CL_CLIP_CNTL
@@ -319,18 +315,6 @@ r600 0x9400
 0x000283FC SQ_VTX_SEMANTIC_31
 0x000288E0 SQ_VTX_SEMANTIC_CLEAR
 0x0003CFF4 SQ_VTX_START_INST_LOC
-0x0003C000 SQ_TEX_SAMPLER_WORD0_0
-0x0003C004 SQ_TEX_SAMPLER_WORD1_0
-0x0003C008 SQ_TEX_SAMPLER_WORD2_0
-0x0003 SQ_ALU_CONSTANT0_0
-0x00030004 SQ_ALU_CONSTANT1_0
-0x00030008 SQ_ALU_CONSTANT2_0
-0x0003000C SQ_ALU_CONSTANT3_0
-0x0003E380 SQ_BOOL_CONST_0
-0x0003E384 SQ_BOOL_CONST_1
-0x0003E388 SQ_BOOL_CONST_2
-0x0003E200 SQ_LOOP_CONST_0
-0x0003E200 SQ_LOOP_CONST_DX10_0
 0x000281C0 SQ_ALU_CONST_BUFFER_SIZE_GS_0
 0x000281C4 SQ_ALU_CONST_BUFFER_SIZE_GS_1
 0x000281C8 SQ_ALU_CONST_BUFFER_SIZE_GS_2
@@ -445,9 +429,6 @@ r600 0x9400
 0x00028438 SX_ALPHA_REF
 0x00028410 SX_ALPHA_TEST_CONTROL
 0x00028350 SX_MISC
-0xA020 SMX_DC_CTL0
-0xA024 SMX_DC_CTL1
-0xA028 SMX_DC_CTL2
 0x9604 TC_INVALIDATE
 0x9400 TD_FILTER4
 0x9404 TD_FILTER4_1
-- 
1.5.6.3


0001-drm-radeon-r6x-r7xx-further-safe-reg-clean-up.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms: fix some typos in r6xx/r7xx hpd setup

2010-03-24 Thread Alex Deucher
From 119bca9827fa4cb83f3d398e6a7793d188e73186 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Wed, 24 Mar 2010 13:57:29 -0400
Subject: [PATCH] drm/radeon/kms: fix some typos in r6xx/r7xx hpd setup

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/r600.c |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 1f91be6..d178fa8 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -2425,19 +2425,19 @@ static void
r600_disable_interrupt_state(struct radeon_device *rdev)
WREG32(DC_HPD4_INT_CONTROL, tmp);
if (ASIC_IS_DCE32(rdev)) {
tmp = RREG32(DC_HPD5_INT_CONTROL)  
DC_HPDx_INT_POLARITY;
-   WREG32(DC_HPD5_INT_CONTROL, 0);
+   WREG32(DC_HPD5_INT_CONTROL, tmp);
tmp = RREG32(DC_HPD6_INT_CONTROL)  
DC_HPDx_INT_POLARITY;
-   WREG32(DC_HPD6_INT_CONTROL, 0);
+   WREG32(DC_HPD6_INT_CONTROL, tmp);
}
} else {
WREG32(DACA_AUTODETECT_INT_CONTROL, 0);
WREG32(DACB_AUTODETECT_INT_CONTROL, 0);
tmp = RREG32(DC_HOT_PLUG_DETECT1_INT_CONTROL) 
DC_HOT_PLUG_DETECTx_INT_POLARITY;
-   WREG32(DC_HOT_PLUG_DETECT1_INT_CONTROL, 0);
+   WREG32(DC_HOT_PLUG_DETECT1_INT_CONTROL, tmp);
tmp = RREG32(DC_HOT_PLUG_DETECT2_INT_CONTROL) 
DC_HOT_PLUG_DETECTx_INT_POLARITY;
-   WREG32(DC_HOT_PLUG_DETECT2_INT_CONTROL, 0);
+   WREG32(DC_HOT_PLUG_DETECT2_INT_CONTROL, tmp);
tmp = RREG32(DC_HOT_PLUG_DETECT3_INT_CONTROL) 
DC_HOT_PLUG_DETECTx_INT_POLARITY;
-   WREG32(DC_HOT_PLUG_DETECT3_INT_CONTROL, 0);
+   WREG32(DC_HOT_PLUG_DETECT3_INT_CONTROL, tmp);
}
 }

@@ -2866,14 +2866,14 @@ restart_ih:
break;
case 10:
if (disp_int_cont2  DC_HPD5_INTERRUPT) {
-   disp_int_cont = ~DC_HPD5_INTERRUPT;
+   disp_int_cont2 = ~DC_HPD5_INTERRUPT;
queue_hotplug = true;
DRM_DEBUG(IH: HPD5\n);
}
break;
case 12:
if (disp_int_cont2  DC_HPD6_INTERRUPT) {
-   disp_int_cont = ~DC_HPD6_INTERRUPT;
+   disp_int_cont2 = ~DC_HPD6_INTERRUPT;
queue_hotplug = true;
DRM_DEBUG(IH: HPD6\n);
}
-- 
1.5.6.3


0001-drm-radeon-kms-fix-some-typos-in-r6xx-r7xx-hpd-setu.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/r600: remove some regs are not safe regs for command buffers

2010-03-24 Thread Alex Deucher
current userspace doesn't use any of these regs, so the change has no
affect on existing drivers.

From 33ae9dc620608eca8d0ba12664e6c93496a31431 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Wed, 24 Mar 2010 18:45:32 -0400
Subject: [PATCH] drm/radeon/r600: remove some regs are not safe regs
for command buffers

Only the drm should be touching them.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/reg_srcs/r600 |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/reg_srcs/r600
b/drivers/gpu/drm/radeon/reg_srcs/r600
index 8f414a5..1d33400 100644
--- a/drivers/gpu/drm/radeon/reg_srcs/r600
+++ b/drivers/gpu/drm/radeon/reg_srcs/r600
@@ -824,8 +824,6 @@ r600 0x9400
 0x00028428 CB_FOG_GREEN
 0x00028424 CB_FOG_RED
 0x8040 WAIT_UNTIL
-0x8950 CC_GC_SHADER_PIPE_CONFIG
-0x8954 GC_USER_SHADER_PIPE_CONFIG
 0x9714 VC_ENHANCE
 0x9830 DB_DEBUG
 0x9838 DB_WATERMARKS
@@ -834,4 +832,3 @@ r600 0x9400
 0x9504 TA_CNTL
 0x9700 VC_CNTL
 0x9718 VC_CONFIG
-0xA02C SMX_DC_MC_INTF_CTL
-- 
1.5.6.3


0001-drm-radeon-r600-remove-some-regs-are-not-safe-regs.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms: fix display bandwidth setup on rs4xx

2010-03-21 Thread Alex Deucher
From 9d0704674873023f27aee0d629ad9c93f07315b7 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Sun, 21 Mar 2010 11:09:24 -0400
Subject: [PATCH] drm/radeon/kms: fix display bandwidth setup on rs4xx

I missed rs4xx in 7f1e613daf0fdd0884316ab25a749db3c671329e

Fixes fdo bug 27219.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/rs400.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c
index a9e06b0..0181d08 100644
--- a/drivers/gpu/drm/radeon/rs400.c
+++ b/drivers/gpu/drm/radeon/rs400.c
@@ -263,6 +263,7 @@ void rs400_mc_init(struct radeon_device *rdev)
base = (RREG32(RADEON_NB_TOM)  0x)  16;
radeon_vram_location(rdev, rdev-mc, base);
radeon_gtt_location(rdev, rdev-mc);
+   radeon_update_bandwidth_info(rdev);
 }

 uint32_t rs400_mc_rreg(struct radeon_device *rdev, uint32_t reg)
-- 
1.5.6.3


0001-drm-radeon-kms-fix-display-bandwidth-setup-on-rs4xx.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms: never treat rs4xx as AGP

2010-03-21 Thread Alex Deucher
From 7ac6ef362be216990835bfb5a7a71fdcf6d04ff5 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Sun, 21 Mar 2010 11:51:24 -0400
Subject: [PATCH] drm/radeon/kms: never treat rs4xx as AGP

RS4xx+ IGP chips use an internal gart, however,
some of them have the agp cap bits set in their pci
configs.  Make sure to clear the AGP flag as AGP will
not work with them.

Should fix fdo bug 27225

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_device.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_device.c
b/drivers/gpu/drm/radeon/radeon_device.c
index 75f7b1e..8de9edd 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -563,6 +563,14 @@ int radeon_device_init(struct radeon_device *rdev,
return r;
radeon_check_arguments(rdev);

+   /* all of the newer IGP chips have an internal gart
+* However some rs4xx report as AGP, so remove that here.
+*/
+   if ((rdev-family = CHIP_RS400) 
+   (rdev-flags  RADEON_IS_AGP)) {
+   rdev-flags = ~RADEON_IS_AGP;
+   }
+
if (rdev-flags  RADEON_IS_AGP  radeon_agpmode == -1) {
radeon_agp_disable(rdev);
}
-- 
1.5.6.3


0001-drm-radeon-kms-never-treat-rs4xx-as-AGP.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon/kms: never treat rs4xx as AGP

2010-03-21 Thread Alex Deucher
ARGH!  typo in that patch.  Correct version attached.

Alex


On Sun, Mar 21, 2010 at 11:56 AM, Alex Deucher alexdeuc...@gmail.com wrote:
 From 7ac6ef362be216990835bfb5a7a71fdcf6d04ff5 Mon Sep 17 00:00:00 2001
 From: Alex Deucher alexdeuc...@gmail.com
 Date: Sun, 21 Mar 2010 11:51:24 -0400
 Subject: [PATCH] drm/radeon/kms: never treat rs4xx as AGP

 RS4xx+ IGP chips use an internal gart, however,
 some of them have the agp cap bits set in their pci
 configs.  Make sure to clear the AGP flag as AGP will
 not work with them.

 Should fix fdo bug 27225

 Signed-off-by: Alex Deucher alexdeuc...@gmail.com
 ---
  drivers/gpu/drm/radeon/radeon_device.c |    8 
  1 files changed, 8 insertions(+), 0 deletions(-)

 diff --git a/drivers/gpu/drm/radeon/radeon_device.c
 b/drivers/gpu/drm/radeon/radeon_device.c
 index 75f7b1e..8de9edd 100644
 --- a/drivers/gpu/drm/radeon/radeon_device.c
 +++ b/drivers/gpu/drm/radeon/radeon_device.c
 @@ -563,6 +563,14 @@ int radeon_device_init(struct radeon_device *rdev,
                return r;
        radeon_check_arguments(rdev);

 +       /* all of the newer IGP chips have an internal gart
 +        * However some rs4xx report as AGP, so remove that here.
 +        */
 +       if ((rdev-family = CHIP_RS400) 
 +           (rdev-flags  RADEON_IS_AGP)) {
 +               rdev-flags = ~RADEON_IS_AGP;
 +       }
 +
        if (rdev-flags  RADEON_IS_AGP  radeon_agpmode == -1) {
                radeon_agp_disable(rdev);
        }
 --
 1.5.6.3



0001-drm-radeon-kms-never-treat-rs4xx-as-AGP.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCHES] radeon kms pm patches

2010-03-18 Thread Alex Deucher
2010/3/18 Rafał Miłecki zaj...@gmail.com:
 W dniu 18 marca 2010 10:05 użytkownik Rafał Miłecki zaj...@gmail.com 
 napisał:
 Whoops, I missed one patch. My mistake.

 I've just applied all patches dated as 17-Mar-2010 22:42 and tested.

 Now memory reclocking is really enabled, but it causes corruptions for
 me. Maybe that's the same thing you experienced with dual head?

 Video is *far* from perfect, but maybe will give you some idea of what
 do I experience:
 http://estudent.put.poznan.pl/rafal.milecki/kernel/MOV00225.MP4

 The same happened for me before all your patches, when I tried to
 enable memory reclocking on my own.

yeah, the similar to what I saw with dualhead.  I guess we are either
missing the vblank window or the reclock is taking too much time.  I
wonder if it would make sense to wait for a vline rather than vblank,
say a vline 1/2 or 2/3 of the way down the screen, to give us some
buffer time between calling the reclock function and whatever setup it
does and the beginning of the actual vblank period.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms: add hw_i2c module option

2010-03-17 Thread Alex Deucher
From 05f313069127e7dfbd28e4d8ff2142657650aeee Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Wed, 17 Mar 2010 02:07:37 -0400
Subject: [PATCH] drm/radeon/kms: add hw_i2c module option

Turn off hw i2c by default except for mm i2c which
is hw only until we sort out the remaining prescale
issues on older chips.  hw i2c can be enabled with
hw_i2c=1.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon.h |1 +
 drivers/gpu/drm/radeon/radeon_drv.c |4 
 drivers/gpu/drm/radeon/radeon_i2c.c |8 +---
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 7003f6c..ae9a15a 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -91,6 +91,7 @@ extern int radeon_tv;
 extern int radeon_new_pll;
 extern int radeon_dynpm;
 extern int radeon_audio;
+extern int radeon_hw_i2c;

 /*
  * Copy from radeon_drv.h so we don't have to include both and have conflicting
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c
b/drivers/gpu/drm/radeon/radeon_drv.c
index 6eec0ec..1de124f 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -91,6 +91,7 @@ int radeon_tv = 1;
 int radeon_new_pll = -1;
 int radeon_dynpm = -1;
 int radeon_audio = 1;
+int radeon_hw_i2c = 0;

 MODULE_PARM_DESC(no_wb, Disable AGP writeback for scratch registers);
 module_param_named(no_wb, radeon_no_wb, int, 0444);
@@ -134,6 +135,9 @@ module_param_named(dynpm, radeon_dynpm, int, 0444);
 MODULE_PARM_DESC(audio, Audio enable (0 = disable));
 module_param_named(audio, radeon_audio, int, 0444);

+MODULE_PARM_DESC(hw_i2c, hw i2c engine enable (0 = disable));
+module_param_named(hw_i2c, radeon_hw_i2c, int, 0444);
+
 static int radeon_suspend(struct drm_device *dev, pm_message_t state)
 {
drm_radeon_private_t *dev_priv = dev-dev_private;
diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c
b/drivers/gpu/drm/radeon/radeon_i2c.c
index 352110f..5def6f5 100644
--- a/drivers/gpu/drm/radeon/radeon_i2c.c
+++ b/drivers/gpu/drm/radeon/radeon_i2c.c
@@ -879,9 +879,11 @@ struct radeon_i2c_chan *radeon_i2c_create(struct
drm_device *dev,
i2c-adapter.owner = THIS_MODULE;
i2c-dev = dev;
i2c_set_adapdata(i2c-adapter, i2c);
-   if (rec-hw_capable 
-   ((rdev-family = CHIP_RS480) ||
-((rdev-family = CHIP_RV515)  (rdev-family = CHIP_R580 {
+   if (rec-mm_i2c ||
+   (rec-hw_capable 
+radeon_hw_i2c 
+((rdev-family = CHIP_RS480) ||
+ ((rdev-family = CHIP_RV515)  (rdev-family = CHIP_R580) {
/* set the radeon hw i2c adapter */
sprintf(i2c-adapter.name, Radeon i2c hw bus %s, name);
i2c-adapter.algo = radeon_i2c_algo;
-- 
1.5.6.3


0001-drm-radeon-kms-add-hw_i2c-module-option.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCHES] radeon kms pm patches

2010-03-17 Thread Alex Deucher
2010/3/17 Rafał Miłecki zaj...@gmail.com:
 2010/3/17 Alex Deucher alexdeuc...@gmail.com:
 On Mon, Mar 15, 2010 at 3:30 AM, Alex Deucher alexdeuc...@gmail.com wrote:
 On Sun, Mar 14, 2010 at 7:01 PM, Alex Deucher alexdeuc...@gmail.com wrote:
 This weekend I finally got some time to sit down with kms pm, and I
 created a new patch set (against drm-radeon-testing).  For those that
 want to play with the i2c stuff for thermal chips, you'll probably
 grab my recent i2c patches as well.  You can grab my latest pm patches
 here:
 http://people.freedesktop.org/~agd5f/pm2/

 Updated patches rebased against airlied's new drm-radeon-testing along
 with the fixes noted in Rafal's comments:
 http://people.freedesktop.org/~agd5f/pm2/

 Another set of updated patches against drm-radeon-testing:
 http://people.freedesktop.org/~agd5f/pm2/

 These implement much the remaining pm functionality.  So far they are
 working well here.
 these patches add:
 - memory reclocking
 - pcie lane changes
 - update display watermarks as bandwidth changes
 - allow power management with multi-head
 - reset power mode on exit

 Nice, looks alright, thanks. Will test later if I manage before
 leaving for skiing.

Thanks.


 Do you know if we could ever recolck memory on multiple CRTCs? If not,
 what's the reason?

I think so.  It works now more or less, there's just an occasional
jitter on the head not synced.  I'm trying to find out how we do it
internally.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: Commit 96a4c8d50de20da865296a380b996f73204d6b34 breaks PowerBook LVDS

2010-03-17 Thread Alex Deucher
2010/3/17 Michel Dänzer mic...@daenzer.net:
 On Tue, 2010-03-16 at 10:56 -0400, Alex Deucher wrote:
 2010/3/16 Michel Dänzer mic...@daenzer.net:
 
  Commit 96a4c8d50de20da865296a380b996f73204d6b34 ('drm/radeon/kms: fix
  i2c prescale calc on older radeons') breaks LVDS on my RV350 PowerBook
  again. Reverting just that commit on top of drm-radeon-testing commit
  589468458fa964c2020e23e4d9353be2ef8bd3be fixes it.
 

 Do any of the suggestions on bug 26430 help?
 http://bugs.freedesktop.org/show_bug.cgi?id=26430

 I've tried i2c_clock = 50/10/100 and m = loop - 1, no luck. I also added
 debugging output to verify that sclk seems sane the calculations seem to
 take effect as expected:

 [   59.138772] [drm] sclk=44550
 [   59.138775] [drm] nm=2227
 [   59.138779] [drm] loop=48 n=47 m=46 = prescale=0x2f2e


 So, did that commit actually fix anything? :} It regresses at least for
 me and doesn't seem to help for the bug it claims it 'should fix'...

It fixed r1xx for me.  Also, the prescale is actually applied to the
sclk, to I think it was just luck that it worked with the reference
clock.  It just happened to be the right combination of numbers...
All my cards worked fine with both algos :/

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms: remove lvds quirks

2010-03-17 Thread Alex Deucher
From 8081a7f7b74310d9cfd03637741d59d8fd66d1e5 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Wed, 17 Mar 2010 19:50:59 -0400
Subject: [PATCH] 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 alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/atombios_crtc.c   |6 --
 drivers/gpu/drm/radeon/radeon_atombios.c |   27 ---
 2 files changed, 0 insertions(+), 33 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c
b/drivers/gpu/drm/radeon/atombios_crtc.c
index 1532f3e..fb11fc1 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -526,12 +526,6 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
/* DVO wants 2x pixel clock if the DVO chip is 
in 12 bit mode */
if (radeon_encoder-encoder_id == 
ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1)
adjusted_clock = mode-clock * 2;
-   /* LVDS PLL quirks */
-   if (encoder-encoder_type == 
DRM_MODE_ENCODER_LVDS) {
-   struct radeon_encoder_atom_dig *dig = 
radeon_encoder-enc_priv;
-   pll-algo = dig-pll_algo;
-   pll-flags |= RADEON_PLL_IS_LCD;
-   }
} else {
if (encoder-encoder_type != 
DRM_MODE_ENCODER_DAC)
pll-flags |= 
RADEON_PLL_NO_ODD_POST_DIV;
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c
b/drivers/gpu/drm/radeon/radeon_atombios.c
index 8a5846b..2219bca 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -1120,30 +1120,6 @@ static struct radeon_atom_ss
*radeon_atombios_get_ss_info(struct
return ss;
 }

-static void radeon_atom_apply_lvds_quirks(struct drm_device *dev,
- struct radeon_encoder_atom_dig *lvds)
-{
-
-   /* Toshiba A300-1BU laptop panel doesn't like new pll divider algo */
-   if ((dev-pdev-device == 0x95c4) 
-   (dev-pdev-subsystem_vendor == 0x1179) 
-   (dev-pdev-subsystem_device == 0xff50)) {
-   if ((lvds-native_mode.hdisplay == 1280) 
-   (lvds-native_mode.vdisplay == 800))
-   lvds-pll_algo = PLL_ALGO_LEGACY;
-   }
-
-   /* Dell Studio 15 laptop panel doesn't like new pll divider algo */
-   if ((dev-pdev-device == 0x95c4) 
-   (dev-pdev-subsystem_vendor == 0x1028) 
-   (dev-pdev-subsystem_device == 0x029f)) {
-   if ((lvds-native_mode.hdisplay == 1280) 
-   (lvds-native_mode.vdisplay == 800))
-   lvds-pll_algo = PLL_ALGO_LEGACY;
-   }
-
-}
-
 union lvds_info {
struct _ATOM_LVDS_INFO info;
struct _ATOM_LVDS_INFO_V12 info_12;
@@ -1223,9 +1199,6 @@ struct radeon_encoder_atom_dig
*radeon_atombios_get_lvds_info(struct
lvds-pll_algo = PLL_ALGO_LEGACY;
}

-   /* LVDS quirks */
-   radeon_atom_apply_lvds_quirks(dev, lvds);
-
encoder-native_mode = lvds-native_mode;
}
return lvds;
-- 
1.5.6.3


0001-drm-radeon-kms-remove-lvds-quirks.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCHES] radeon kms pm patches

2010-03-17 Thread Alex Deucher
2010/3/17 Rafał Miłecki zaj...@gmail.com:
 2010/3/17 Alex Deucher alexdeuc...@gmail.com:
 Another set of updated patches against drm-radeon-testing:
 http://people.freedesktop.org/~agd5f/pm2/

 Not serious thing, but still it's warning...

 # git am pm2/0001*
 Applying: drm/radeon/kms/atom: make sure tables are valid
 /home/drm-2.6/.git/rebase-apply/patch:475: space before tab in indent.
        if (atom_parse_data_header(mode_info-atom_context, index,
 NULL, frev, crev, data_offset)) {
 /home/drm-2.6/.git/rebase-apply/patch:476: space before tab in indent.
                power_info = (union power_info
 *)(mode_info-atom_context-bios + data_offset);
 warning: 2 lines add whitespace errors.

Looks like I was a little too quirk with that patch :)  I'll get that fixed up.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCHES] radeon kms pm patches

2010-03-17 Thread Alex Deucher
2010/3/17 Rafał Miłecki zaj...@gmail.com:
 2010/3/17 Alex Deucher alexdeuc...@gmail.com
 Another set of updated patches against drm-radeon-testing:
 http://people.freedesktop.org/~agd5f/pm2/

 These implement much the remaining pm functionality.  So far they are
 working well here.
 these patches add:
 - memory reclocking
 - pcie lane changes
 - update display watermarks as bandwidth changes
 - allow power management with multi-head
 - reset power mode on exit

 It seems memory reclocking and SIMDs setting is disabled for r6xx with
 currently available patches...?


It re-clocks memory (for single head anyway), r600_set_power_state():

/* set memory clock */
if (rdev-asic-set_memory_clock  (mclk !=
rdev-pm.current_mclk)) {
radeon_sync_with_vblank(rdev);
radeon_pm_debug_check_in_vbl(rdev, false);
radeon_set_memory_clock(rdev, mclk);
radeon_pm_debug_check_in_vbl(rdev, true);
rdev-pm.current_mclk = mclk;
DRM_INFO(Setting: m: %d\n, mclk);
}

The simd stuff is still disabled at the moment.

 Otherwise it seems to work fine.

Thanks for testing.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: Commit 96a4c8d50de20da865296a380b996f73204d6b34 breaks PowerBook LVDS

2010-03-16 Thread Alex Deucher
2010/3/16 Michel Dänzer mic...@daenzer.net:

 Commit 96a4c8d50de20da865296a380b996f73204d6b34 ('drm/radeon/kms: fix
 i2c prescale calc on older radeons') breaks LVDS on my RV350 PowerBook
 again. Reverting just that commit on top of drm-radeon-testing commit
 589468458fa964c2020e23e4d9353be2ef8bd3be fixes it.


Do any of the suggestions on bug 26430 help?
http://bugs.freedesktop.org/show_bug.cgi?id=26430

Alex


 --
 Earthling Michel Dänzer           |                http://www.vmware.com
 Libre software enthusiast         |          Debian, X and DRI developer


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon/kms: init rdev-num_crtc at asic init

2010-03-16 Thread Alex Deucher
Updated version that applies cleanly without other pm changes.

Alex

From c651ef22ef41204031e0be5fe6f2fc43554775db Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Tue, 16 Mar 2010 16:57:52 -0400
Subject: [PATCH] drm/radeon/kms: init rdev-num_crtc at asic init

Replace hardcoded numbers with rdev-num_crtc.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_asic.c|   10 ++
 drivers/gpu/drm/radeon/radeon_display.c |9 -
 drivers/gpu/drm/radeon/radeon_irq_kms.c |9 +++--
 3 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_asic.c
b/drivers/gpu/drm/radeon/radeon_asic.c
index 3e40bc4..45ccc81 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.c
+++ b/drivers/gpu/drm/radeon/radeon_asic.c
@@ -713,6 +713,16 @@ int radeon_asic_init(struct radeon_device *rdev)
rdev-asic-set_memory_clock = NULL;
}

+   /* set the number of crtcs */
+   if (rdev-flags  RADEON_SINGLE_CRTC)
+   rdev-num_crtc = 1;
+   else {
+   if (ASIC_IS_DCE4(rdev))
+   rdev-num_crtc = 6;
+   else
+   rdev-num_crtc = 2;
+   }
+
return 0;
 }

diff --git a/drivers/gpu/drm/radeon/radeon_display.c
b/drivers/gpu/drm/radeon/radeon_display.c
index ff5f099..d65931d 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -1003,15 +1003,6 @@ int radeon_modeset_init(struct radeon_device *rdev)
radeon_combios_check_hardcoded_edid(rdev);
}

-   if (rdev-flags  RADEON_SINGLE_CRTC)
-   rdev-num_crtc = 1;
-   else {
-   if (ASIC_IS_DCE4(rdev))
-   rdev-num_crtc = 6;
-   else
-   rdev-num_crtc = 2;
-   }
-
/* allocate crtcs */
for (i = 0; i  rdev-num_crtc; i++) {
radeon_crtc_init(rdev-ddev, i);
diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c
b/drivers/gpu/drm/radeon/radeon_irq_kms.c
index 3cfd60f..1122687 100644
--- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
@@ -95,22 +95,19 @@ void radeon_driver_irq_uninstall_kms(struct drm_device *dev)
}
/* Disable *all* interrupts */
rdev-irq.sw_int = false;
-   for (i = 0; i  2; i++) {
+   for (i = 0; i  rdev-num_crtc; i++)
rdev-irq.crtc_vblank_int[i] = false;
+   for (i = 0; i  6; i++)
rdev-irq.hpd[i] = false;
-   }
radeon_irq_set(rdev);
 }

 int radeon_irq_kms_init(struct radeon_device *rdev)
 {
int r = 0;
-   int num_crtc = 2;

-   if (rdev-flags  RADEON_SINGLE_CRTC)
-   num_crtc = 1;
spin_lock_init(rdev-irq.sw_lock);
-   r = drm_vblank_init(rdev-ddev, num_crtc);
+   r = drm_vblank_init(rdev-ddev, rdev-num_crtc);
if (r) {
return r;
}
-- 
1.5.6.3


On Mon, Mar 15, 2010 at 5:10 PM, Alex Deucher alexdeuc...@gmail.com wrote:
 From 2ccd66337a664a7096ff5fba6ad7f9f01295c17b Mon Sep 17 00:00:00 2001
 From: Alex Deucher alexdeuc...@gmail.com
 Date: Mon, 15 Mar 2010 17:02:12 -0400
 Subject: [PATCH] drm/radeon/kms: init rdev-num_crtc at asic init

 Replace hardcoded numbers with rdev-num_crtc.

 Signed-off-by: Alex Deucher alexdeuc...@gmail.com
 ---
  drivers/gpu/drm/radeon/radeon_asic.c    |   10 ++
  drivers/gpu/drm/radeon/radeon_display.c |    9 -
  drivers/gpu/drm/radeon/radeon_irq_kms.c |    9 +++--
  3 files changed, 13 insertions(+), 15 deletions(-)

 diff --git a/drivers/gpu/drm/radeon/radeon_asic.c
 b/drivers/gpu/drm/radeon/radeon_asic.c
 index 7e34a00..53ee3f8 100644
 --- a/drivers/gpu/drm/radeon/radeon_asic.c
 +++ b/drivers/gpu/drm/radeon/radeon_asic.c
 @@ -752,6 +752,16 @@ int radeon_asic_init(struct radeon_device *rdev)
                rdev-asic-set_memory_clock = NULL;
        }

 +       /* set the number of crtcs */
 +       if (rdev-flags  RADEON_SINGLE_CRTC)
 +               rdev-num_crtc = 1;
 +       else {
 +               if (ASIC_IS_DCE4(rdev))
 +                       rdev-num_crtc = 6;
 +               else
 +                       rdev-num_crtc = 2;
 +       }
 +
        return 0;
  }

 diff --git a/drivers/gpu/drm/radeon/radeon_display.c
 b/drivers/gpu/drm/radeon/radeon_display.c
 index ff5f099..d65931d 100644
 --- a/drivers/gpu/drm/radeon/radeon_display.c
 +++ b/drivers/gpu/drm/radeon/radeon_display.c
 @@ -1003,15 +1003,6 @@ int radeon_modeset_init(struct radeon_device *rdev)
                radeon_combios_check_hardcoded_edid(rdev);
        }

 -       if (rdev-flags  RADEON_SINGLE_CRTC)
 -               rdev-num_crtc = 1;
 -       else {
 -               if (ASIC_IS_DCE4(rdev))
 -                       rdev-num_crtc = 6;
 -               else
 -                       rdev-num_crtc = 2;
 -       }
 -
        /* allocate crtcs */
        for (i = 0; i

Re: [PATCH] drm/radeon/kms: init rdev-num_crtc at asic init

2010-03-16 Thread Alex Deucher
ARGH!  sent the wrong patch again.  This one should be the correct one.

Alex

From c04ed4d1639c09829e0851c579734173e1aa7bca Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Tue, 16 Mar 2010 17:08:06 -0400
Subject: [PATCH] drm/radeon/kms: init rdev-num_crtc at asic init

Replace hardcoded numbers with rdev-num_crtc.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_asic.c|   10 ++
 drivers/gpu/drm/radeon/radeon_display.c |9 -
 drivers/gpu/drm/radeon/radeon_irq_kms.c |   14 ++
 3 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_asic.c
b/drivers/gpu/drm/radeon/radeon_asic.c
index 3e40bc4..45ccc81 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.c
+++ b/drivers/gpu/drm/radeon/radeon_asic.c
@@ -713,6 +713,16 @@ int radeon_asic_init(struct radeon_device *rdev)
rdev-asic-set_memory_clock = NULL;
}

+   /* set the number of crtcs */
+   if (rdev-flags  RADEON_SINGLE_CRTC)
+   rdev-num_crtc = 1;
+   else {
+   if (ASIC_IS_DCE4(rdev))
+   rdev-num_crtc = 6;
+   else
+   rdev-num_crtc = 2;
+   }
+
return 0;
 }

diff --git a/drivers/gpu/drm/radeon/radeon_display.c
b/drivers/gpu/drm/radeon/radeon_display.c
index ff5f099..d65931d 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -1003,15 +1003,6 @@ int radeon_modeset_init(struct radeon_device *rdev)
radeon_combios_check_hardcoded_edid(rdev);
}

-   if (rdev-flags  RADEON_SINGLE_CRTC)
-   rdev-num_crtc = 1;
-   else {
-   if (ASIC_IS_DCE4(rdev))
-   rdev-num_crtc = 6;
-   else
-   rdev-num_crtc = 2;
-   }
-
/* allocate crtcs */
for (i = 0; i  rdev-num_crtc; i++) {
radeon_crtc_init(rdev-ddev, i);
diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c
b/drivers/gpu/drm/radeon/radeon_irq_kms.c
index 3cfd60f..68519b4 100644
--- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
@@ -67,9 +67,10 @@ void radeon_driver_irq_preinstall_kms(struct drm_device *dev)

/* Disable *all* interrupts */
rdev-irq.sw_int = false;
-   for (i = 0; i  2; i++) {
+   for (i = 0; i  rdev-num_crtc; i++)
rdev-irq.crtc_vblank_int[i] = false;
-   }
+   for (i = 0; i  6; i++)
+   rdev-irq.hpd[i] = false;
radeon_irq_set(rdev);
/* Clear bits */
radeon_irq_process(rdev);
@@ -95,22 +96,19 @@ void radeon_driver_irq_uninstall_kms(struct drm_device *dev)
}
/* Disable *all* interrupts */
rdev-irq.sw_int = false;
-   for (i = 0; i  2; i++) {
+   for (i = 0; i  rdev-num_crtc; i++)
rdev-irq.crtc_vblank_int[i] = false;
+   for (i = 0; i  6; i++)
rdev-irq.hpd[i] = false;
-   }
radeon_irq_set(rdev);
 }

 int radeon_irq_kms_init(struct radeon_device *rdev)
 {
int r = 0;
-   int num_crtc = 2;

-   if (rdev-flags  RADEON_SINGLE_CRTC)
-   num_crtc = 1;
spin_lock_init(rdev-irq.sw_lock);
-   r = drm_vblank_init(rdev-ddev, num_crtc);
+   r = drm_vblank_init(rdev-ddev, rdev-num_crtc);
if (r) {
return r;
}
-- 
1.5.6.3

On Tue, Mar 16, 2010 at 4:59 PM, Alex Deucher alexdeuc...@gmail.com wrote:
 Updated version that applies cleanly without other pm changes.

 Alex

 From c651ef22ef41204031e0be5fe6f2fc43554775db Mon Sep 17 00:00:00 2001
 From: Alex Deucher alexdeuc...@gmail.com
 Date: Tue, 16 Mar 2010 16:57:52 -0400
 Subject: [PATCH] drm/radeon/kms: init rdev-num_crtc at asic init

 Replace hardcoded numbers with rdev-num_crtc.

 Signed-off-by: Alex Deucher alexdeuc...@gmail.com
 ---
  drivers/gpu/drm/radeon/radeon_asic.c    |   10 ++
  drivers/gpu/drm/radeon/radeon_display.c |    9 -
  drivers/gpu/drm/radeon/radeon_irq_kms.c |    9 +++--
  3 files changed, 13 insertions(+), 15 deletions(-)

 diff --git a/drivers/gpu/drm/radeon/radeon_asic.c
 b/drivers/gpu/drm/radeon/radeon_asic.c
 index 3e40bc4..45ccc81 100644
 --- a/drivers/gpu/drm/radeon/radeon_asic.c
 +++ b/drivers/gpu/drm/radeon/radeon_asic.c
 @@ -713,6 +713,16 @@ int radeon_asic_init(struct radeon_device *rdev)
                rdev-asic-set_memory_clock = NULL;
        }

 +       /* set the number of crtcs */
 +       if (rdev-flags  RADEON_SINGLE_CRTC)
 +               rdev-num_crtc = 1;
 +       else {
 +               if (ASIC_IS_DCE4(rdev))
 +                       rdev-num_crtc = 6;
 +               else
 +                       rdev-num_crtc = 2;
 +       }
 +
        return 0;
  }

 diff --git a/drivers/gpu/drm/radeon/radeon_display.c
 b/drivers/gpu/drm/radeon/radeon_display.c
 index ff5f099..d65931d 100644
 --- a/drivers

[PATCH] drm/radeon/kms: display watermark fixes

2010-03-16 Thread Alex Deucher
From da5bdce6046f82d6c12d7d8ed204866c7c51c331 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Tue, 16 Mar 2010 20:54:38 -0400
Subject: [PATCH] drm/radeon/kms: display watermark fixes

- rs780/880 were using the wrong bandwidth functions
- convert r1xx-r4xx to use the same pm sclk/mclk structs as
r5xx+
- move bandwidth setup to a common function

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/evergreen.c |9 +-
 drivers/gpu/drm/radeon/r100.c  |8 ++
 drivers/gpu/drm/radeon/r300.c  |1 +
 drivers/gpu/drm/radeon/r520.c  |8 +-
 drivers/gpu/drm/radeon/r600.c  |9 +-
 drivers/gpu/drm/radeon/radeon.h|2 +
 drivers/gpu/drm/radeon/radeon_asic.c   |   42 +++-
 drivers/gpu/drm/radeon/radeon_device.c |   30 ++
 drivers/gpu/drm/radeon/rs600.c |2 +
 drivers/gpu/drm/radeon/rs690.c |   11 +---
 drivers/gpu/drm/radeon/rv515.c |8 +-
 drivers/gpu/drm/radeon/rv770.c |9 +-
 12 files changed, 88 insertions(+), 51 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen.c
b/drivers/gpu/drm/radeon/evergreen.c
index 4a07813..7672f11 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -437,7 +437,6 @@ static void evergreen_gpu_init(struct radeon_device *rdev)

 int evergreen_mc_init(struct radeon_device *rdev)
 {
-   fixed20_12 a;
u32 tmp;
int chansize, numchan;

@@ -482,12 +481,8 @@ int evergreen_mc_init(struct radeon_device *rdev)
rdev-mc.real_vram_size = rdev-mc.aper_size;
}
r600_vram_gtt_location(rdev, rdev-mc);
-   /* FIXME: we should enforce default clock in case GPU is not in
-* default setup
-*/
-   a.full = rfixed_const(100);
-   rdev-pm.sclk.full = rfixed_const(rdev-clock.default_sclk);
-   rdev-pm.sclk.full = rfixed_div(rdev-pm.sclk, a);
+   radeon_update_bandwidth_info(rdev);
+
return 0;
 }

diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 8614c9b..9fef5cc 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -2059,6 +2059,7 @@ void r100_mc_init(struct radeon_device *rdev)
radeon_vram_location(rdev, rdev-mc, base);
if (!(rdev-flags  RADEON_IS_AGP))
radeon_gtt_location(rdev, rdev-mc);
+   radeon_update_bandwidth_info(rdev);
 }


@@ -2450,11 +2451,8 @@ void r100_bandwidth_update(struct radeon_device *rdev)
/*
 * determine is there is enough bw for current mode
 */
-   mclk_ff.full = rfixed_const(rdev-clock.default_mclk);
-   temp_ff.full = rfixed_const(100);
-   mclk_ff.full = rfixed_div(mclk_ff, temp_ff);
-   sclk_ff.full = rfixed_const(rdev-clock.default_sclk);
-   sclk_ff.full = rfixed_div(sclk_ff, temp_ff);
+   sclk_ff = rdev-pm.sclk;
+   mclk_ff = rdev-pm.mclk;

temp = (rdev-mc.vram_width / 8) * (rdev-mc.vram_is_ddr ? 2 : 1);
temp_ff.full = rfixed_const(temp);
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 3a86cad..6a0b550 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -490,6 +490,7 @@ void r300_mc_init(struct radeon_device *rdev)
radeon_vram_location(rdev, rdev-mc, base);
if (!(rdev-flags  RADEON_IS_AGP))
radeon_gtt_location(rdev, rdev-mc);
+   radeon_update_bandwidth_info(rdev);
 }

 void rv370_set_pcie_lanes(struct radeon_device *rdev, int lanes)
diff --git a/drivers/gpu/drm/radeon/r520.c b/drivers/gpu/drm/radeon/r520.c
index a68865f..870111e 100644
--- a/drivers/gpu/drm/radeon/r520.c
+++ b/drivers/gpu/drm/radeon/r520.c
@@ -121,19 +121,13 @@ static void r520_vram_get_type(struct radeon_device *rdev)

 void r520_mc_init(struct radeon_device *rdev)
 {
-   fixed20_12 a;

r520_vram_get_type(rdev);
r100_vram_init_sizes(rdev);
radeon_vram_location(rdev, rdev-mc, 0);
if (!(rdev-flags  RADEON_IS_AGP))
radeon_gtt_location(rdev, rdev-mc);
-   /* FIXME: we should enforce default clock in case GPU is not in
-* default setup
-*/
-   a.full = rfixed_const(100);
-   rdev-pm.sclk.full = rfixed_const(rdev-clock.default_sclk);
-   rdev-pm.sclk.full = rfixed_div(rdev-pm.sclk, a);
+   radeon_update_bandwidth_info(rdev);
 }

 void r520_mc_program(struct radeon_device *rdev)
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index f70be27..3df2ab1 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -676,7 +676,6 @@ void r600_vram_gtt_location(struct radeon_device
*rdev, struct radeon_mc *mc)

 int r600_mc_init(struct radeon_device *rdev)
 {
-   fixed20_12 a;
u32 tmp;
int chansize, numchan;

@@ -720,14 +719,10 @@ int r600_mc_init(struct

Re: [PATCHES] radeon kms pm patches

2010-03-16 Thread Alex Deucher
On Mon, Mar 15, 2010 at 3:30 AM, Alex Deucher alexdeuc...@gmail.com wrote:
 On Sun, Mar 14, 2010 at 7:01 PM, Alex Deucher alexdeuc...@gmail.com wrote:
 This weekend I finally got some time to sit down with kms pm, and I
 created a new patch set (against drm-radeon-testing).  For those that
 want to play with the i2c stuff for thermal chips, you'll probably
 grab my recent i2c patches as well.  You can grab my latest pm patches
 here:
 http://people.freedesktop.org/~agd5f/pm2/

 Updated patches rebased against airlied's new drm-radeon-testing along
 with the fixes noted in Rafal's comments:
 http://people.freedesktop.org/~agd5f/pm2/

Another set of updated patches against drm-radeon-testing:
http://people.freedesktop.org/~agd5f/pm2/

These implement much the remaining pm functionality.  So far they are
working well here.
these patches add:
- memory reclocking
- pcie lane changes
- update display watermarks as bandwidth changes
- allow power management with multi-head
- reset power mode on exit

Alex



 Alex



 So far I haven't seen any corruption when changing power modes.

 What the patches do:
 - implement gui idle irq support
 - only change clocks when the engine is idle
 - add support for turning down the number of active simds in lower
 power modes (r6xx+)
 - add a pm_fini function
 - move set/get power state logic into asic specific callbacks.
 Different strategies for handling
 different power tables formats.

 Things left to do:
 - reset clocks to default on module unload (in pm_fini function)
 - add request module support for hwmon i2c thermal chip drivers
 - add hwmon support for internal thermal/fan support used on some
 r6xx/r7xx boards
 - add more robust power state selection
 - tie power state selection into external events (manual power mode
 selection, AC/DC state, etc.)
 - hook up memory reclocking
 - hook up pcie lane setting
 - hook up voltage setting

 Alex



--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCHES] radeon kms pm patches

2010-03-15 Thread Alex Deucher
2010/3/15 Rafał Miłecki zaj...@gmail.com:
 2010/3/15 Alex Deucher alexdeuc...@gmail.com:
 This weekend I finally got some time to sit down with kms pm, and I
 created a new patch set (against drm-radeon-testing).  For those that
 want to play with the i2c stuff for thermal chips, you'll probably
 grab my recent i2c patches as well.  You can grab my latest pm patches
 here:
 http://people.freedesktop.org/~agd5f/pm2/

 So far I haven't seen any corruption when changing power modes.

 Why don't you post them inline? It would be possible to comment any
 part of code.

It was a lot of patches.  I can post them with the message next time.


 1) What is GUI?

Graphical User Interface.  In this case it refers to the drawing
engine and related blocks (2D, 3D, CP, etc.).

 2) What is SIMD?

SIMD (Single Instruction Multiple Data) blocks are
the computational blocks of the shader engine.

Alex


 --
 Rafał


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCHES] radeon kms pm patches

2010-03-15 Thread Alex Deucher
2010/3/15 Rafał Miłecki zaj...@gmail.com:
 2010/3/15 Alex Deucher alexdeuc...@gmail.com:
 This weekend I finally got some time to sit down with kms pm, and I
 created a new patch set (against drm-radeon-testing).  For those that
 want to play with the i2c stuff for thermal chips, you'll probably
 grab my recent i2c patches as well.  You can grab my latest pm patches
 here:
 http://people.freedesktop.org/~agd5f/pm2/

 http://people.freedesktop.org/~agd5f/pm2/0003-drm-radeon-kms-add-some-comments-about-radeon_asic.patch

 Code you removed was needed for PM debugfs, to do not display memory
 clock on IGP

Oh, right... debugfs support is also currently broken with multiple
cards.  I'll just drop this patch for now.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCHES] radeon kms pm patches

2010-03-15 Thread Alex Deucher
2010/3/15 Rafał Miłecki zaj...@gmail.com:
 2010/3/15 Alex Deucher alexdeuc...@gmail.com:
 This weekend I finally got some time to sit down with kms pm, and I
 created a new patch set (against drm-radeon-testing).  For those that
 want to play with the i2c stuff for thermal chips, you'll probably
 grab my recent i2c patches as well.  You can grab my latest pm patches
 here:
 http://people.freedesktop.org/~agd5f/pm2/

 http://people.freedesktop.org/~agd5f/pm2/0009-drm-radeon-kms-r6xx-enable-simd-pm.patch

 Didn't you miss there something actually *setting* SIMD(s?)?

heh... whoops.  fixed.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCHES] radeon kms pm patches

2010-03-15 Thread Alex Deucher
2010/3/15 Rafał Miłecki zaj...@gmail.com:
 2010/3/15 Alex Deucher alexdeuc...@gmail.com:
 This weekend I finally got some time to sit down with kms pm, and I
 created a new patch set (against drm-radeon-testing).  For those that
 want to play with the i2c stuff for thermal chips, you'll probably
 grab my recent i2c patches as well.  You can grab my latest pm patches
 here:
 http://people.freedesktop.org/~agd5f/pm2/

 You can consider porting
 [PATCH 2/2] drm/radeon/kms: prepare for more reclocking operations

 You will need to sync with VBLANK few times I believe.

 Not sure about GUI syncing, do not know what is this.

I've gone ahead and rebased my patches against Dave's current
drm-radeon-testing branch, so both patches should be in now.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCHES] radeon kms pm patches

2010-03-15 Thread Alex Deucher
2010/3/15 Rafał Miłecki zaj...@gmail.com:
 2010/3/15 Alex Deucher alexdeuc...@gmail.com:
 This weekend I finally got some time to sit down with kms pm, and I
 created a new patch set (against drm-radeon-testing).  For those that
 want to play with the i2c stuff for thermal chips, you'll probably
 grab my recent i2c patches as well.  You can grab my latest pm patches
 here:
 http://people.freedesktop.org/~agd5f/pm2/

 http://people.freedesktop.org/~agd5f/pm2/0006-drm-radeon-kms-wait-for-gpu-idle-before-changing-po.patch

 You made same mistake I did earlier with 0 argument in condition.

 You should use same trick as I did in:
 http://people.freedesktop.org/~agd5f/pm2/0013-drm-radeon-kms-switch-to-condition-waiting-for-recl.patch

Good catch!  fixed.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon/kms: gfx init fixes for r6xx/r7xx

2010-03-15 Thread Alex Deucher
Looks like this one might have gotten lost in the shuffle.

Alex

On Fri, Mar 5, 2010 at 2:55 PM, Alex Deucher alexdeuc...@gmail.com wrote:
 From cec90cfdc0f20efcbcd266069a6a8234d230cc0b Mon Sep 17 00:00:00 2001
 From: Alex Deucher alexdeuc...@gmail.com
 Date: Fri, 5 Mar 2010 14:50:37 -0500
 Subject: [PATCH] drm/radeon/kms: gfx init fixes for r6xx/r7xx

 This fixes some issues with the last gfx init patch.

 Signed-off-by: Alex Deucher alexdeuc...@gmail.com
 ---
  drivers/gpu/drm/radeon/r600.c    |    1 +
  drivers/gpu/drm/radeon/r600_cp.c |    3 +++
  drivers/gpu/drm/radeon/rv770.c   |    3 +++
  3 files changed, 7 insertions(+), 0 deletions(-)

 diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
 index f9a8335..3980ec9 100644
 --- a/drivers/gpu/drm/radeon/r600.c
 +++ b/drivers/gpu/drm/radeon/r600.c
 @@ -1132,6 +1132,7 @@ void r600_gpu_init(struct radeon_device *rdev)
        /* Setup pipes */
        WREG32(CC_RB_BACKEND_DISABLE, cc_rb_backend_disable);
        WREG32(CC_GC_SHADER_PIPE_CONFIG, cc_gc_shader_pipe_config);
 +       WREG32(GC_USER_SHADER_PIPE_CONFIG, cc_gc_shader_pipe_config);

        tmp = R6XX_MAX_PIPES -
 r600_count_pipe_bits((cc_gc_shader_pipe_config 
 INACTIVE_QD_PIPES_MASK)  8);
        WREG32(VGT_OUT_DEALLOC_CNTL, (tmp * 4)  DEALLOC_DIST_MASK);
 diff --git a/drivers/gpu/drm/radeon/r600_cp.c 
 b/drivers/gpu/drm/radeon/r600_cp.c
 index 40416c0..68e6f43 100644
 --- a/drivers/gpu/drm/radeon/r600_cp.c
 +++ b/drivers/gpu/drm/radeon/r600_cp.c
 @@ -1548,10 +1548,13 @@ static void r700_gfx_init(struct drm_device *dev,

        RADEON_WRITE(R600_CC_RB_BACKEND_DISABLE,      cc_rb_backend_disable);
        RADEON_WRITE(R600_CC_GC_SHADER_PIPE_CONFIG,   
 cc_gc_shader_pipe_config);
 +       RADEON_WRITE(R600_GC_USER_SHADER_PIPE_CONFIG, 
 cc_gc_shader_pipe_config);

        RADEON_WRITE(R700_CC_SYS_RB_BACKEND_DISABLE, cc_rb_backend_disable);
        RADEON_WRITE(R700_CGTS_SYS_TCC_DISABLE, 0);
        RADEON_WRITE(R700_CGTS_TCC_DISABLE, 0);
 +       RADEON_WRITE(R700_CGTS_USER_SYS_TCC_DISABLE, 0);
 +       RADEON_WRITE(R700_CGTS_USER_TCC_DISABLE, 0);

        num_qd_pipes =
                R7XX_MAX_PIPES - 
 r600_count_pipe_bits((cc_gc_shader_pipe_config 
 R600_INACTIVE_QD_PIPES_MASK)  8);
 diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
 index 37887de..63c181b 100644
 --- a/drivers/gpu/drm/radeon/rv770.c
 +++ b/drivers/gpu/drm/radeon/rv770.c
 @@ -647,10 +647,13 @@ static void rv770_gpu_init(struct radeon_device *rdev)

        WREG32(CC_RB_BACKEND_DISABLE,      cc_rb_backend_disable);
        WREG32(CC_GC_SHADER_PIPE_CONFIG,   cc_gc_shader_pipe_config);
 +       WREG32(GC_USER_SHADER_PIPE_CONFIG, cc_gc_shader_pipe_config);
        WREG32(CC_SYS_RB_BACKEND_DISABLE,  cc_rb_backend_disable);

        WREG32(CGTS_SYS_TCC_DISABLE, 0);
        WREG32(CGTS_TCC_DISABLE, 0);
 +       WREG32(CGTS_USER_SYS_TCC_DISABLE, 0);
 +       WREG32(CGTS_USER_TCC_DISABLE, 0);

        num_qd_pipes =
                R7XX_MAX_PIPES - 
 r600_count_pipe_bits((cc_gc_shader_pipe_config 
 INACTIVE_QD_PIPES_MASK)  8);
 --
 1.5.6.3


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms/pm: fix typo in power table parsing

2010-03-15 Thread Alex Deucher
From b4880d6cb8d7913bf177c463cc8ffce8a2c1785a Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Mon, 15 Mar 2010 01:36:32 -0400
Subject: [PATCH] drm/radeon/kms/pm: fix typo in power table parsing

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_atombios.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c
b/drivers/gpu/drm/radeon/radeon_atombios.c
index 815116e..92e6886 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -1734,7 +1734,7 @@ void radeon_atombios_get_power_modes(struct
radeon_device *rdev)
/* add the i2c bus for thermal/fan chip */
/* no support for internal controller yet */
if (power_info-info_4.sThermalController.ucType  0) {
-   if 
((power_info-info_4.sThermalController.ucType ==
ATOM_PP_THERMALCONTROLLER_RV6xx) 
+   if 
((power_info-info_4.sThermalController.ucType ==
ATOM_PP_THERMALCONTROLLER_RV6xx) ||

(power_info-info_4.sThermalController.ucType ==
ATOM_PP_THERMALCONTROLLER_RV770)) {
DRM_INFO(Internal thermal controller 
%s fan control\n,
 
(power_info-info_4.sThermalController.ucFanParameters 
-- 
1.5.6.3


0001-drm-radeon-kms-pm-fix-typo-in-power-table-parsing.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms: init rdev-num_crtc at asic init

2010-03-15 Thread Alex Deucher
From 2ccd66337a664a7096ff5fba6ad7f9f01295c17b Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Mon, 15 Mar 2010 17:02:12 -0400
Subject: [PATCH] drm/radeon/kms: init rdev-num_crtc at asic init

Replace hardcoded numbers with rdev-num_crtc.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_asic.c|   10 ++
 drivers/gpu/drm/radeon/radeon_display.c |9 -
 drivers/gpu/drm/radeon/radeon_irq_kms.c |9 +++--
 3 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_asic.c
b/drivers/gpu/drm/radeon/radeon_asic.c
index 7e34a00..53ee3f8 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.c
+++ b/drivers/gpu/drm/radeon/radeon_asic.c
@@ -752,6 +752,16 @@ int radeon_asic_init(struct radeon_device *rdev)
rdev-asic-set_memory_clock = NULL;
}

+   /* set the number of crtcs */
+   if (rdev-flags  RADEON_SINGLE_CRTC)
+   rdev-num_crtc = 1;
+   else {
+   if (ASIC_IS_DCE4(rdev))
+   rdev-num_crtc = 6;
+   else
+   rdev-num_crtc = 2;
+   }
+
return 0;
 }

diff --git a/drivers/gpu/drm/radeon/radeon_display.c
b/drivers/gpu/drm/radeon/radeon_display.c
index ff5f099..d65931d 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -1003,15 +1003,6 @@ int radeon_modeset_init(struct radeon_device *rdev)
radeon_combios_check_hardcoded_edid(rdev);
}

-   if (rdev-flags  RADEON_SINGLE_CRTC)
-   rdev-num_crtc = 1;
-   else {
-   if (ASIC_IS_DCE4(rdev))
-   rdev-num_crtc = 6;
-   else
-   rdev-num_crtc = 2;
-   }
-
/* allocate crtcs */
for (i = 0; i  rdev-num_crtc; i++) {
radeon_crtc_init(rdev-ddev, i);
diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c
b/drivers/gpu/drm/radeon/radeon_irq_kms.c
index 5c26c0a..45926ea 100644
--- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
@@ -96,22 +96,19 @@ void radeon_driver_irq_uninstall_kms(struct drm_device *dev)
/* Disable *all* interrupts */
rdev-irq.sw_int = false;
rdev-irq.gui_idle = false;
-   for (i = 0; i  2; i++) {
+   for (i = 0; i  rdev-num_crtc; i++)
rdev-irq.crtc_vblank_int[i] = false;
+   for (i = 0; i  6; i++)
rdev-irq.hpd[i] = false;
-   }
radeon_irq_set(rdev);
 }

 int radeon_irq_kms_init(struct radeon_device *rdev)
 {
int r = 0;
-   int num_crtc = 2;

-   if (rdev-flags  RADEON_SINGLE_CRTC)
-   num_crtc = 1;
spin_lock_init(rdev-irq.sw_lock);
-   r = drm_vblank_init(rdev-ddev, num_crtc);
+   r = drm_vblank_init(rdev-ddev, rdev-num_crtc);
if (r) {
return r;
}
-- 
1.5.6.3


0001-drm-radeon-kms-init-rdev-num_crtc-at-asic-init.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCHES] radeon drm kms i2c fixes

2010-03-14 Thread Alex Deucher
On Wed, Mar 10, 2010 at 7:09 PM, Alex Deucher alexdeuc...@gmail.com wrote:
 Thanks to Jean for helping me with the i2c stuff.  I've attached
 Jean's bit algo patch as my radeon patch depends on it.  I'm not sure
 how we want to get that one upstream (either via drm or i2c).
 Previously, the radeon drm registered i2c buses using the radeon algo
 which would use either the hw i2c engine or bit banging depending on
 the bus in question (some are hw capable, others are not, some chips
 don't have support for their hw engines yet, etc.).  The tricky part
 was that the radeon i2c bit buses require some gpio magic before and
 after a transaction which bit algo didn't previously support.
 Unfortunately, it exposed the internal bit algo bus as well we as the
 radeon algo bus which is bad.  With these patches, if the hw engine is
 supported, we use the radeon algo, if not, we use bit algo directly
 with the pre/post_xfer functions to fix up the gpios.  I've tested on
 several radeons, but more tested would be nice.

Updated patch based on Jean's new version of the pre/post_xfer patch
(also attached) which he plans to push upstream via the i2c tree.

Alex


0001-i2c-algo-bit-Add-pre-and-post-xfer-hooks.patch
Description: application/mbox


0002-drm-radeon-kms-use-new-pre-post_xfer-i2c-bit-algo-h.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms/rs4xx: make sure crtcs are enabled when setting timing

2010-03-14 Thread Alex Deucher
This fixes fdo bug 27008.

From 0be75bd324cea1eb577cf4bdebfb59af217876cf Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Thu, 11 Mar 2010 10:38:07 -0500
Subject: [PATCH] drm/radeon/kms/rs4xx: make sure crtcs are enabled
when setting timing

based on ddx patch from Matthias Hopf.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_legacy_crtc.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
index df23d6a..88865e3 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
@@ -603,6 +603,10 @@ static bool radeon_set_crtc_timing(struct
drm_crtc *crtc, struct drm_display_mod
  ? RADEON_CRTC2_INTERLACE_EN
  : 0));

+   /* rs4xx chips seem to like to have the crtc enabled when the
timing is set */
+   if ((rdev-family == CHIP_RS400) || (rdev-family == 
CHIP_RS480))
+   crtc2_gen_cntl |= RADEON_CRTC2_EN;
+
disp2_merge_cntl = RREG32(RADEON_DISP2_MERGE_CNTL);
disp2_merge_cntl = ~RADEON_DISP2_RGB_OFFSET_EN;

@@ -630,6 +634,10 @@ static bool radeon_set_crtc_timing(struct
drm_crtc *crtc, struct drm_display_mod
? RADEON_CRTC_INTERLACE_EN
: 0));

+   /* rs4xx chips seem to like to have the crtc enabled when the
timing is set */
+   if ((rdev-family == CHIP_RS400) || (rdev-family == 
CHIP_RS480))
+   crtc_gen_cntl |= RADEON_CRTC_EN;
+
crtc_ext_cntl = RREG32(RADEON_CRTC_EXT_CNTL);
crtc_ext_cntl |= (RADEON_XCRT_CNT_EN |
  RADEON_CRTC_VSYNC_DIS |
-- 
1.5.6.3


0001-drm-radeon-kms-rs4xx-make-sure-crtcs-are-enabled-wh.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon/kms: add PM quirk for Asus Radeon HD 3200

2010-03-14 Thread Alex Deucher
2010/3/5 Rafał Miłecki zaj...@gmail.com:
 Signed-off-by: Rafał Miłecki zaj...@gmail.com

NACK.  I've got a better way to deal with this.

Alex


 ---
  drivers/gpu/drm/radeon/radeon_pm.c |   18 ++
  1 files changed, 18 insertions(+), 0 deletions(-)

 diff --git a/drivers/gpu/drm/radeon/radeon_pm.c 
 b/drivers/gpu/drm/radeon/radeon_pm.c
 index 6b65f15..a2ea0be 100644
 --- a/drivers/gpu/drm/radeon/radeon_pm.c
 +++ b/drivers/gpu/drm/radeon/radeon_pm.c
 @@ -79,6 +79,23 @@ static void radeon_print_power_mode_info(struct 
 radeon_device *rdev)
        }
  }

 +static void radeon_apply_pm_quirks(struct radeon_device *rdev)
 +{
 +       /* Asus Radeon HD 3200 contains power states with reversed types */
 +       /* We received single report like this so far. See FDO bug #26347.
 +          In case of more reports we may consider some detecting algorithm */
 +       if ((rdev-pdev-device == 0x9610) 
 +           (rdev-pdev-subsystem_vendor == 0x1043) 
 +           (rdev-pdev-subsystem_device == 0x82f1)) {
 +               rdev-pm.power_state[0].type = POWER_STATE_TYPE_PERFORMANCE;
 +               rdev-pm.power_state[1].type = POWER_STATE_TYPE_DEFAULT;
 +               rdev-pm.default_power_state = rdev-pm.power_state[1];
 +               rdev-pm.current_power_state = rdev-pm.default_power_state;
 +               rdev-pm.current_clock_mode =
 +                       rdev-pm.default_power_state-default_clock_mode;
 +       }
 +}
 +
  static struct radeon_power_state * radeon_pick_power_state(struct 
 radeon_device *rdev,
                                                           enum 
 radeon_pm_state_type type)
  {
 @@ -235,6 +252,7 @@ int radeon_pm_init(struct radeon_device *rdev)
                        radeon_atombios_get_power_modes(rdev);
                else
                        radeon_combios_get_power_modes(rdev);
 +               radeon_apply_pm_quirks(rdev);
                radeon_print_power_mode_info(rdev);
        }

 --
 1.6.4.2


 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 --
 ___
 Dri-devel mailing list
 Dri-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/dri-devel


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon/kms: add PM quirk for Asus Radeon HD 3200

2010-03-14 Thread Alex Deucher
2010/3/14 Rafał Miłecki zaj...@gmail.com:
 W dniu 14 marca 2010 21:48 użytkownik Alex Deucher
 alexdeuc...@gmail.com napisał:
 2010/3/5 Rafał Miłecki zaj...@gmail.com:
 Signed-off-by: Rafał Miłecki zaj...@gmail.com

 NACK.  I've got a better way to deal with this.

 Post it. I see we love missing merge windows :|

On their way.  Unfortunately, this weekend was the first chance I had
to look at PM stuff in a while.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCHES] radeon kms pm patches

2010-03-14 Thread Alex Deucher
This weekend I finally got some time to sit down with kms pm, and I
created a new patch set (against drm-radeon-testing).  For those that
want to play with the i2c stuff for thermal chips, you'll probably
grab my recent i2c patches as well.  You can grab my latest pm patches
here:
http://people.freedesktop.org/~agd5f/pm2/

So far I haven't seen any corruption when changing power modes.

What the patches do:
- implement gui idle irq support
- only change clocks when the engine is idle
- add support for turning down the number of active simds in lower
power modes (r6xx+)
- add a pm_fini function
- move set/get power state logic into asic specific callbacks.
Different strategies for handling
different power tables formats.

Things left to do:
- reset clocks to default on module unload (in pm_fini function)
- add request module support for hwmon i2c thermal chip drivers
- add hwmon support for internal thermal/fan support used on some
r6xx/r7xx boards
- add more robust power state selection
- tie power state selection into external events (manual power mode
selection, AC/DC state, etc.)
- hook up memory reclocking
- hook up pcie lane setting
- hook up voltage setting

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCHES] more radeon drm kms hw i2c fixes

2010-03-12 Thread Alex Deucher
This patch series gets hw i2c working on my r1xx card and should fix
the hw i2c issues some others have run into on some r2xx and r3xx
cards.

Alex


0001-drm-radeon-kms-fix-for-hw-i2c.patch
Description: application/mbox


0002-drm-radeon-kms-fix-i2c-prescale-calc-on-older-radeo.patch
Description: application/mbox


0003-drm-radeon-kms-r1xx-enable-hw-i2c.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Linux-fbdev-devel] drm_fb_helper: Impossible to change video mode

2010-03-11 Thread Alex Deucher
2010/3/11 Michel Dänzer mic...@daenzer.net:
 On Wed, 2010-03-10 at 13:10 -0500, Alex Deucher wrote:
 On Wed, Mar 10, 2010 at 1:05 PM, Alex Deucher alexdeuc...@gmail.com wrote:
  On Wed, Mar 10, 2010 at 12:42 PM, James Simmons jsimm...@infradead.org 
  wrote:
 
  See my other post about what fbdev really means in its historical
  context. The struct fb_info really maps better to drm_crtc than to
  drm_framebuffer. In fact take the case of the matrox fbdev driver. It
  creates two framebuffer devices even tho it used one static framebuffer.
  What the driver does is splits the framebuffer in two and assigned each
  part to a CRTC.
 
  The only problem with that is that it eats a lot of memory for the
  console which limits X when it starts. On cards with limited vram ,
  you might not have enough memory left for any meaningful acceleration
  when X starts.

 It would be nice to find a way to reclaim the console memory for X,
 but I'm not sure that can be done and still provide a good way to
 provide oops support.

 What do you think the average user will care about more?

      * Seeing kernel oops/panic output about once in a lifetime.
      * Being able to start/use X in the first place and enabling it to
        use all of VRAM.

 Personally, I've never even seen any kernel oops/panic output despite
 numerous opportunities for that in the couple of months I've been using
 KMS. But I have spent considerable time and effort trying to get rid of
 the pinned fbcon BO. If the oops/panic output is the only thing
 preventing that, maybe that should only be enabled via some module
 option for developers.

I'm all for it!

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH 00/14] cleanup radeon_asic.h

2010-03-11 Thread Alex Deucher
On Thu, Mar 11, 2010 at 8:06 AM, Daniel Vetter daniel.vet...@ffwll.ch wrote:
 Hi all,

 This patch pile moves the static struct radeon_asic asic definitions
 form radeon_asic.h into the asic-specific files, where I think they belong.
 This way radeon_asic.h becomes a real header file that can be #included.
 And indeed, with all the copypasting of function declarations, one has
 gotten out of sync.

 The next step would be to collect asic specific declarations in
 radeon_asic.h - atm they are somewhat scattered. But this can easily be
 done on the go and has way too much potential for conflicts with other
 patches. So I didn't do this.

 Tested on my rv570.

 Comments higly welcome.


I like keeping all the asic definitions in one file as you tend to
need to update them all at one time and having them spread across all
the asic files increases the likelihood of one or more of them getting
missed.  But I can live with it if other folks think it's a good idea.

Alex

 Yours, Daniel

 Daniel Vetter (14):
  drm/radoen: move r100 asic struct to r100.c
  drm/radoen: move r200 asic struct to r200.c
  drm/radeon: move r300 asic structs to r300.c
  drm/radeon: move r420 asic struct to r420.c
  drm/radoen: move rs400 asic struct to rs400.c
  drm/radoen: move rs600 asic struct to rs600.c
  drm/radoen: move rs690 asic struct to rs690.c
  drm/radoen: move rv515 asic struct to rv515.c
  drm/radoen: move r520 asic struct to r520.c
  drm/radoen: move r600 asic struct to r600.c
  drm/radoen: move rv770 asic struct to rv770.c
  drm/radoen: move evergreen asic struct to evergreen.c
  drm/radoen: unconfuse return value of radeon_asic-clear_surface_reg

This one should be applied.

  drm/radeon: include radeon_asic.h in asic.c

  drivers/gpu/drm/radeon/evergreen.c   |   39 +++-
  drivers/gpu/drm/radeon/r100.c        |   39 +++
  drivers/gpu/drm/radeon/r200.c        |   38 +++
  drivers/gpu/drm/radeon/r300.c        |   76 ++
  drivers/gpu/drm/radeon/r420.c        |   39 +++
  drivers/gpu/drm/radeon/r520.c        |   39 +++
  drivers/gpu/drm/radeon/r600.c        |   43 +++-
  drivers/gpu/drm/radeon/radeon.h      |    3 +-
  drivers/gpu/drm/radeon/radeon_asic.h |  494 
 ++
  drivers/gpu/drm/radeon/rs400.c       |   39 +++
  drivers/gpu/drm/radeon/rs600.c       |   43 +++-
  drivers/gpu/drm/radeon/rs690.c       |   39 +++
  drivers/gpu/drm/radeon/rv515.c       |   41 +++-
  drivers/gpu/drm/radeon/rv770.c       |   42 +++-
  14 files changed, 518 insertions(+), 496 deletions(-)


 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 --
 ___
 Dri-devel mailing list
 Dri-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/dri-devel


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH 00/14] cleanup radeon_asic.h

2010-03-11 Thread Alex Deucher
2010/3/11 Jerome Glisse gli...@freedesktop.org:
 On Thu, Mar 11, 2010 at 05:24:22PM +0100, Rafał Miłecki wrote:
 2010/3/11 Alex Deucher alexdeuc...@gmail.com:
  I like keeping all the asic definitions in one file as you tend to
  need to update them all at one time and having them spread across all
  the asic files increases the likelihood of one or more of them getting
  missed.  But I can live with it if other folks think it's a good idea.

 Same here. One file means easier editing. Maybe we could use some
 other of proposed tricks?

 --
 Rafał

 I don't have strong feeling but Alex has a point, right now we often
 update them, maybe we should add radeon_asic.c and move asic init
 (function now in radeon_device.c) along structure there.

That seems like a good plan.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCHES] radeon drm kms i2c fixes

2010-03-11 Thread Alex Deucher
On Thu, Mar 11, 2010 at 1:00 PM, Jean Delvare kh...@linux-fr.org wrote:
 Hi Alex,

 On Wed, 10 Mar 2010 19:09:08 -0500, Alex Deucher wrote:
 Thanks to Jean for helping me with the i2c stuff.  I've attached
 Jean's bit algo patch as my radeon patch depends on it.  I'm not sure
 how we want to get that one upstream (either via drm or i2c).

 i2c tree probably. I think I can push it to Linus quickly, it's a small
 one, can't cause a regression, and rc2 isn't out yet.


Excellent.  thanks.

 Previously, the radeon drm registered i2c buses using the radeon algo
 which would use either the hw i2c engine or bit banging depending on
 the bus in question (some are hw capable, others are not, some chips
 don't have support for their hw engines yet, etc.).  The tricky part
 was that the radeon i2c bit buses require some gpio magic before and
 after a transaction which bit algo didn't previously support.
 Unfortunately, it exposed the internal bit algo bus as well we as the
 radeon algo bus which is bad.  With these patches, if the hw engine is
 supported, we use the radeon algo, if not, we use bit algo directly
 with the pre/post_xfer functions to fix up the gpios.

 Looks good. I have one suggestion of possible improvement for the
 future. You could turn rec-hw_capable into a function pointer,
 pointing to the appropriate r*_hw_i2c_xfer() function. This would be
 more efficient that looking up the right function each time
 radeon_hw_i2c_xfer() is called. This would also avoid checking the chip
 model at registration time, to decide between hardware and software
 implementation, as these tests could easily go out of sync with what
 is actually implemented, when you add support for newer chips.


I was actually thinking of doing something similar.  Adding a
hw_i2c_xfer callback to the radeon asic struct and checking that.  I
just haven't gotten around to it yet.

 I've tested on several radeons, but more tested would be nice.

 I have the following in my machine:
 02:00.0 VGA compatible controller: ATI Technologies Inc RV280 [Radeon 9200] 
 (rev 01)
 02:00.1 Display controller: ATI Technologies Inc RV280 [Radeon 9200] 
 (Secondary) (rev 01)

 Can I help with testing? I can follow your instructions.

Sure.  You need a kms-enabled graphics stack.  See this for more:
http://wiki.x.org/wiki/radeonBuildHowTo
Then, make sure you have the latest kernel bits and the patches I
posted.  Note that some users have reported problems with the hw i2c
engine on some r1xx-r3xx boards.  I suspect a problematic prescale or
a drive problem.  If you run into issues, please try the patch I
attached to this bug:
http://bugs.freedesktop.org/show_bug.cgi?id=26430

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Linux-fbdev-devel] drm_fb_helper: Impossible to change video mode

2010-03-10 Thread Alex Deucher
On Wed, Mar 10, 2010 at 12:42 PM, James Simmons jsimm...@infradead.org wrote:

  At the moment the problem with fbset is what to do with it in the
  dual head case. Currently we create an fb console that is lowest
  common size of the two heads and set native modes on both,
 
  Does that mean that fbset is supposed to work (set resolution) on drmfb?

 No we've never hooked it up but it could be made work.

 I had it to the point of almost working. I plan on working on getting it
 working again.

  Schemes which would make a multihead setup look like a single screen
  get complicated quite easily. Perhaps an option to turn off some
  outputs so that the native resolution of one output is used (instead
  of clone) would work.
 

 I've only really got two answer for this:

 (a) hook up another /dev/dri/card_fb device and use the current KMS
 ioctls to control the framebuffer, have the drm callback into fbdev/fbcon
 to mention resizes etc. Or add one or two info gathering ioctls and
 allow use of the /dev/dri/control device to control stuff.

 (b) add a lot of ioctls to KMS fbdev device, which implement some sort
 of sane multi-output settings.

 Now the second sounds like a lot of work if not the correct solution,
 you basically needs a way to pretty much expose what the KMS ioctls
 expose on the fb device, and then upgrade fbset to make sense of it all.

 Yuck. See my other post about what fbdev really means in its historical
 context. The struct fb_info really maps better to drm_crtc than to
 drm_framebuffer. In fact take the case of the matrox fbdev driver. It
 creates two framebuffer devices even tho it used one static framebuffer.
 What the driver does is splits the framebuffer in two and assigned each
 part to a CRTC.

The only problem with that is that it eats a lot of memory for the
console which limits X when it starts. On cards with limited vram ,
you might not have enough memory left for any meaningful acceleration
when X starts.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Linux-fbdev-devel] drm_fb_helper: Impossible to change video mode

2010-03-10 Thread Alex Deucher
On Wed, Mar 10, 2010 at 1:05 PM, Alex Deucher alexdeuc...@gmail.com wrote:
 On Wed, Mar 10, 2010 at 12:42 PM, James Simmons jsimm...@infradead.org 
 wrote:

  At the moment the problem with fbset is what to do with it in the
  dual head case. Currently we create an fb console that is lowest
  common size of the two heads and set native modes on both,
 
  Does that mean that fbset is supposed to work (set resolution) on drmfb?

 No we've never hooked it up but it could be made work.

 I had it to the point of almost working. I plan on working on getting it
 working again.

  Schemes which would make a multihead setup look like a single screen
  get complicated quite easily. Perhaps an option to turn off some
  outputs so that the native resolution of one output is used (instead
  of clone) would work.
 

 I've only really got two answer for this:

 (a) hook up another /dev/dri/card_fb device and use the current KMS
 ioctls to control the framebuffer, have the drm callback into fbdev/fbcon
 to mention resizes etc. Or add one or two info gathering ioctls and
 allow use of the /dev/dri/control device to control stuff.

 (b) add a lot of ioctls to KMS fbdev device, which implement some sort
 of sane multi-output settings.

 Now the second sounds like a lot of work if not the correct solution,
 you basically needs a way to pretty much expose what the KMS ioctls
 expose on the fb device, and then upgrade fbset to make sense of it all.

 Yuck. See my other post about what fbdev really means in its historical
 context. The struct fb_info really maps better to drm_crtc than to
 drm_framebuffer. In fact take the case of the matrox fbdev driver. It
 creates two framebuffer devices even tho it used one static framebuffer.
 What the driver does is splits the framebuffer in two and assigned each
 part to a CRTC.

 The only problem with that is that it eats a lot of memory for the
 console which limits X when it starts. On cards with limited vram ,
 you might not have enough memory left for any meaningful acceleration
 when X starts.

It would be nice to find a way to reclaim the console memory for X,
but I'm not sure that can be done and still provide a good way to
provide oops support.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Linux-fbdev-devel] drm_fb_helper: Impossible to change video mode

2010-03-10 Thread Alex Deucher
On Wed, Mar 10, 2010 at 1:47 PM, James Simmons jsimm...@infradead.org wrote:

  Yuck. See my other post about what fbdev really means in its historical
  context. The struct fb_info really maps better to drm_crtc than to
  drm_framebuffer. In fact take the case of the matrox fbdev driver. It
  creates two framebuffer devices even tho it used one static framebuffer.
  What the driver does is splits the framebuffer in two and assigned each
  part to a CRTC.
 
  The only problem with that is that it eats a lot of memory for the
  console which limits X when it starts. On cards with limited vram ,
  you might not have enough memory left for any meaningful acceleration
  when X starts.

 It would be nice to find a way to reclaim the console memory for X,
 but I'm not sure that can be done and still provide a good way to
 provide oops support.

        Ah, the power of flags. We had the same issue with user requesting a 
 mode
 change or fbcon asking for a different mode. We handled it with the flag
 FBINFO_MISC_USEREVENT. Since you are using KMS as the backend for fbcon you 
 will
 have to deal also with the ability to change the resolution with tools like 
 stty.
 I can easily see how to do this plus give you more memory like you want :-)
        For the oops are you talking about printing oops to the screen
 while X is running ? Otherwise if you experience a oops and go back to
 console mode you should be able to view it. The console text buffer is
 independent of the graphics card memory system.


Right now we keep the console buffer pinned in vram and we switch to
it when there is an oops or when you switch VTs.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms: fix pal tv-out support on legacy IGP chips

2010-03-10 Thread Alex Deucher
From b2757f48c0c45ff08934d125b913777b8adaee0b Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Wed, 10 Mar 2010 18:33:03 -0500
Subject: [PATCH] drm/radeon/kms: fix pal tv-out support on legacy IGP chips

Based on ddx patch by Andrzej Hajda.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_legacy_tv.c |   29 -
 1 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_legacy_tv.c
b/drivers/gpu/drm/radeon/radeon_legacy_tv.c
index fdce15b..0320403 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_tv.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_tv.c
@@ -57,6 +57,10 @@
 #define NTSC_TV_PLL_N_14 693
 #define NTSC_TV_PLL_P_14 7

+#define PAL_TV_PLL_M_14 19
+#define PAL_TV_PLL_N_14 353
+#define PAL_TV_PLL_P_14 5
+
 #define VERT_LEAD_IN_LINES 2
 #define FRAC_BITS 0xe
 #define FRAC_MASK 0x3fff
@@ -205,9 +209,24 @@ static const struct radeon_tv_mode_constants
available_tv_modes[] = {
630627, /* defRestart */
347,/* crtcPLL_N */
14, /* crtcPLL_M */
-   8,  /* crtcPLL_postDiv */
+   8,  /* crtcPLL_postDiv */
1022,   /* pixToTV */
},
+   { /* PAL timing for 14 Mhz ref clk */
+   800,/* horResolution */
+   600,/* verResolution */
+   TV_STD_PAL, /* standard */
+   1131,   /* horTotal */
+   742,/* verTotal */
+   813,/* horStart */
+   840,/* horSyncStart */
+   633,/* verSyncStart */
+   708369, /* defRestart */
+   211,/* crtcPLL_N */
+   9,  /* crtcPLL_M */
+   8,  /* crtcPLL_postDiv */
+   759,/* pixToTV */
+   },
 };

 #define N_AVAILABLE_MODES ARRAY_SIZE(available_tv_modes)
@@ -242,7 +261,7 @@ static const struct radeon_tv_mode_constants
*radeon_legacy_tv_get_std_mode(stru
if (pll-reference_freq == 2700)
const_ptr = available_tv_modes[1];
else
-   const_ptr = available_tv_modes[1]; /* FIX ME */
+   const_ptr = available_tv_modes[3];
}
return const_ptr;
 }
@@ -685,9 +704,9 @@ void radeon_legacy_tv_mode_set(struct drm_encoder *encoder,
n = PAL_TV_PLL_N_27;
p = PAL_TV_PLL_P_27;
} else {
-   m = PAL_TV_PLL_M_27;
-   n = PAL_TV_PLL_N_27;
-   p = PAL_TV_PLL_P_27;
+   m = PAL_TV_PLL_M_14;
+   n = PAL_TV_PLL_N_14;
+   p = PAL_TV_PLL_P_14;
}
}

-- 
1.5.6.3


0001-drm-radeon-kms-fix-pal-tv-out-support-on-legacy-IGP.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms: further spread spectrum fixes

2010-03-09 Thread Alex Deucher
From ae937bceef62997a63140abb5208d33f3b6ac13c Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Mon, 8 Mar 2010 17:10:41 -0500
Subject: [PATCH] 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 alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/atombios_crtc.c   |8 +---
 drivers/gpu/drm/radeon/radeon_encoders.c |   25 +++--
 2 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c
b/drivers/gpu/drm/radeon/atombios_crtc.c
index a8cd637..7c30e2e 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -1127,9 +1127,6 @@ int atombios_crtc_mode_set(struct drm_crtc *crtc,

/* TODO color tiling */

-   /* pick pll */
-   radeon_crtc-pll_id = radeon_atom_pick_pll(crtc);
-
atombios_disable_ss(crtc);
/* always set DCPLL */
if (ASIC_IS_DCE4(rdev))
@@ -1164,6 +1161,11 @@ static bool atombios_crtc_mode_fixup(struct
drm_crtc *crtc,

 static void atombios_crtc_prepare(struct drm_crtc *crtc)
 {
+   struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
+
+   /* pick pll */
+   radeon_crtc-pll_id = radeon_atom_pick_pll(crtc);
+
atombios_lock_crtc(crtc, ATOM_ENABLE);
atombios_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
 }
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c
b/drivers/gpu/drm/radeon/radeon_encoders.c
index bc926ea..4eae30c 100644
--- a/drivers/gpu/drm/radeon/radeon_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_encoders.c
@@ -1216,6 +1216,9 @@ atombios_set_encoder_crtc_source(struct
drm_encoder *encoder)
}

atom_execute_table(rdev-mode_info.atom_context, index, (uint32_t 
*)args);
+
+   /* update scratch regs with new routing */
+   radeon_atombios_encoder_crtc_scratch_regs(encoder, 
radeon_crtc-crtc_id);
 }

 static void
@@ -1326,19 +1329,9 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder,
struct drm_device *dev = encoder-dev;
struct radeon_device *rdev = dev-dev_private;
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
-   struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder-crtc);

-   if (radeon_encoder-active_device 
-   (ATOM_DEVICE_DFP_SUPPORT | ATOM_DEVICE_LCD_SUPPORT)) {
-   struct radeon_encoder_atom_dig *dig = radeon_encoder-enc_priv;
-   if (dig)
-   dig-dig_encoder = 
radeon_atom_pick_dig_encoder(encoder);
-   }
radeon_encoder-pixel_clock = adjusted_mode-clock;

-   radeon_atombios_encoder_crtc_scratch_regs(encoder, 
radeon_crtc-crtc_id);
-   atombios_set_encoder_crtc_source(encoder);
-
if (ASIC_IS_AVIVO(rdev)) {
if (radeon_encoder-active_device  (ATOM_DEVICE_CV_SUPPORT |
ATOM_DEVICE_TV_SUPPORT))
atombios_yuv_setup(encoder, true);
@@ -1492,8 +1485,20 @@ radeon_atom_dac_detect(struct drm_encoder
*encoder, struct drm_connector *connec

 static void radeon_atom_encoder_prepare(struct drm_encoder *encoder)
 {
+   struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
+
+   if (radeon_encoder-active_device 
+   (ATOM_DEVICE_DFP_SUPPORT | ATOM_DEVICE_LCD_SUPPORT)) {
+   struct radeon_encoder_atom_dig *dig = radeon_encoder-enc_priv;
+   if (dig)
+   dig-dig_encoder = 
radeon_atom_pick_dig_encoder(encoder);
+   }
+
radeon_atom_output_lock(encoder, true);
radeon_atom_encoder_dpms(encoder, DRM_MODE_DPMS_OFF);
+
+   /* this is needed for the pll/ss setup to work correctly in some cases 
*/
+   atombios_set_encoder_crtc_source(encoder);
 }

 static void radeon_atom_encoder_commit(struct drm_encoder *encoder)
-- 
1.5.6.3


0001-drm-radeon-kms-further-spread-spectrum-fixes.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms: use lcd pll limits when available

2010-03-08 Thread Alex Deucher
From f2b63dc08b5ecd96c41b806988ad7ee6cd37b4de Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Mon, 8 Mar 2010 12:55:16 -0500
Subject: [PATCH] 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 alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/atombios_crtc.c   |1 +
 drivers/gpu/drm/radeon/radeon_atombios.c |   14 +++
 drivers/gpu/drm/radeon/radeon_combios.c  |2 +
 drivers/gpu/drm/radeon/radeon_display.c  |   37 +
 drivers/gpu/drm/radeon/radeon_mode.h |3 ++
 5 files changed, 52 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c
b/drivers/gpu/drm/radeon/atombios_crtc.c
index 0c67669..a8cd637 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -525,6 +525,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
if (encoder-encoder_type == 
DRM_MODE_ENCODER_LVDS) {
struct radeon_encoder_atom_dig *dig = 
radeon_encoder-enc_priv;
pll-algo = dig-pll_algo;
+   pll-flags |= RADEON_PLL_IS_LCD;
}
} else {
if (encoder-encoder_type != 
DRM_MODE_ENCODER_DAC)
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c
b/drivers/gpu/drm/radeon/radeon_atombios.c
index 6f8619c..2860f05 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -869,6 +869,20 @@ bool radeon_atom_get_clock_info(struct drm_device *dev)
p1pll-pll_out_max =
le32_to_cpu(firmware_info-info.ulMaxPixelClockPLL_Output);

+   if (crev = 4) {
+   p1pll-lcd_pll_out_min =
+   
le16_to_cpu(firmware_info-info_14.usLcdMinPixelClockPLL_Output) * 100;
+   if (p1pll-lcd_pll_out_min == 0)
+   p1pll-lcd_pll_out_min = p1pll-pll_out_min;
+   p1pll-lcd_pll_out_max =
+   
le16_to_cpu(firmware_info-info_14.usLcdMaxPixelClockPLL_Output) * 100;
+   if (p1pll-lcd_pll_out_max == 0)
+   p1pll-lcd_pll_out_max = p1pll-pll_out_max;
+   } else {
+   p1pll-lcd_pll_out_min = p1pll-pll_out_min;
+   p1pll-lcd_pll_out_max = p1pll-pll_out_max;
+   }
+
if (p1pll-pll_out_min == 0) {
if (ASIC_IS_AVIVO(rdev))
p1pll-pll_out_min = 64800;
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c
b/drivers/gpu/drm/radeon/radeon_combios.c
index 69af81d..30a84ae 100644
--- a/drivers/gpu/drm/radeon/radeon_combios.c
+++ b/drivers/gpu/drm/radeon/radeon_combios.c
@@ -633,6 +633,8 @@ bool radeon_combios_get_clock_info(struct drm_device *dev)
p1pll-reference_div = RBIOS16(pll_info + 0x10);
p1pll-pll_out_min = RBIOS32(pll_info + 0x12);
p1pll-pll_out_max = RBIOS32(pll_info + 0x16);
+   p1pll-lcd_pll_out_min = p1pll-pll_out_min;
+   p1pll-lcd_pll_out_max = p1pll-pll_out_max;

if (rev  9) {
p1pll-pll_in_min = RBIOS32(pll_info + 0x36);
diff --git a/drivers/gpu/drm/radeon/radeon_display.c
b/drivers/gpu/drm/radeon/radeon_display.c
index e35cc3d..c604810 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -460,10 +460,19 @@ static void radeon_compute_pll_legacy(struct
radeon_pll *pll,
uint32_t best_error = 0x;
uint32_t best_vco_diff = 1;
uint32_t post_div;
+   u32 pll_out_min, pll_out_max;

DRM_DEBUG(PLL freq %llu %u %u\n, freq, pll-min_ref_div, 
pll-max_ref_div);
freq = freq * 1000;

+   if (pll-flags  RADEON_PLL_IS_LCD) {
+   pll_out_min = pll-lcd_pll_out_min;
+   pll_out_max = pll-lcd_pll_out_max;
+   } else {
+   pll_out_min = pll-pll_out_min;
+   pll_out_max = pll-pll_out_max;
+   }
+
if (pll-flags  RADEON_PLL_USE_REF_DIV)
min_ref_div = max_ref_div = pll-reference_div;
else {
@@ -527,10 +536,10 @@ static void radeon_compute_pll_legacy(struct
radeon_pll *pll,
tmp = (uint64_t)pll-reference_freq * 
feedback_div;
vco = radeon_div(tmp, ref_div);

-   if (vco  pll-pll_out_min) {
+   if (vco  pll_out_min) {
min_feed_div = feedback_div + 1;
continue

Re: savage4 crashes

2010-03-08 Thread Alex Deucher
On Mon, Mar 8, 2010 at 12:42 PM, Piotr Gluszenia Slawinski
curi...@bwv190.internetdsl.tpnet.pl wrote:
 i have dual head sa(l)vage(d) MX card.

 it works only in vesa mode, or with dri disabled.

 i am trying latest Xorg and mesa avail from gentoo ebuilds.

 also Xv doesn't work (tested with plain xawtv) - data is displayed
 not in proper window, but as many rectangles with empty holes,
 scattered over almost half of the screen (they move when one moves window)

 when one enables DRI - Xorg starts, xdm allows login, but it crashes
 in the middle of kde startup.

 i've tried changing almost all options i was able to find,
 and no help.

 EXA is not working either (Xorg starts, but there are no window
 decorations)


 peculiar thing is that not so long ago (perhaps year...)
 i've tried to use the card on exactly same computer,
 and it worked fine, including 3d.

 now only thing which differs is that
 i use fresh gentoo install.
 hopefully i've kept old gentoo on backups somewhere, so i will try to
 restore it - but bit later (today i've wasted WHOLE DAY hoping to make it
 work...)

It's likely the driver has bitrotten since no one is actively working
on it anymore.

Alex

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms: fix legacy tv-out pal mode

2010-03-06 Thread Alex Deucher
From ad6fcd83e27499e35ef4975fe0e9319f73cbb49e Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Sat, 6 Mar 2010 09:43:41 -0500
Subject: [PATCH] drm/radeon/kms: fix legacy tv-out pal mode

fixes fdo bug 26915

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_legacy_tv.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_legacy_tv.c
b/drivers/gpu/drm/radeon/radeon_legacy_tv.c
index 417684d..fdce15b 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_tv.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_tv.c
@@ -623,8 +623,8 @@ void radeon_legacy_tv_mode_set(struct drm_encoder *encoder,
}
flicker_removal = (tmp + 500) / 1000;

-   if (flicker_removal  2)
-   flicker_removal = 2;
+   if (flicker_removal  3)
+   flicker_removal = 3;
for (i = 0; i  ARRAY_SIZE(SLOPE_limit); ++i) {
if (flicker_removal == SLOPE_limit[i])
break;
-- 
1.5.6.3


0001-drm-radeon-kms-fix-legacy-tv-out-pal-mode.patch
Description: application/mbox
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


  1   2   3   4   5   6   7   8   9   10   >