summaryrefslogtreecommitdiff
path: root/src/radeon_dri2.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2018-06-29 17:57:03 +0200
committerMichel Dänzer <michel@daenzer.net>2018-07-09 18:28:21 +0200
commit3c4c0213c11d623cba7adbc28dde652694f2f758 (patch)
tree278200a4fbf0790fcba3f21c6ca46d790cc75faa /src/radeon_dri2.c
parentb85b7b11f5b5e792f21951b881bd8433d3d70858 (diff)
glamor: Use GBM for BO allocation when possible
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>
Diffstat (limited to 'src/radeon_dri2.c')
-rw-r--r--src/radeon_dri2.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index 584a1d9d..ab3db6c5 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -79,11 +79,12 @@ static DevPrivateKeyRec dri2_window_private_key_rec;
static Bool
radeon_get_flink_name(RADEONEntPtr pRADEONEnt, PixmapPtr pixmap, uint32_t *name)
{
- struct radeon_bo *bo = radeon_get_pixmap_bo(pixmap)->bo.radeon;
+ struct radeon_buffer *bo = radeon_get_pixmap_bo(pixmap);
struct drm_gem_flink flink;
- if (bo)
- return radeon_gem_get_kernel_name(bo, name) == 0;
+ if (bo && !(bo->flags & RADEON_BO_FLAGS_GBM) &&
+ radeon_gem_get_kernel_name(bo->bo.radeon, name) == 0)
+ return TRUE;
if (radeon_get_pixmap_handle(pixmap, &flink.handle)) {
if (drmIoctl(pRADEONEnt->fd, DRM_IOCTL_GEM_FLINK, &flink) != 0)