mirror of
https://github.com/X11Libre/xf86-video-amdgpu.git
synced 2026-03-24 01:24:31 +00:00
Add amdgpu_is_gpu_screen helper
This will hopefully decrease the chance of accidentally breaking the build against xserver < 1.13 in the future. (Ported from radeon commit f130b10e63f7526360b41aa0918b4940f63f662a) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -149,6 +149,9 @@ typedef enum {
|
||||
|
||||
#if XF86_CRTC_VERSION >= 5
|
||||
#define AMDGPU_PIXMAP_SHARING 1
|
||||
#define amdgpu_is_gpu_screen(screen) (screen)->isGPU
|
||||
#else
|
||||
#define amdgpu_is_gpu_screen(screen) 0
|
||||
#endif
|
||||
|
||||
#define AMDGPU_VSYNC_TIMEOUT 20000 /* Maximum wait for VSYNC (in usecs) */
|
||||
|
||||
@@ -237,10 +237,7 @@ static Bool AMDGPUCreateScreenResources_KMS(ScreenPtr pScreen)
|
||||
if (dixPrivateKeyRegistered(rrPrivKey)) {
|
||||
rrScrPrivPtr rrScrPriv = rrGetScrPriv(pScreen);
|
||||
|
||||
if (
|
||||
#ifdef AMDGPU_PIXMAP_SHARING
|
||||
!pScreen->isGPU &&
|
||||
#endif
|
||||
if (!amdgpu_is_gpu_screen(pScreen) &&
|
||||
!rrScrPriv->primaryOutput)
|
||||
{
|
||||
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
|
||||
@@ -277,10 +274,7 @@ static Bool AMDGPUCreateScreenResources_KMS(ScreenPtr pScreen)
|
||||
amdgpu_glamor_create_screen_resources(pScreen);
|
||||
|
||||
info->callback_event_type = -1;
|
||||
if (
|
||||
#ifdef AMDGPU_PIXMAP_SHARING
|
||||
!pScreen->isGPU &&
|
||||
#endif
|
||||
if (!amdgpu_is_gpu_screen(pScreen) &&
|
||||
(damage_ext = CheckExtension("DAMAGE"))) {
|
||||
info->callback_event_type = damage_ext->eventBase + XDamageNotify;
|
||||
|
||||
@@ -1001,9 +995,7 @@ static void AMDGPUBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL)
|
||||
(*pScreen->BlockHandler) (BLOCKHANDLER_ARGS);
|
||||
pScreen->BlockHandler = AMDGPUBlockHandler_KMS;
|
||||
|
||||
#ifdef AMDGPU_PIXMAP_SHARING
|
||||
if (!pScreen->isGPU)
|
||||
#endif
|
||||
if (!amdgpu_is_gpu_screen(pScreen))
|
||||
{
|
||||
for (c = 0; c < xf86_config->num_crtc; c++) {
|
||||
if (info->tear_free)
|
||||
|
||||
@@ -721,10 +721,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
|
||||
if (drmmode_crtc->rotate.fb_id) {
|
||||
fb_id = drmmode_crtc->rotate.fb_id;
|
||||
x = y = 0;
|
||||
} else if (
|
||||
#ifdef AMDGPU_PIXMAP_SHARING
|
||||
!pScreen->isGPU &&
|
||||
#endif
|
||||
|
||||
} else if (!amdgpu_is_gpu_screen(pScreen) &&
|
||||
(info->tear_free ||
|
||||
#if XF86_CRTC_VERSION >= 4
|
||||
crtc->driverIsPerformingTransform ||
|
||||
|
||||
Reference in New Issue
Block a user