From f368428ab84c14f32f52e50b880d9353fbb87181 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Wed, 7 Mar 2018 18:45:31 +0000 Subject: [PATCH] modesetting: remove always true defined(DRM_CAP_PRIME) guards The macro was available in libdrm for ages. Furthermore having a guard like this is a very bad idea. Building on an old server will result in a missing run-time functionality. Since it's UABI one can use a local fallback, old kernels will return -EINVAL and the fallback path will kick in. Signed-off-by: Emil Velikov Reviewed-by: Adam Jackson --- hw/xfree86/drivers/modesetting/driver.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index 5888aef86..f92fa01ab 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -227,7 +227,7 @@ check_outputs(int fd, int *count) *count = res->count_connectors; ret = res->count_connectors > 0; -#if defined(DRM_CAP_PRIME) && defined(GLAMOR_HAS_GBM_LINEAR) +#if defined(GLAMOR_HAS_GBM_LINEAR) if (ret == FALSE) { uint64_t value = 0; if (drmGetCap(fd, DRM_CAP_PRIME, &value) == 0 && @@ -1009,7 +1009,6 @@ PreInit(ScrnInfoPtr pScrn, int flags) xf86ReturnOptValBool(ms->drmmode.Options, OPTION_PAGEFLIP, TRUE); pScrn->capabilities = 0; -#ifdef DRM_CAP_PRIME ret = drmGetCap(ms->fd, DRM_CAP_PRIME, &value); if (ret == 0) { if (connector_count && (value & DRM_PRIME_CAP_IMPORT)) { @@ -1022,7 +1021,6 @@ PreInit(ScrnInfoPtr pScrn, int flags) pScrn->capabilities |= RR_Capability_SourceOutput | RR_Capability_SourceOffload; #endif } -#endif ret = drmSetClientCap(ms->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1); ret |= drmSetClientCap(ms->fd, DRM_CLIENT_CAP_ATOMIC, 1);