summaryrefslogtreecommitdiff
path: root/src/radeon_dri2.c
AgeCommit message (Collapse)Author
2012-06-06Don't page-flip or wait on a CRTC while we're VT-switched away.Michel Dänzer
We don't know what the CRTC state is. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-05-23ati: convert to new screen conversion APIsDave Airlie
The compat header takes care of the old server vs new server. this commit was autogenerated from util/modular/x-driver-screen-scrn-conv.sh Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-06DRI2: Unreference buffers immediately when event wait info is invalidated.Michel Dänzer
Deferring this could result in trying to unreference buffers from a previous server generation, i.e. accessing freed memory. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Tested-by: Christian König <Christian.koenig@amd.com>
2012-02-13Handle new xorg_list API.Michel Dänzer
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=45937 Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-02-06r600-evergreen: use common surface allocator for tiling v11Jerome Glisse
Use libdrm common surface code so mesa,ddx have same idea about tiling surface and what their pitch should be and the alignment constraint. v2 fix remaining issue add new option to conditionaly enable v3 fix fbcon copy and r600 exa copy path v4 fix non tiled path 2D tiling on GPU >= R600, set it to false as default v5 adapt to pixel/element size split of libdrm/radeon v6 update to properly handle falling back to 1d tiled v6 final fix to tile split value on evergreen and newer v7 fix default array mode on r6xx, fix height alignment issue on evergreen v8 fix tile split value v9 add stencil tile split support, simplify dri2 for stencil with evergreen v10 Try to fix xv path regarding tiling. Adapt to libdrm API change. Try to fix case where there is no surface which means non tiled bo. v11 check for proper libdrm Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-12-28DRI2: Can't use page flipping for pixmaps. (bug #42913)Michel Dänzer
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=42913 . Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2011-12-06radeon: add original radeon to always tiled.Dave Airlie
and actually enable it for M7, previous commit only did one function. Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-06radeon: refine always tiled depth checkDave Airlie
So it appears the M7 family always tiles its depth buffer also. Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05radeon: r200 depth buffers are always tiledDave Airlie
When we do the allocations we need to make sure the always tiled nature is taken into account. Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-25Make radeon_dri2_create_buffer(s) more robust. (Bug #30047)Michel Dänzer
In particular, handle and propagate failure to allocate GPU accessible memory, instead of crashing. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=30047 . Also take care not to leak resources in error paths. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2011-10-19dri2: Add vdpau driver name entryMaarten Lankhorst
libvdpau has a driver loading mechanism that looks for a dri2 driver first before falling back to nvidia, so lets use that. Allows use of libvdpau_rx00 without having to set things up separately, similar to the patch to xf86-video-nouveau. Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com> Reviewed-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Michel Dänzer <michel@daenzer.net> Tested-by: Michel Dänzer <michel@daenzer.net>
2011-08-01dri2: Update front buffer pixmap and name before exchanging buffersVille Syrjala
Buffer exchange assumes that the front buffer pixmap and name information is accurate. That may not be the case eg. if the window has been (un)redirected since the buffer was created. Signed-off-by: Ville Syrjala <syrjala@sci.fi>
2011-06-17dri2: fix copy pasto in a6154c00c64932332e8f6e334661ffd579cfd894Alex Deucher
Reported-by: Nils Wallménius <nils.wallmenius@gmail.com> Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-16dri2: missing bit from a6154c00c64932332e8f6e334661ffd579cfd894Alex Deucher
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-16dri2/eg+: fix size and alignment of depth/stencil buffersAlex Deucher
Base alignment may be 256B or 512B depending on the group size. Also need to check against front size for virtualX. Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-06DRI2: fix high-crtc/vblank oversight/bugIlija Hadzic
improvements to high-crtc handling done in f0b7d7b449cc77bb2b281d81108507f8bc2e6018 introduced a bug that caused the populate_vbl_request_type to never use the high-crtc field even when it should. The reason is that the offending patch put the code under #ifdef DRM_VBLANK_HIGH_CRTC_MASK which is not visible outside the enum type, so #else was always taken in compilation type. This patch fixes it by basing #ifdef on (pre-processor visible) DRM_VBLANK_HIGH_CRTC_SHIFT constant Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
2011-04-05DRI2: Some cleanups for the scheduling mess.Michel Dänzer
* Fix build against libdrm that doesn't define *_VBLANK_HIGH_CRTC*. * If we have more than two CRTCs but can't use DRM_VBLANK_HIGH_CRTC_MASK, don't enable scheduling in the first place rather than relying on DRM_VBLANK_SECONDARY magically doing something sensible for higher CRTCs. * Only set up client state tracking when scheduling is enabled. * Only declare pRADEONEnt when it's needed, and break long lines.
2011-04-02xf86-video-ati: (revised #2) add support for vblank on crtc > 1Ilija Hadzic
Hi Alex, Enclosed is a revised version of two patches sent on Mar 18 and Mar 22, respectively. Details summarized in these two threads: http://lists.freedesktop.org/archives/dri-devel/2011-March/009463.html http://lists.freedesktop.org/archives/dri-devel/2011-March/009582.html This patch reconciles the DDX with the change in libdrm sent to this list earlier today. Specifically, it refers to a symbol that has been renamed from DRM_CAP_HIGH_CRTC to DRM_CAP_VBLANK_HIGH_CRTC. It *supersedes* the previous patch (i.e. apply it to the master branch as it exists at the time of this writing, not as an incremental patch to the one sent previously). Regards, Ilija Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com> Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-02-24dri2: disable pageflipping for transformed displaysAlex Deucher
Based on Ben's nouveau patch. Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-12-19ddx/ati: Bugfix for pageflip consistency check.Mario Kleiner
target_msc wasn't passed from vblank event handler to pageflip routine, due to a missing initalization. Now fixed. Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
2010-12-01ddx/ati: Fix reporting of pageflip completion events on multi-head.Mario Kleiner
When a drawable is page-flipped on multiple crtc's (fullscreen drawable on mirror-mode or multi-head x-screen), only one pageflip event is finally delivered, after the last participating crtc signals flip completion, this to avoid visual corruption. Old code returned vblank count and timestamps of flip completion of this last crtc, instead of the values of the "master crtc", the one that was used for initially scheduling/triggering the pagflip via vblank events. (master = radeon_dri2_drawable_crtc(drawable)) This patch makes sure that the pageflip completion values of the "master" crtc are returned, otherwise client applications will get confused by the random (msc, ust) values returned by whichever crtc was the last to complete its flip. Without this, the returned values change randomly and jump forward and backward in time and count. The patch also implements a consistency check on returned vblank count values of pageflip completion. Impossible values are detected, a x-warning is logged and returned (msc,ust) values are marked invalid, so clients could perform error handling. Such a warning would indicate bugs in the pageflip completion routine of future kms drivers or the ddx to aid driver debugging. Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
2010-12-01ddx/ati: Add option "SwapbuffersWait" to control vsync of DRI2 swaps.Mario Kleiner
A new optional kms driver option "SwapbuffersWait" is defined for xorg.conf, which defaults to "on". If "on", DRI2 bufferswaps will be synchronized to vsync, otherwise not. This currently only affects copy-swaps, not pageflipped swaps. It also requires a swap_interval setting of zero by the OpenGL client. Ideally, we'd provide a way for dri2 to pass the current swap interval to the ddx so we could change this dynamically. Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
2010-12-01radeon/kms: add pageflip supportAlex Deucher
requires radeon drm 2.8.0 or higher Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-28dri2: reference count the client privates key/callbackDave Airlie
This lets multi-screen work better, but still having issues after server recycle, but it doesn't crash at least.
2010-10-27Don't try to delete DRI2 event list entries that were never added. (Bug #31086)Michel Dänzer
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=31086 .
2010-10-07radeon: proper DRI2 pending events handling when client gone. (v6)Oldřich Jedlička
Properly handle asynchronous DRI2 events for disconnected clients. Track client's pending requests and mark them as invalid when the client disconnects. This is based on the version from Alban Browaeys in bug #29065. v1 (Alban Browaeys): Based upon a detailed explanation from Oldřich Jedlička and comments from Christopher James Halse Rogers. on http://lists.x.org/archives/xorg-driver-ati/2010-August/016780.html . v2: Updated version to apply on master. Removed unnecessary client_index field from _DRI2FrameEvent. Added freeing/removing from list to failed paths of radeon_dri2_schedule_wait_msc and radeon_dri2_schedule_swap. v3: Adopt to older xorg-server that doesn't have dixRegisterPrivateKey. v4: Conditional include of list.h, unreachable return removed. v5: Distribute list.h as xorg_list.h, remove xorg-server version check. Use the version from xorg-server when available (checked in configure.ac). v6: Removed xorg_list.h, made DRI2 scheduling features dependent on list.h presence.
2010-10-04Merge branch 'evergreen_accel' of ↵Alex Deucher
git+ssh://git.freedesktop.org/git/xorg/driver/xf86-video-ati
2010-10-01evergreen/dri2: fix depth allocation for depth+stencilAlex Deucher
evergreen uses separate allocations for depth and stencil, so to handle that, create a depth buffer large enough to handle both. This is required for using the stencil buffer in mesa.
2010-08-27dri2: Reference count DRI2 buffersChristopher James Halse Rogers
When a client calls ScheduleSwap we set up a kernel callback when the relevent vblank event occurs. However, it's possible for the client to go away between calling ScheduleSwap and the vblank event, resulting in the buffers being destroyed before they're passed to radeon_dri2_frame_event_handler. Add reference-counting to the buffers and take a reference in radeon_dri2_schedule_swap to ensure the buffers won't be destroyed before the vblank event is dealt with. This parallels the approach taken by the Intel DDX in commit 0d2392d44aae95d6b571d98f7ec323cf672a687f. Fixes: http://bugs.freedesktop.org/show_bug.cgi?id=29065 v2: Don't write completion events to the client if it has quit. v3: Don't try to unref the NULL buffers from a DRI2_WAITMSC event. Take a ref in schedule_swap earlier, so the offscreen fallback doesn't incorrectly destroy the buffers. Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-25remove explicit buffer submit from copy regionDave Airlie
port of 0be3e95c844247746742805830860ace9f546d99 from intel driver. Remove explicit batchbuffer submit in DRI2 copyregion Now that we submit from the flush callback chain, we know we'll always submit before the client receives the reply or event that blocks it from rendering the next frame. Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-05r6xx/r7xx: default to micro (1D) tiling for nowAlex Deucher
SW de-tiling used in the r600c 3D driver has issues with certain configurations. Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-08-05r6xx/r7xx: add support for tiling with kms (v3)Alex Deucher
Requires radeon drm 2.6.0 and updated mesa. v2: - fix lockup due to not emiting DB_DEPTH_INFO https://bugs.freedesktop.org/show_bug.cgi?id=28342 - fix drm minor version to deal with evergreen accel v3: rebase on current ddx git Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-06-21DRI2: Fix up confusion between windows and pixmaps.Michel Dänzer
Fixes crashes with xserver master, where looking up a pixmap private on a window no longer happens to work.
2010-06-21Convert x(c)alloc/xfree to m/calloc/free.Michel Dänzer
Fixes deprecation warnings with xserver master and should also work with older xservers.
2010-05-18dri2: use radeon_pick_best_crtc()Alex Deucher
It's already exposed and used by exa and Xv and has the same functionality. radeon_covering_crtc() can be dropped eventually.
2010-05-10kms: add support for the MSC swap & sync APIJerome Glisse
This patch is mostly a port over of Intel ddx code for MSC support. It needs a radeon KMS module with version 2.4 which has the query for hw crtc id. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2009-11-25dri2: Use drmGetDeviceNameFromFd() instead of open coded loop.Kristian Høgsberg
2009-11-23radeon: avoid using hw pixmaps when we have little VRAM.Dave Airlie
This patch returns NULL for pixmap creation when we are using mixed pixmaps and the pixmap has a size. The size check is necessary for the front buffer. We add a flag to force pixmap creation for certain pixmaps that need to be hw, like the DRI2 and Xv ones. Idea from Michel and workarounds from Ben Skeggs. v2: add Option "EXALowVRAM" to allow configuring this, value in MBs. Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-09-08radeon: fix dri2 struct zeroingAdam Jackson
2009-09-08Merge branch 'r6xx-cs'Dave Airlie
2009-08-30radeon: Fix DRI2BufferPtr to be DRI2Buffer2Ptr for xserver 1.6.Pauli Nieminen
Bump requirement for xserver in KMS mode to 1.6.2 for DRI2Buffer2Ptr.
2009-08-27DRI2: Set tiling for depth/stencil buffers with all DRI2 interface versions.Michel Dänzer
2009-08-27Throttle DRI2 buffer swaps / frontbuffer flushes.Michel Dänzer
2009-08-25r6xx/r7xx: first pass at kms accel supportAlex Deucher
Adapted from various patches from Dave and Jerome.
2009-08-19radeon/kms: add initial colortiling support (disabled by default).Dave Airlie
This requires an X server from git with createpixmap2 support fixed up in it. On 1.6 and previous it won't do any tiling, if you are running git server please upgrade to latest git. Option "AllowColorTiling" "true" to enable and do some testing
2009-08-07Add support for EXA_MIXED_PIXMAPS in xserver master.Michel Dänzer
2009-07-18Enable vsync for DRI2 region copies.Michel Dänzer
2009-07-07Fix DRI2 with current xserver Git.Michel Dänzer
2009-07-02Warning fixes.Michel Dänzer
2009-07-02radeon/dri2: fix dri2 - needs newest libdrm_radeonDave Airlie