Don't install Flush/EventCallback for GPU screens

Their purpose is to flush GPU rendering commands corresponding to damage
events, but there can be no damage events corresponding to GPU screen
rendering operations.

(Ported from radeon commits 13c6bc5e382765fe567091e1c616c0a26eec04ca and
487aa62a2a23b86e4ea4714fdfd465c9e513141f)

v2: Squash in radeon fix for build against xserver < 1.13

Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
This commit is contained in:
Michel Dänzer
2016-11-22 16:50:59 +09:00
committed by Michel Dänzer
parent ff31320644
commit 7fe2a8ed67

View File

@@ -223,7 +223,7 @@ amdgpu_flush_callback(CallbackListPtr *list,
static Bool AMDGPUCreateScreenResources_KMS(ScreenPtr pScreen)
{
ExtensionEntry *damage_ext = CheckExtension("DAMAGE");
ExtensionEntry *damage_ext;
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
PixmapPtr pixmap;
@@ -277,7 +277,11 @@ static Bool AMDGPUCreateScreenResources_KMS(ScreenPtr pScreen)
amdgpu_glamor_create_screen_resources(pScreen);
info->callback_event_type = -1;
if (damage_ext) {
if (
#ifdef AMDGPU_PIXMAP_SHARING
!pScreen->isGPU &&
#endif
(damage_ext = CheckExtension("DAMAGE"))) {
info->callback_event_type = damage_ext->eventBase + XDamageNotify;
if (!AddCallback(&FlushCallback, amdgpu_flush_callback, pScrn))