summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2010-05-18radeon: Take drm struct_mutex over reclockingMatthew Garrett
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 <mjg@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18radeon: Unmap vram pages when reclockingMatthew Garrett
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 <mjg@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18radeon: Unify PM entry pathsMatthew Garrett
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 <mjg@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/radeon/kms/pm: rework power managementAlex Deucher
Add two new sysfs attributes: - dynpm - power_state Echoing 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 <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/radeon/kms/pm: add additional asic callbacksAlex Deucher
- 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 <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/radeon/kms/pm: restore default power state on exitAlex Deucher
Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/radeon/kms: minor pm cleanupsAlex Deucher
- remove non_clock_info struct - track power state misc flags Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/radeon/kms/pm: clean power state printingAlex Deucher
Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/radeon/kms/pm: don't enable pm if there is only on power stateAlex Deucher
Just adds overhead when the power state will never change. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/radeon/kms/atom: load hwmon driversAlex Deucher
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 <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/radeon/kms/pm: update display watermarks with power state changesAlex Deucher
Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/radeon/kms/pm: add asic specific callbacks for getting power state (v2)Alex Deucher
This also simplifies the code and enables reclocking with multiple heads active by tracking whether the power states are single or multi-head capable. Eventually, we will want to select a power state based on external factors (AC/DC state, user selection, etc.). (v2) Update for evergreen Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/radeon/kms/pm: add asic specific callbacks for setting power state (v2)Alex Deucher
(v2) Add evergreen vbl checks Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/radeon/kms/pm: move pm state update to crtc functionsAlex Deucher
crtcs are what we ultimately care about wrt to pm. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/radeon/kms/pm: interate across crtcs for vblankAlex Deucher
Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/radeon/kms/atom/pm: rework power mode parsingAlex Deucher
On pre-r6xx, the power mode array is usually ordered: low ... high default On r6xx+: default low ... high Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/radeon/kms: wait for gpu idle before changing power modeAlex Deucher
set proper wait condition as noted by Rafał Miłecki. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/radeon/kms: add support for gui idle interrupts (v4)Alex Deucher
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 <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/radeon/kms: add gui_idle callbackAlex Deucher
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 <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/fbdev: fix cloning on fbconDave 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 clone Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/fbdev: rework output polling to be back in the core. (v4)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 <michel@daenzer.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm: off by one in drm_edid.cDan Carpenter
m == num_est3_modes is one past the end of the est3_modes[]. Signed-off-by: Dan Carpenter <error27@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18vga16fb, drm: vga16fb->drm handoffMarcin Slusarz
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 card Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Cc: James Simmons <jsimmons@infradead.org> Cc: Dave Airlie <airlied@redhat.com> Cc: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18fbmem, drm/nouveau: kick firmware framebuffers as soon as possibleMarcin Slusarz
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 <didier.spaier@epsm.fr> Tested-by: Didier Spaier <didier.spaier@epsm.fr> Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Peter Jones <pjones@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18fbdev: allow passing more than one aperture for handoffMarcin Slusarz
It removes a hack from nouveau code which had to detect which region to pass to kick vesafb/efifb. Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Cc: Eric Anholt <eric@anholt.net> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Thomas Hellstrom <thellstrom@vmware.com> Cc: Dave Airlie <airlied@redhat.com> Cc: Peter Jones <pjones@redhat.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm: Prefix info printk about registering panic notifier with 'drm'Kirill Smelkov
Recently I've studied my system dmesg and seen this: <lots of stuff before> 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 <lots of stuff after> 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 <kirr@landau.phys.spbu.ru> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/radeon/kms: add query for crtc hw id from crtc id to get info V2Jerome Glisse
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 <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/edid: Fix 1024x768@85HzAdam Jackson
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 <ajax@redhat.com> Tested-By: Michael Tokarev <mjt@tls.msk.ru> Cc: stable@kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drivers/gpu/drm: Use kzallocJulia Lawall
Use kzalloc rather than the combination of kmalloc and memset. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,size,flags; statement S; @@ -x = kmalloc(size,flags); +x = kzalloc(size,flags); if (x == NULL) S -memset(x, 0, size); // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm_edid: There should be 6 Standard TimingsDan Carpenter
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 <error27@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drivers/gpu/drm: Use kmemdupJulia Lawall
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/) // <smpl> @@ 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); // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18vga: fix kconfig text typosRandy Dunlap
Fix typos in vga/Kconfig file and use GPU (upper case) consistently. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/edid: remove an unneeded variableDan Carpenter
We don't use timing_level any more after: 9cf00977da0 "drm/edid: Unify detailed block parsing between base and extension blocks". Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/radeon/kms/combios: match lvds panel info parsing to ddxAlex Deucher
Should work better on some panels. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18drm/radeon/kms/atom: fix typo in LVDS panel info parsingAlex Deucher
Fixes LVDS issues on some laptops; notably laptops with 2048x1536 panels. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Cc: stable@kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-11drm/radeon/kms: fix copy pasto in disable encoders patchAlex Deucher
Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-08drm/radeon/kms/atom: disable the encoders in encoder_disableAlex Deucher
Previously we just set them to dpms off. This should save additional power. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-07drm/ttm: fix, avoid iomapping system memoryJerome Glisse
If the memory is not iomem we should not try to ioremap it. Should fix : https://bugs.freedesktop.org/show_bug.cgi?id=27822 Signed-off-by: Jerome Glisse <jglisse@redhat.com> Tested-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-27drm/radeon/kms: R3XX-R4XX fix GPU reset codeJerome Glisse
Previous reset code leaded to computer hard lockup (need to unplug the power too reboot the computer) on various configuration. This patch change the reset code to avoid hard lockup. The GPU reset is failing most of the time but at least user can log in remotely or properly shutdown the computer. Two issues were leading to hard lockup : - Writting to the scratch register lead to hard lockup most likely because the write back mecanism is in fuzy state after GPU lockup. - Resetting the GPU memory controller and not reinitializing it after leaded to hard lockup. We did only reinitialize in case of successfull reset thus unsuccessfull reset quickly leaded to hard lockup. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-23drm/radeon/kms: HDMI irq supportChristian Koenig
Implements irq support for HDMI audio output. Now the polling timer is only enabled if irq support isn't available. Signed-off-by: Christian König <deathsimple@vodafone.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-23drm/radeon/kms: rework audio polling timerChristian König
Rework HDMI audio polling timer, only enable it when at least one HDMI encoder needs it. Preparation for replacing it with irq support. Signed-off-by: Christian König <deathsimple@vodafone.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-23agp: use scratch page on memory remove and at GATT creation V4Jerome Glisse
Convert most AGP chipset to use scratch page as default entries. This help avoiding GPU querying 0 address and trigger computer fault. With KMS and memory manager we bind/unbind AGP memory constantly and it seems that some GPU are still doing AGP traffic even after GPU report being idle with the memory segment. Tested (radeon GPU KMS + Xorg + compiz + glxgears + quake3) on : - SIS 1039:0001 & 1039:0003 - Intel 865 8086:2571 Compile tested for other bridges V2 enable scratch page on uninorth V3 fix unbound check in uninorth insert memory (Michel Dänzer) V4 rebase on top of drm-next branch with the lastest intel AGP changeset (stable should use version V3 of the patch) Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-21drm: add initial DRM developer documentationJesse Barnes
Add a DRM DocBook providing basic information about DRM interfaces, including TTM, GEM, KMS and vblank infrastructure. Intended to provide information to new and existing developers about how to perform driver initialization, implement mode setting and other DRM features. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-20agp/intel: put back check that we have a driver for the bridge.Dave Airlie
On my 945 laptop + radeon GPU, I was getting an oops on boot without this check which seems to have gotten dropped in the rework. Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-20Revert "drm/i915: Configure the TV sense state correctly on GM45 to make TV ↵Dave Airlie
detection reliable" Eric mentioned on irc this patch was bad, so revert it. This reverts commit fb8b5a39b6310379d7b54c0c7113703a8eaf4a57. Acked-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-20Merge branch 'drm-ttm-unmappable' into drm-core-nextDave Airlie
* drm-ttm-unmappable: drm/radeon/kms: enable use of unmappable VRAM V2 drm/ttm: remove io_ field from TTM V6 drm/vmwgfx: add support for new TTM fault callback V5 drm/nouveau/kms: add support for new TTM fault callback V5 drm/radeon/kms: add support for new fault callback V7 drm/ttm: ttm_fault callback to allow driver to handle bo placement V6 drm/ttm: split no_wait argument in 2 GPU or reserve wait Conflicts: drivers/gpu/drm/nouveau/nouveau_bo.c
2010-04-20drm/radeon/kms: enable use of unmappable VRAM V2Jerome Glisse
This patch enable the use of unmappable VRAM thanks to previous TTM infrastructure change. V2 update after io_mem_reserve/io_mem_free callback balancing Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-20drm/ttm: remove io_ field from TTM V6Jerome Glisse
All TTM driver have been converted to new io_mem_reserve/free interface which allow driver to choose and return proper io base, offset to core TTM for ioremapping if necessary. This patch remove what is now deadcode. V2 adapt to match with change in first patch of the patchset V3 update after io_mem_reserve/io_mem_free callback balancing V4 adjust to minor cleanup V5 remove the needs ioremap flag V6 keep the ioremapping facility in TTM [airlied- squashed driver removals in here also] Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-20drm/vmwgfx: add support for new TTM fault callback V5Jerome Glisse
This add the support for the new fault callback, does change anything from driver point of view. Improvement: store the aperture base in a variable so that we don't call a function to get it on each fault. Patch hasn't been tested. V2 don't derefence bo->mem.mm_node as it's not NULL only for VRAM or GTT V3 update after io_mem_reserve/io_mem_free callback balancing V4 callback has to ioremap V5 ioremap is done by TTM Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-20drm/nouveau/kms: add support for new TTM fault callback V5Jerome Glisse
This add the support for the new fault callback, does change anything from driver point of view, thought it should allow nouveau to add support for unmappable VRAM. Improvement: store the aperture base in a variable so that we don't call a function to get it on each fault. Patch hasn't been tested on any hw. V2 don't derefence bo->mem.mm_node as it's not NULL only for VRAM or GTT V3 update after io_mem_reserve/io_mem_free callback balancing V4 callback has to ioremap V5 ioremap is done by ttm Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>