summaryrefslogtreecommitdiff
path: root/src/radeon.h
AgeCommit message (Collapse)Author
2018-08-29EXA: Handle NULL BO pointer in radeon_set_pixmap_boMichel Dänzer
2018-07-17glamor: Invalidate cached GEM handle in radeon_set_pixmap_boMichel Dänzer
We continued using the stale cached handle, causing issues e.g. when resizing the screen via RandR. Reported-by: iive on IRC Acked-by: Alex Deucher <alexander.deucher@amd.com>
2018-07-12Replace 'foo == NULL' with '!foo'Michel Dänzer
Shorter and sweeter. :) (Ported from amdgpu commit e8e688f3852fb06b0c34ed5bce47c9493bcd1613) Acked-by: Alex Deucher <alexander.deucher@amd.com>
2018-07-09glamor: Use GBM for BO allocation when possibleMichel Dänzer
Inspired by amdgpu. This avoids various issues due to a GEM handle lifetime conflict between us and Mesa with current glamor. Bugzilla: https://bugs.freedesktop.org/105381 Tested-by: Konstantin Kharlamov <hi-angel@yandex.ru> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2018-07-09Add struct radeon_bufferMichel Dänzer
Inspired by amdgpu, preparation for the following change. For now, this is mostly a wrapper around struct radeon_bo, no functional change intended. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2018-07-09Refactor radeon_finish helperMichel Dänzer
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2018-07-09Factor out radeon_surface_initialize helperMichel Dänzer
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2018-07-09glamor: Don't store radeon_surfaces in pixmapsMichel Dänzer
Only EXA needs them. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2018-03-14Pass extents to radeon_scanout_do_update by valueMichel Dänzer
radeon_scanout_extents_intersect could leave the scanout damage region in an invalid state, triggering debugging checks in pixman: *** BUG *** In pixman_region_append_non_o: The expression r->x1 < r->x2 was false Set a breakpoint on '_pixman_log_error' to debug (Ported from amdgpu commit 8af989546907ad9fb491d940e1936d3bfc89276b)
2018-03-07Wrap the whole miPointerScreenFuncRec, instead of only Set/MoveCursorMichel Dänzer
We were clobbering entries in mi's global miSpritePointerFuncs struct, which cannot work correctly with multiple primary screens. Instead, assign a pointer to our own wrapper struct to PointPriv->spriteFuncs. Fixes crashes with multiple primary screens. Fixes: 1fe8ca75974c ("Keep track of how many SW cursors are visible on each screen") Reported-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2018-01-25Always use screen depth/bpp for KMS framebuffersMichel Dänzer
DRI clients can use depth 32 pixmaps while the screen is depth 24, in which case page flipping would fail. Reported-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-and-Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2018-01-22Define per x-screen individual drmmode_crtc_funcsMario Kleiner
This allows to en-/disable some functions depending on individual screen settings. Prep work for more efficient depth 30 support. Suggested-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2017-12-28Keep track of how many SW cursors are visible on each screenMichel Dänzer
And use this to determine when we cannot use page flipping for DRI clients. We previously did this based on whether the HW cursor cannot be used on at least one CRTC, which had at least two issues: * Even while the HW cursor cannot be used, no SW cursor may actually be visible (e.g. because all cursors are disabled), in which case we can use page flipping for DRI clients anyway * Even while the HW cursor can be used, there may be SW cursors visible from non-core pointer devices, in which case we cannot use page flipping for DRI clients anyway (Ported from amdgpu commit 69e20839bfeb3ee0b0a732d72de0a32d6c5435fc) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-12-01Add radeon_dirty_src_drawable helperMichel Dänzer
Allows tidying up radeon_dirty_src_equals and redisplay_dirty slightly. (Cherry picked from amdgpu commit 1d65ac395971571094df21ca0408d5972c6b56ec) Acked-by: Alex Deucher <alexander.deucher@amd.com>
2017-11-27Fix non GLAMOR buildJoakim Tjernlund
Non GLAMOR builds needs pRADEONEnt so move the USE_GLAMOR define down to make pRADEONEnt defined in this case. Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2017-10-20Unreference pixmap's FB with EXA as well in radeon_set_pixmap_boMichel Dänzer
Not doing so resulted in DRI2 page flips not actually changing the FB being scanned out, showing intermittent flicker of the "back" buffer rendering. Bugzilla: https://bugs.freedesktop.org/102643 Fixes: 55e513b978b2 "Use reference counting for tracking KMS framebuffer lifetimes" Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-30Require xserver >= 1.13Michel Dänzer
xserver 1.13.0 was released on September 6th, 2012, almost 5 years ago. This allows cleaning up a bunch of backwards compatibility code. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-08-29Create radeon_master_screen helperMichel Dänzer
Preparatory, no functional change intended yet. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-29Create radeon_pixmap_get_fb_ptr helperMichel Dänzer
Preparatory, no functional change intended yet. Also inline radeon_pixmap_create_fb into radeon_pixmap_get_fb, since there's only one call-site anymore. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-17Make radeon_scanout_do_update take a PixmapPtr instead of a DrawablePtrMichel Dänzer
All callers were already passing in a pixmap. This allows simplifying the rotated scanout case slightly. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-17Pass extents to radeon_scanout_do_updateMichel Dänzer
Preparation for following change, no functional change intended yet. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-17Add source drawable parameter to radeon_scanout_do_updateMichel Dänzer
Preparation for following changes, no functional change intended yet. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-17Create drmmode_wait_vblank helperMichel Dänzer
Allows cleaning up the code considerably. v2: * Fix "drmWaiVBlank" typo, add blank line for readability (Slava Abramov) * Rename in/out sequence parameters to "target_seq" and "result_seq", hopefully that will be clearer. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> # v1
2017-08-15Adapt to PixmapDirtyUpdateRec::src being a DrawablePtrMichel Dänzer
2017-06-30Use pRADEONEnt->fd exclusively for the DRM file descriptorMichel Dänzer
This brings us closer to amdgpu. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-05-11Use reference counting for tracking KMS framebuffer lifetimesMichel Dänzer
References are held by the pixmaps corresponding to the FBs (so the same KMS FB can be reused as long as the pixmap exists) and by the CRTCs scanning out from them (so a KMS FB is only destroyed once it's not being scanned out anymore, preventing intermittent black screens and worse issues due to a CRTC turning off when it should be on). v2: * Only increase reference count in drmmode_fb_reference if it was sane before * Make drmmode_fb_reference's indentation match the rest of drmmode_display.h Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-04-17Don't set modes before RADEONWindowExposures_oneshot is calledMichel Dänzer
The root window contents may be undefined before that, so we don't want to show anything yet. Fixes a crash on startup with rotation and virtual resolution set in xorg.conf. Bugzilla: https://bugs.freedesktop.org/100276 Fixes: cc9d6b7db9c2 ("Move DPMS check from radeon_scanout_do_update to radeon_scanout_flip") (Ported from amdgpu commit 981bac185cfd74ae50dffc28f57cf34623a9595f) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-08Skip some initialization steps for GPU screensMichel Dänzer
Xorg doesn't use the following functionality of GPU screens, so don't bother initializing it: * DRI page flipping * DRI3 / Present / SYNC fences * XVideo / XvMC * Root window with background None Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-02Call drmmode_set_desired_modes from a WindowExposures hookMichel Dänzer
This is the earliest opportunity where the root window contents are guaranteed to be initialized, and prevents drmmode_set_mode_major from getting called before drmmode_set_desired_modes via RADEONUnblank -> drmmode_crtc_dpms. Also, in contrast to the BlockHandler hook, this is called when running Xorg with -pogo. Fixes intermittently showing garbage on server startup or after server reset. As a bonus, this avoids trouble due to higher layers (e.g. the tigervnc Xorg module) calling RADEONBlockHandler_oneshot repeatedly even after we set pScreen->BlockHandler = RADEONBlockHandler_KMS. v2: * Drop spaces between XORG_VERSION_NUMERIC arguments * Call radeon_bo_wait after radeon_cs_flush_indirect Bugzilla: https://bugs.freedesktop.org/99457 Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
2017-02-22Allow toggling TearFree at runtime via output propertyMichel Dänzer
Option "TearFree" now sets the default value of the output property. See the manpage update for details. TearFree is now enabled by default for outputs using rotation or other RandR transforms, and for RandR 1.4 slave outputs. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-12-05Calculate log base 2 in radeon.h based on clz for all platformsJochen Rollwagen
This commit replaces the inline assembler code (for x86 platforms) and loop (for non-x86 platforms) in RADEONLog2 with a one-liner version based on clz (count leading zeroes). Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-11-29Take current scanout_id into account everywhere involved with TearFreeMichel Dänzer
Fixes various potential issues with TearFree enabled, e.g. outputs freezing after display configuration changes. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-11-25Add radeon_is_gpu_screen helperMichel Dänzer
This will hopefully decrease the chance of accidentally breaking the build against xserver < 1.13 in the future. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-10-27Require xserver 1.10 or newerMichel Dänzer
1.10.0 was released in February 2011. We've been accidentally requiring 1.10 or newer since 121a6de72da5 ("Keep track of damage event related flushes per-client v2"). Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-21Free priv in amdgpu_set_pixmap_bo also if priv->bo == NULLMichel Dänzer
Fixes memory leak when destroying pixmaps with priv->bo == NULL. Reported-by: Qiang Yu <qiang.yu@amd.com> (Ported from amdgpu commit 7f7f9825caf3983902491da27c16d14cd8bf9b7d)
2016-09-21Propagate failure from radeon_set_pixmap_boMichel Dänzer
(Ported from amdgpu commits c315c00e44afc91a7c8e2eab5af836d9643ebb88 and 0d42082108c264568e2aadd15ace70e72388bc65)
2016-09-20Use local implementation of RegionDuplicate for older xserverMichel Dänzer
It was only added in xserver 1.15. Fixes build against older xserver. Reported-by: Pali Rohár <pali.rohar@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-08-17Keep track of damage event related flushes per-client v2Michel Dänzer
This further reduces the compositing slowdown due to flushing overhead, by only flushing when the X server actually sends XDamageNotify events to a client, and there hasn't been a flush yet in the meantime. v2: Use ScreenPrivateKey, fixes invalid memory access with GPU screens Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-08-01Use EventCallback to avoid flushing every time in the FlushCallbackMichel Dänzer
We only need to flush for XDamageNotify events. Significantly reduces compositing slowdown due to flushing overhead, in particular with glamor. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-05-12Explicitly set the fbcon pixmap pitch againMichel Dänzer
The kernel driver returns 0 as the pitch of the fbcon BO via the DRM_RADEON_GEM_GET_TILING ioctl, so we ended up using an incorrect pitch in some cases. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94901 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-31Update pixmap pitch in radeon_set_pixmap_boMichel Dänzer
Stop second guessing it in drmmode_crtc_scanout_create. Fixes display corruption in some cases with TearFree enabled. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94751 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-24Require xserver 1.9 or newerMichel Dänzer
1.9.0 was released in August 2010. We were already unintentionally relying on things not available in 1.8 for at least a year, and nobody has complained. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-23Don't try DRI2/Present flipping while the HW cursor can't be usedMichel Dänzer
Flipping doesn't interact correctly with SW cursor: A flip makes the SW cursor disappear. It will only appear again when the cursor is moved, but it will be surrounded by corruption, because the SW cursor code will restore stale screen contents at the old cursor location before drawing the cursor at the new location. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-02-27Make DRM event queue xf86CrtcPtr based instead of ScrnInfoPtr basedMichel Dänzer
This allows for a minor simplification of the code. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-01-20Set RADEON_GEM_NO_CPU_ACCESS flag for BOs which don't need CPU accessMichel Dänzer
Failing to do this was resulting in the kernel driver unnecessarily leaving open the possibility of CPU access to those BOs. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-11-17glamor: Restore all ScreenRec hooks during CloseScreenMichel Dänzer
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-11Make selection between DRI2 and DRI3 consistent with other drivers. (v2)Mario Kleiner
Add Option "DRI" to allow selection of maximum DRI level. This allows the user to select the maximum level of DRI implementation to use, DRI2 or DRI3. It replaces the old option "DRI3" which had exactly the same purpose, but differs from the method used in both intel ddx and nouveau ddx. Make this consistent before a new stable driver is released. v2: Retain handling of old Option "DRI3" for backwards compatibility, but Option "DRI" will take precedence over "DRI3" if both are provided. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-07-28radeon: cleanup the entity recDave Airlie
Some of these were set, some of them were always opposites, so clean things up. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-05-20Replace SyncFence typedef with declaration of struct _SyncFenceMichel Dänzer
Fixes build failure in some environments: CC radeon_sync.lo In file included from radeon_sync.c:28: /home/tinderbox/xorg-build/include/xorg/misync.h:31: error: redefinition of typedef 'SyncFence' radeon.h:93: note: previous declaration of 'SyncFence' was here make[2]: *** [radeon_sync.lo] Error 1 Reported-Tested-and-Acked-by: David Airlie <airlied@redhat.com>
2015-04-23On screen resize, clear the new buffer before displaying itMichel Dänzer
Fixes garbage being intermittently visible during a screen resize. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27757#c7 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>