18 May, 2010
40 commits
-
Will be used by nouveau driver also in the near future.
Signed-off-by: Ben Skeggs
Signed-off-by: Dave Airlie -
This seems to be relatively stable now, so enable it for these chipsets
too.Signed-off-by: Matthew Garrett
Signed-off-by: Dave Airlie -
The vblank interrupt on r600 doesn't seem to be especially reliable, so
perform some sanity checks before the actual reclock.Signed-off-by: Matthew Garrett
Signed-off-by: Dave Airlie -
The ttm code could take vram_mutex followed by cp_mutex, while the
reclocking code would do the reverse. Hilarity could ensue.Signed-off-by: Matthew Garrett
Signed-off-by: Dave Airlie -
We need to choose the correct PM state to transition into before starting
the actual change. Call radeon_get_power_state() at the top of the clock
setting to do so.Signed-off-by: Matthew Garrett
Signed-off-by: Dave Airlie -
With luck, dynamic memory reclocking on r600 should be stable with
the previous patches. Enable it.Signed-off-by: Matthew Garrett
Signed-off-by: Dave Airlie -
The ttm bo workqueue may touch objects while we're reclocking, so make
sure it's blocked until we're done.Signed-off-by: Matthew Garrett
Signed-off-by: Dave Airlie -
We want to be able to prevent the delayed workqueue from changing state
while we're reclocking, so add an API to block and unblock it.Signed-off-by: Matthew Garrett
Signed-off-by: Dave Airlie -
We need to block the drm core from doing anything that may touch our vram
during reclock, so take the drm mutex for the duration.Signed-off-by: Matthew Garrett
Signed-off-by: Dave Airlie -
Touching vram while the card is reclocking can lead to lockups. Unmap
any pages that could be touched by the CPU and block any accesses to
vram until the reclocking is complete.Signed-off-by: Matthew Garrett
Signed-off-by: Dave Airlie -
There's a moderate amount of effort involved in setting the card up for
clock transitions, so unify the codepaths to make it easier to implement.Signed-off-by: Matthew Garrett
Signed-off-by: Dave Airlie -
Add two new sysfs attributes:
- dynpm
- power_stateEchoing 0/1 to dynpm disables/enables dynamic power management.
The driver scales the sclk dynamically based on the number of
queued fences. dynpm only scales sclk dynamically in single head
mode.Echoing x.y to power_state selects a static power state (x) and clock
mode (y). This allows you to statically select a power state and clock
mode. Selecting a static clock mode will disable dynpm.Signed-off-by: Alex Deucher
Signed-off-by: Dave Airlie -
- pm_misc() - handles voltage, pcie lanes, and other non
clock related power mode settings. Currently disabled.
Needs further debugging- pm_prepare() - disables crtc mem requests right now.
All memory clients need to be disabled when changing
memory clocks. This function can be expanded to include
disabling fb access as well.- pm_finish() - enable active memory clients.
Signed-off-by: Alex Deucher
Signed-off-by: Dave Airlie -
Signed-off-by: Alex Deucher
Signed-off-by: Dave Airlie -
- remove non_clock_info struct
- track power state misc flagsSigned-off-by: Alex Deucher
Signed-off-by: Dave Airlie -
Signed-off-by: Alex Deucher
Signed-off-by: Dave Airlie -
Just adds overhead when the power state will never change.
Signed-off-by: Alex Deucher
Signed-off-by: Dave Airlie -
Hook the atom table parsing up to module loading, so we can automatically
load the appropriate hwmon drivers.Based on initial patch for r6xx from Matthew Garrett
Signed-off-by: Alex Deucher
Signed-off-by: Dave Airlie -
Signed-off-by: Alex Deucher
Signed-off-by: Dave Airlie -
This also simplifies the code and enables reclocking with multiple heads
active by tracking whether the power states are single or multi-head
capable.Eventually, we will want to select a power state based on external
factors (AC/DC state, user selection, etc.).(v2) Update for evergreen
Signed-off-by: Alex Deucher
Signed-off-by: Dave Airlie -
(v2) Add evergreen vbl checks
Signed-off-by: Alex Deucher
Signed-off-by: Dave Airlie -
crtcs are what we ultimately care about wrt to pm.
Signed-off-by: Alex Deucher
Signed-off-by: Dave Airlie -
Signed-off-by: Alex Deucher
Signed-off-by: Dave Airlie -
On pre-r6xx, the power mode array is usually ordered:
low
...
high
defaultOn r6xx+:
default
low
...
highSigned-off-by: Alex Deucher
Signed-off-by: Dave Airlie -
set proper wait condition as noted by Rafał Miłecki.
Signed-off-by: Alex Deucher
Signed-off-by: Dave Airlie -
Useful for certain power management operations. You
need to wait for the GUI engine (2D, 3D, CP, etc.) to be
idle before changing clocks or adjusting engine parameters.(v2) Fix gui idle enable on pre-r6xx asics
(v3) The gui idle interrrupt status bit is permanently asserted
on pre-r6xx chips, but the interrrupt is still generated.
workaround it in the driver.(v4) Add support for evergreen
Signed-off-by: Alex Deucher
Signed-off-by: Dave Airlie -
Check to see if the GUI engine and related blocks
(2D, 3D, CP, etc) are idle or not. There are a number
of cases when we need to know if the drawing engine
is busy.Signed-off-by: Alex Deucher
Signed-off-by: Dave Airlie -
Simple cloning rules compared to server:
(a) single crtc
(b) > 1 connector active
(c) check command line mode
(d) try and find 1024x768 DMT mode if no command line.
(e) fail to cloneSigned-off-by: Dave Airlie
-
After thinking it over a lot it made more sense for the core to deal with
the output polling especially so it can notify X.v2: drop plans for fake connector - per Michel's comments - fix X patch sent to xorg-devel, add intel polled/hpd setting, add initial nouveau polled/hpd settings.
v3: add config lock take inside polling, add intel/nouveau poll init/fini calls
v4: config lock was a bit agressive, only needed around connector list reading.
otherwise it could re-enter.glisse: discard drm_helper_hpd_irq_event
v3: Reviewed-by: Michel Dänzer
Signed-off-by: Dave Airlie -
m == num_est3_modes is one past the end of the est3_modes[].
Signed-off-by: Dan Carpenter
Reviewed-by: Adam Jackson
Signed-off-by: Dave Airlie -
let vga16fb claim 0xA0000+0x10000 region as its aperture;
drm drivers don't use it, so we have to detect it and kick
vga16fb manually - but only if drm is driving the primary cardSigned-off-by: Marcin Slusarz
Cc: James Simmons
Cc: Dave Airlie
Cc: Ben Skeggs
Signed-off-by: Dave Airlie -
Currently vesafb/efifb/... is kicked when hardware driver is registering
framebuffer. To do it hardware must be fully functional, so there's a short
window between start of initialisation and framebuffer registration when
two drivers touch the hardware. Unfortunately sometimes it breaks nouveau
initialisation.Fix it by kicking firmware driver(s) before we start touching the hardware.
Reported-by: Didier Spaier
Tested-by: Didier Spaier
Signed-off-by: Marcin Slusarz
Cc: Ben Skeggs
Cc: Peter Jones
Cc: Andrew Morton
Signed-off-by: Dave Airlie -
It removes a hack from nouveau code which had to detect which
region to pass to kick vesafb/efifb.Signed-off-by: Marcin Slusarz
Cc: Eric Anholt
Cc: Ben Skeggs
Cc: Thomas Hellstrom
Cc: Dave Airlie
Cc: Peter Jones
Cc: Benjamin Herrenschmidt
Signed-off-by: Dave Airlie -
Recently I've studied my system dmesg and seen this:
1 [ 0.478416] ACPI: Battery Slot [C1B4] (battery present)
2 [ 0.478648] ACPI: Battery Slot [C1B3] (battery absent)
3 [ 0.906678] [drm] initialized overlay support
4 [ 1.762304] Console: switching to colour frame buffer device 128x48
5 [ 1.765211] fb0: inteldrmfb frame buffer device
6 [ 1.765242] registered panic notifier
7 [ 1.765272] [drm] Initialized i915 1.6.0 20080730 for 0000:00:02.0 on minor 0
8 [ 1.765372] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
and it was not evident who registered that panic notifier on line 6.
I'd bought it as some low-level stuff needed by kernel itself, but the
time was inappropriate -- too late for such things.So I had to study sources to see it was drm who was registering
switch-to-fb on panic.Let's avoid possible confusion and mark this message as going from drm
subsystem.(I'm a bit unsure whether to use '[drm]:' or 'drm:' -- the rest of the
kernel just uses 'topic:', and even in drm_fb_helper.c we use 'fb%d:'
without [] brackets. Either way is ok with me.)Signed-off-by: Kirill Smelkov
Signed-off-by: Dave Airlie -
Userspace need to know the hw crtc id (0, 1, 2, ...) from the drm
crtc id. Bump the minor version so userspace can enable conditionaly
features depend on this.V2 use num_crtc and avoid DRM_ERROR
Signed-off-by: Jerome Glisse
Signed-off-by: Dave Airlie -
Having hsync both start and end on pixel 1072 ain't gonna work very
well. Matches the X server's list.Signed-off-by: Adam Jackson
Tested-By: Michael Tokarev
Cc: stable@kernel.org
Signed-off-by: Dave Airlie -
Use kzalloc rather than the combination of kmalloc and memset.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)//
@@
expression x,size,flags;
statement S;
@@-x = kmalloc(size,flags);
+x = kzalloc(size,flags);
if (x == NULL) S
-memset(x, 0, size);
//Signed-off-by: Julia Lawall
Reviewed-by: Corbin Simpson
Reviewed-by: Matt Turner
Signed-off-by: Dave Airlie -
Smatch complained that we initialize 6 elements in add_detailed_modes()
but the timings[] array is declared with 5 elements. Adam Jackson
verified that 6 is the correct number of timings.On Mon, May 10, 2010 at 12:08:24PM -0400, Adam Jackson wrote:
> > > struct std_timing timings[5];
> > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> This decl is wrong, should be 6. From the 1.4 spec:
>
> "Six additional Standard Timings may be listed as a display descriptor
> (tag #FAh)."
>
> The 1.3 spec is a little less explicit about it, but does show 6
> standard timing codes in the 0xFA detailed subblock, terminated by 0x0A
> in the 18th byte. I don't have the docs for 1.2 or earlier, but we're
> paranoid enough about not adding broken timings that we should be fine.This patch is basically a clean up, because timings[] is declared inside
a union and increasing the number of elements here doesn't change the
overall size of the union.Signed-off-by: Dan Carpenter
Signed-off-by: Dave Airlie -
Use kmemdup when some other buffer is immediately copied into the
allocated region.A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)//
@@
expression from,to,size,flag;
statement S;
@@- to = \(kmalloc\|kzalloc\)(size,flag);
+ to = kmemdup(from,size,flag);
if (to==NULL || ...) S
- memcpy(to, from, size);
//Signed-off-by: Julia Lawall
Signed-off-by: Dave Airlie -
Fix typos in vga/Kconfig file
and use GPU (upper case) consistently.Signed-off-by: Randy Dunlap
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Dave Airlie