aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
* drm/radeon/kms: update atombios.h to latest upstream.Alex Deucher2010-02-08
| | | | | | | | This merges ugly whitespace we want to keep for consistency along with the latest upstream changes. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: bogus cs recorder utilitiesJerome Glisse2010-02-08
| | | | | | | | | | This add an utilities function radeon_ib_bogus_add which will save an ib into a list of ib which can then be dumped using debugfs. Once dumped the ib is removed from the list. This should allow to save & capute ib for further debugging. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: use wait queue (events) for VBLANK syncRafał Miłecki2010-02-08
| | | | | | | | This already simplifies code significally and makes it maintaible in case of adding memory reclocking plus voltage changing in future. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: use udelay for short delaysDave Airlie2010-02-08
| | | | | | | For usec delays use udelay instead of scheduling, this should allow reclocking to happen faster. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: take the pm mutex when using hw i2cAlex Deucher2010-02-08
| | | | | | | | | we need a constant sclk for i2c prescale. Also, get the current sclk when calculating prescale rather than using the default sclk. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: dynclks fixesAlex Deucher2010-02-08
| | | | | | | | | | | | - only r4xx/r5xx/rs6xx/rs740 have clock gating atom table, so disable it on r6xx. it's already disabled on r7xx - check to make sure the clock_gating hook exists before calling it. This avoids a segfault on asics without that function. - remove unused static power management function. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: get_power_state early, not when processing IRQRafał Miłecki2010-02-08
| | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: use power states for dynamic reclockingAlex Deucher2010-02-08
| | | | | Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: add code to select power stateAlex Deucher2010-02-08
| | | | | | | not hooked up yet. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: add a power state type based on power state flagsAlex Deucher2010-02-08
| | | | | | | | | | The idea is to flag a power state with a certain type and use that type to decide on what state to select. On r6xx+, we select a state and then transition between clock modes in that state. On pre-r6xx, we transition between states directly. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: don't set pcie lanes for ignored power_stateRafał Miłecki2010-02-08
| | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: pull power mode info from bios tables (v3)Alex Deucher2010-02-08
| | | | | | | | | | | | | | | | | | | | | The general idea is to validate the current hw state against the set of power states and select a power state based on that. This patch just pulls the power states from the bios and prints the information. It is not currently hooked up in the actual power management code. Hooking it up will require reworking the the current power state selection code and will be handled in a future patch. Additionally, we'd need to decide on some default lower power states for cards without power tables. v2 - increment state_index after checking for default state v3 - fix typo in pm init on pre-atom cards, handle pre-atom cards without x86 bioses Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: add functions to get current pcie lanesAlex Deucher2010-02-08
| | | | | | | Currently unused. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: add dynamic engine reclocking (V9)Rafał Miłecki2010-02-08
| | | | | | | | | | | | | | V2: reorganize functions, fix modesetting calls V3: rebase patch, use radeon's workqueue V4: enable on tested chipsets only, request VBLANK IRQs V5: enable PM on older hardware (IRQs, mode_fixup, dpms) V6: use separate dynpm module parameter V7: drop RADEON_ prefix, set minimum mode for dpms off V8: update legacy encoder call, fix order in rs600 IRQ V9: update compute_clocks call in legacy, not only DPMS_OFF Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: consolidate crtc count in rdevAlex Deucher2010-02-08
| | | | | | | | | Set the number of crtcs in rdev at crtc init and use it whenever we need the crtc count rather than recalculating it everytime. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms/r600: reduce gpu cache flushingAlex Deucher2010-02-08
| | | | | | | | | | | | | | Only flush the gpu caches before we submit a fence. This leads to a small performance boost when we take the extra gpu cache flushes out of the ddx and mesa. Once this patch is in and the drm version is bumped, we can remove the flushes from the ddx and drm. Also, remove the extra cache flushes from the blit routine. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: switch all KMS driver ioctls to unlocked.Dave Airlie2010-02-08
| | | | | | Internal locking should be sufficent for all these cases. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms/atom: add a helper function to get the radeon connector privAlex Deucher2010-02-08
| | | | | | | | | This is used in a lot of places in the atom encoder code. While here fix the spelling of crtc_source_params. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms/atom: clean up spread spectrum codeAlex Deucher2010-02-08
| | | | | | | use a union for the atom args. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: add pll quirk for toshiba laptop panelAlex Deucher2010-02-08
| | | | | | | | | | The panel on the Toshiba A300-1BU laptop does not like the PLL dividers selected by the avivo pll algo, but works fine using the older method. Add a quirk to handle it. Should fix fdo bug 26358. Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
* drm/radeon/kms: rework pll algo selectionAlex Deucher2010-02-08
| | | | | | | | | | | | Rework the pll algo selection so that the pll algo in use can be selected more easily. This allows us to select different pll divider selection algos for specific monitors that work better with one algo or the other. This is needed for the next patch which adds an LVDS pll quirk for a specific notebook. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: clean up some low-hanging magic numbersAlex Deucher2010-02-08
| | | | | | | | | Switch some magic numbers to their proper defines. The register header madness needs to be cleaned up at some point. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: add support for hardcoded edids in rom (v2)Alex Deucher2010-02-08
| | | | | | | | | | | | | Some servers hardcode an edid in rom so that they will work properly with KVMs. This is a port of the relevant code from the ddx. [airlied: reworked to validate edid at boot stage - and remove special quirk, if there is a valid EDID in the BIOS rom we'll just try and use it.] Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: add workaround for rn50/rv100 serversAlex Deucher2010-02-08
| | | | | | | | | | Some servers have two VGA ports but only report one in the bios connector tables. On these systems always set up the TV DAC so that it displays properly even if the bios is wrong. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: add support for hw i2c on r1xx-r5xxAlex Deucher2010-02-08
| | | | | | | | | | | | | | | | wire hw i2c support into radeon i2c algo. fixes merged: - handle bus probing correctly - use meaningful error numbers - abort if transaction fails - The line mapping is different depending on the asic. - protect hw i2c engine with a mutex - rs300 doesn't have a pin select bit - r200 has a different pin select setup Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: add radeon i2c algoAlex Deucher2010-02-05
| | | | | | | Currently just a wrapper around bit algo Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: fix r300 vram width calculationsDave Airlie2010-02-04
| | | | | | | This was incorrect according to the docs and the UMS driver does it like this. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: rs400/480 MC setup is different than r300.Dave Airlie2010-02-04
| | | | | | | | | | Boot testing on my rs480 laptop found the MC idle never happened on startup, a quick check with AMD found the idle bit is in a different place on the rs4xx than r300. Implement a new rs400 mc idle function to fix this. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: make initial state of load detect property correct.Dave Airlie2010-02-04
| | | | | | this was incorrect on my rs480. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: disable HDMI audio for now on rv710/rv730Dave Airlie2010-02-04
| | | | | | | Support isn't correct yet and we are getting green tinges on the displays. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: don't call suspend path before cleaning up GPUJerome Glisse2010-02-04
| | | | | | | | | | | | | | In suspend path we unmap the GART table while in cleaning up path we will unbind buffer and thus try to write to unmapped GART leading to oops. In order to avoid this we don't call the suspend path in cleanup path. Cleanup path is clever enough to desactive GPU like the suspend path is doing, thus this was redondant. Tested on: RV370, R420, RV515, RV570, RV610, RV770 (all PCIE) Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drivers/gpu/drm/radeon/radeon_combios.c: fix warningAndrew Morton2010-02-04
| | | | | | | | | drivers/gpu/drm/radeon/radeon_combios.c: In function 'radeon_combios_get_lvds_info': drivers/gpu/drm/radeon/radeon_combios.c:893: warning: comparison is always false due to limited range of data type Cc: Dave Airlie <airlied@linux.ie> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* ati_pcigart: fix printk format warningRandy Dunlap2010-02-04
| | | | | | | | | | | | Fix ati_pcigart printk format warning: drivers/gpu/drm/ati_pcigart.c:115: warning: format '%Lx' expects type 'long long unsigned int', but argument 3 has type 'dma_addr_t' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Zhenyu Wang <zhenyuw@linux.intel.com> Cc: Dave Airlie <airlied@linux.ie> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/r100/kms: Emit cache flush to the end of command buffer. (v2)Pauli Nieminen2010-02-04
| | | | | | | | | | | | | | Cache flush is required in case CPU is accessing rendered data. This fixes glean/readPixSanity test case and random rendering errors in sauerbraten and warzone2100. v2 Fix comment ordering in r100_fence_ring_emit and remove extra defines added in first version. Signed-off-by: Pauli Nieminen <suokkos@gmail.com> Reviewed-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: fix regression rendering issue on R6XX/R7XXJerome Glisse2010-02-04
| | | | | | | | | | | | It seems that some R6XX/R7XX silently ignore HDP flush when programmed through ring, this patch addback an ioctl callback to allow R6XX/R7XX hw to perform such flush through MMIO in order to fix a regression. For more details see: http://bugzilla.kernel.org/show_bug.cgi?id=15186 Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: move blit initialization after we disabled VGAJerome Glisse2010-02-04
| | | | | | | | | | VGA might be overwritting VRAM and corrupt our blit shader leading to corruption, it likely won't happen if you load fbcon right after radeon. Thanks to Shawn Starr and Andre Maasikas for tracking down this issue. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: Fix oops after radeon_cs_parser_init() failure.Michel Dänzer2010-01-31
| | | | | | | | | | If radeon_cs_parser_init() fails, radeon_cs_ioctl() calls radeon_cs_parser_fini() with the non-zero error value. The latter dereferenced parser->ib which hasn't been initialized yet -> boom. Add a test for parser->ib being non-NULL before dereferencing it. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: move radeon KMS on/off switch out of staging.Dave Airlie2010-01-31
| | | | | | | | We are happy enough that the KMS driver is stable enough for enough people for the kms enable/disable to leave staging. Distros can now contemplate turning this on. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: Bailout of blit if error happen & protect with mutex V3Jerome Glisse2010-01-31
| | | | | | | | | | | | | | | | | | | | If an error happen in r600_blit_prepare_copy report it rather than WARNING and keeping execution. For instance if ib allocation failed we did just warn about but then latter tried to access NULL ib ptr causing oops. This patch also protect r600_copy_blit with a mutex as otherwise one process might overwrite blit temporary data with new one possibly leading to GPU lockup. Should partialy or totaly fix: https://bugzilla.redhat.com/show_bug.cgi?id=553279 V2 failing blit initialization is not fatal, fallback to memcpy when this happen V3 init blit before startup as we pin in startup, remove duplicate code (this one was actualy tested unlike V2) Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/vmwgfx: Don't send bad flags to the hostJakob Bornecrantz2010-01-31
| | | | | Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/vmwgfx: Request SVGA version 2 and bail if not foundPeter Hanzel2010-01-31
| | | | | | | | This fixes the driver not loading on older versions of VMware. Signed-off-by: Peter Hanzel <hanzelpeter@gmail.com> Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/vmwgfx: Correctly detect 3DJakob Bornecrantz2010-01-31
| | | | | Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/ttm: remove unnecessary save_flags and ttm_flag_masked in ttm_bo_util.cAustin Yuan2010-01-31
| | | | | | Signed-off-by: Austin Yuan <shengquan.yuan@gmail.com> Acked-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/kms: Remove incorrect comment in struct drm_mode_modeinfoMarcin Kościelnicki2010-01-31
| | | | Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/ttm: remove padding from ttm_ref_object on 64bit buildsRichard Kennedy2010-01-31
| | | | | | | | | | Re-order structure ttm_ref_object to remove 8 bytes of alignment padding on 64 bit builds, so shrinking its size from 72 to 64 bytes allowing it to fit into a smaller slab. Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk> Acked-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: release agp on error.Dave Airlie2010-01-31
| | | | | | if we get an error, release the AGP if we've acquired it already. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/kms/radeon/agp: Move the check of the aper_size after drm_acp_acquire ↵John Kacur2010-01-31
| | | | | | | | | | | and drm_agp_info First call drm_agp_acquire to check if agp has been acquired. Second call drm_agp_info to fill in the info data struct, including aper_size. Finally do the check to see if the aper_size makes sense. Signed-off-by: John Kacur <jkacur@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/kms/radeon/agp: Fix warning, format ‘%d’ expects type ‘int’, but ↵John Kacur2010-01-31
| | | | | | | | | | argument 4 has type ‘size_t’ - Fix warning by using %zu instead of %d for size_t - Fix spelling mistake, "to" should be "too". Signed-off-by: John Kacur <jkacur@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/ttm: Avoid conflicting reserve_memtype during ttm_tt_set_page_caching.Francisco Jerez2010-01-31
| | | | | | | | | | | Fixes errors like: > reserve_ram_pages_type failed 0x15b7a000-0x15b7b000, track 0x8, req 0x10 when a BO is moved between WC and UC areas. Reported-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Francisco Jerez <currojerez@riseup.net> Acked-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/kms/radeon: pick digitial encoders smarter. (v3)Dave Airlie2010-01-31
| | | | | | | | | | | | | | | | | | | | booting a Lenovo W500 with LVDS + DP outputs showed up a TODO we had on our list, to pick a correct digital encoder block. The LVTMA encoder requires the second digital encoder, all others can use any encoder at all. This fixes the digital encoder selection logic to enable LVDS/DP combos to work okay. V2: fix silly addition of connector dig_block and cleanup the other places in the code that pick the encoder. V3: rename to dig_encoder and clean up further - also fix the picking algorithm. tested on Lenovo W500 + desktop 3650 cards. Signed-off-by: Dave Airlie <airlied@redhat.com>