summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* drm/radeon/kms: add hpd support for r6xx/r7xx/rs780/rs880 asicsAlex Deucher2009-12-081-23/+485
| | | | | | | | This just adds the functionality, it's not hooked up yet. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: add hpd support for r5xx/rs600/rs690/rs740 asicsAlex Deucher2009-12-081-0/+130
| | | | | | | | This just adds the functionality, it's not hooked up yet. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: add hpd support for r1xx-r4xx asicsAlex Deucher2009-12-081-2/+104
| | | | | | | | This just adds the functionality, it's not hooked up yet. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: add regs and irq tracking bits for hpdAlex Deucher2009-12-084-23/+154
| | | | | Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: get HPD info for connectorsAlex Deucher2009-12-087-84/+330
| | | | | | | | | This populates the connectors with HPD (Hot Plug Detect) information. This will be used in subsequent patches for automatic digital monitor connect/disconnect handling. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: clean up DP debuggingAlex Deucher2009-12-081-28/+28
| | | | | Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: fix DP detectAlex Deucher2009-12-084-11/+10
| | | | | | | | only return connected if there is actually a monitor connected. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: drop unused array to fix warning.Dave Airlie2009-12-081-3/+0
| | | | Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: do dp link training at dpms on time not mode set.Dave Airlie2009-12-081-4/+6
| | | | | | | This moves the radeon DP link training call to happen when we dpms on the encoder not when we set the mode. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: make displayport work by reorganising vsemph setup.Dave Airlie2009-12-081-1/+2
| | | | | | | This fix reorganises the initial DP link training slightly, and actually makes DP work under kms here. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms/dp: fix return in dpcd retrival.Dave Airlie2009-12-081-0/+1
| | | | | | | Not returning here caused us to get a display port version of 0 for everything this caused power up to not get sent which ends up in a black screen. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: free aux channel i2c adapter on destroyAlex Deucher2009-12-081-1/+18
| | | | | Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: add support for DP modesettingAlex Deucher2009-12-086-82/+600
| | | | | Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: handle dp sinks in atom encoder/transmitter tablesAlex Deucher2009-12-083-12/+100
| | | | | Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: store sink type in atom dig connectorAlex Deucher2009-12-083-10/+17
| | | | | | | | This will be used laster when the encoder and transmitters are set up. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: i2c reorgAlex Deucher2009-12-087-120/+166
| | | | | | | | | | - keep the atom i2c id in the i2c rec - fix gpio regs for GPIO and MDGPIO on pre-avivo chips - track whether the i2c line is hw capable - track whether the i2c line uses the multimedia i2c block Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: DP fixes and cleanup from the ddxAlex Deucher2009-12-085-150/+105
| | | | | | | | | - dpcp -> dpcd - fix up dig encoder routing - aux transaction table takes delay in 10 usec units Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: initial radeon displayport portingDave Airlie2009-12-089-24/+500
| | | | | | This is enough to retrieve EDID and DPCP. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: add support to atom parser for FB read/writeDave Airlie2009-12-083-4/+8
| | | | | | | | FB read/write really doesn't need to access the actual VRAM, we can just use a scratch area. This is required for using atom displayport calls later. Signed-off-by: Dave Airlie <airlied@redhat.com>
* Merge remote branch 'origin/drm-core-next' into testDave Airlie2009-12-0839-289/+2509
|\ | | | | | | | | Conflicts: drivers/gpu/drm/drm_fb_helper.c
| * drm/ttm: fix unreachable code.Dave Airlie2009-12-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | None of the in-tree drivers use user objects yet so this wasn't hitting us. Stanse found unreachable code in ttm_bo_add_ttm: http://decibel.fi.muni.cz/~xslaby/stanse/error.cgi?db=32&id=714#l238 Reported-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/intel: refactor DP i2c support and DP common header to drm helperDave Airlie2009-12-086-83/+83
| | | | | | | | | | | | | | | | | | | | Both radeon and nouveau can re-use this code so move it up a level so they can. However the hw interfaces for aux ch are different enough that the code to translate from mode, address, bytes to actual hw interfaces isn't generic, so move that code into the Intel driver. Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm: Export symbols needed for the vmwgfx driver.Thomas Hellstrom2009-12-071-0/+2
| | | | | | | | | | Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/ttm: Export symbols needed for the vmwgfx driver.Thomas Hellstrom2009-12-074-0/+14
| | | | | | | | | | Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/ttm: Add TTM execbuf utilities.Thomas Hellstrom2009-12-073-1/+225
| | | | | | | | | | | | | | | | | | | | Utilities to reserve, unreserve and fence a list of TTM buffer objects in a deadlock-safe manner. Used by the vmwgfx driver. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/ttm: Add ttm lock functionality.Thomas Hellstrom2009-12-073-1/+559
| | | | | | | | | | | | | | | | | | | | | | | | | | This is intended to be used by ttm-aware drivers to 1) Block clients to inactive masters when they try to validate buffers for GPU use. 2) Optionally block clients to the current master when there is thrashing due to GPU memory shortage. Used by the vmwgfx driver. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/ttm: Add user-space objects.Thomas Hellstrom2009-12-073-1/+721
| | | | | | | | | | | | | | | | | | | | Add objects needed for user-space to maintain reference counts on ttm objects. This is used by the vmwgfx driver which allows user-space to maintain map-counts on dma buffers, lock-counts on the ttm lock and ref-counts on gpu surfaces, gpu contexts and dma buffer. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/mm: fixup typo in debug functions.Dave Airlie2009-12-041-1/+1
| | | | | | | | | | | | Free and used were reversed. Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm: Add dirty ioctl and propertyJakob Bornecrantz2009-12-045-0/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a ioctl and property to allow userspace to notify the kernel that a framebuffer has changed. Instead of snooping the command stream this allows finer grained tracking of which areas have changed. The primary user for this functionality is virtual hardware like the vmware svga device, but also Xen hardware likes to be notify. There is also real hardware like DisplayLink and DisplayPort that might take advantage of this ioctl. Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/ttm: Fix build failure due to missing struct pageMartin Michlmayr2009-12-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drm/ttm fails to build on MIPS because "struct page" is not known: | In file included from drivers/gpu/drm/ttm/ttm_memory.c:28: | include/drm/ttm/ttm_memory.h:154: warning: 'struct page' declared inside parameter list | include/drm/ttm/ttm_memory.h:154: warning: its scope is only this definition or declaration, which is probably not what you want | include/drm/ttm/ttm_memory.h:156: warning: 'struct page' declared inside parameter list | drivers/gpu/drm/ttm/ttm_memory.c:540: error: conflicting types for 'ttm_mem_global_alloc_page' | include/drm/ttm/ttm_memory.h:154: error: previous declaration of 'ttm_mem_global_alloc_page' was here | drivers/gpu/drm/ttm/ttm_memory.c:561: error: conflicting types for 'ttm_mem_global_free_page' | include/drm/ttm/ttm_memory.h:156: error: previous declaration of 'ttm_mem_global_free_page' was here Signed-off-by: Martin Michlmayr <tbm@cyrius.com> Cc: stable@kernel.org Acked-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/ttm: fix small memory leak in ttm_memory.cDan Carpenter2009-12-041-4/+5
| | | | | | | | | | | | | | | | I moved the allocation until after the check for (si->totalhigh == 0). Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-By: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm: Add compatibility #ifdefs for *BSDKristian Høgsberg2009-12-047-18/+27
| | | | | | | | | | | | | | | | This let's use use the linux drm headers as the canonical source for libdrm on all platforms. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm: Add support for drm master_[set|drop] callbacks.Thomas Hellstrom2009-12-043-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vmwgfx driver has a per master rw lock around TTM, to guarantee mutual exclusion when needed. This is typically when all evictable buffers are evicted due to 1) vt switch 2) master switch 3) suspend / resume. In the multi-master case, on master switch the new master takes the previously active master lock in write mode, and then evicts all buffers. Any clients to previous masters will then block on that lock when trying to validate a buffer. fbdev also acts as a virtual master wrt this. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/edid: Decode 3-byte CVT codes from EDID 1.4Adam Jackson2009-12-042-0/+53
| | | | | | | | | | Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/edid: Add new detailed block types from EDID 1.4Adam Jackson2009-12-041-0/+3
| | | | | | | | | | Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/edid: Add DMT modes to the pool if the monitor is GTF-capableAdam Jackson2009-12-041-4/+65
| | | | | | | | | | | | | | See also: http://bugzilla.redhat.com/539785 Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/modes: Add drm_mode_hsync()Adam Jackson2009-12-042-4/+31
| | | | | | | | | | Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/edid: Unify detailed block parsing between base and extension blocksAdam Jackson2009-12-041-102/+61
| | | | | | | | | | | | | | | | Also fix an embarassing bug in standard timing subblock parsing that would result in an infinite loop. Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/modes: Fall back to 1024x768 instead of 800x600Adam Jackson2009-11-241-1/+1
| | | | | | | | | | | | | | | | | | This matches the X server's fallback modes when using RANDR 1.2. See also: http://bugzilla.redhat.com/538761 Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/edid: Fix up partially corrupted headersAdam Jackson2009-11-241-6/+16
| | | | | | | | | | | | | | | | | | We'll still fail the block if it fails the EDID checksum though. See also: http://bugzilla.redhat.com/534120 Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/edid: Retry EDID fetch up to four timesAdam Jackson2009-11-241-14/+14
| | | | | | | | | | | | | | | | | | | | | | This matches the X server's retry logic. Note that we'll only retry if we get a DDC response but fail validation; legitimately disconnected outputs will bomb out early. See also: http://bugzilla.redhat.com/532957 Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/modes: Limit fallback modes to 60HzAdam Jackson2009-11-241-0/+2
| | | | | | | | | | | | | | See also: http://bugzilla.redhat.com/514600 Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/kms: allocate framebuffer cmapClemens Ladisch2009-11-191-1/+7
| | | | | | | | | | | | | | | | | | Without an allocated colormap, FBIOGETCMAP fails. This would make programs restore an all-black colormap ("links -g") or fail to work altogether ("mplayer -vo fbdev2"). Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm: set the type of the drm_framebuffer::fbdev fieldClemens Ladisch2009-11-191-1/+1
| | | | | | | | | | | | | | | | The fbdev field of the drm_framebuffer structure is always used to store a pointer to a fb_info, so there is no reason for it to be void*. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/fb: fix FBIOGET/PUT_VSCREENINFO pixel clock handlingClemens Ladisch2009-11-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the framebuffer driver does not publish detailed timing information for the current video mode, the correct value for the pixclock field is zero, not -1. Since pixclock is actually unsigned, the value -1 would be interpreted as 4294967295 picoseconds (i.e., about 4 milliseconds) by register_framebuffer() and userspace programs. This patch allows X.org's fbdev driver to work. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/kms: properly handle fbdev blankingJames Simmons2009-11-191-6/+9
| | | | | | | | | | | | | | | | I examined several fbdev drivers and foudn the blanking code in drm_fb_helper to be wrong. This patch fixes the fbdev blanking to behave like other fbdev drivers. Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm/kms: add page flipping ioctlKristian Høgsberg2009-11-185-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a page flipping ioctl to the KMS API. The ioctl takes an fb ID and a ctrc ID and flips the crtc to the given fb at the next vblank. The ioctl returns immediately but the flip doesn't happen until after any rendering that's currently queued up against the new framebuffer is done. After submitting a page flip, any execbuffer involving the old front buffer will block until the flip is completed. Optionally, a vblank event can be generated when the swap eventually happens. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm: check return values in drm_versionAndres Salomon2009-11-181-5/+11
| | | | | | | | | | | | | | | | | | In drm_version, actually check the results from function calls so that we're not potentially passing garbage back to userspace. Signed-off-by: Andres Salomon <dilinger@collabora.co.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm: replace DRM_COPY macro w/ a functionAndres Salomon2009-11-181-12/+22
| | | | | | | | | | | | | | | | | | Don't inline it; the compiler can figure it out. Comments added that are based upon my interpretation of the code. Hopefully they're correct. :) Signed-off-by: Andres Salomon <dilinger@collabora.co.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * drm: kill more unused DRM macrosAndres Salomon2009-11-182-23/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a few more macros in drmP.h that are unused; DRM_GET_PRIV_SAREA, DRM_ARRAY_SIZE, and DRM_WAITCOUNT can go away completely. Unfortunately, DRM_COPY is still used in one place, but we can at least move it to where it's used. It's an awful looking macro.. [akpm: fix overeagerness] Signed-off-by: Andres Salomon <dilinger@collabora.co.uk> Cc: Dave Airlie <airlied@linux.ie> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
OpenPOWER on IntegriCloud