compositor-drm: Remove unnecessary libdrm defines

Submitted by Daniel Stone on July 20, 2018, 10:06 a.m.

Details

Message ID 20180720100619.16851-1-daniels@collabora.com
State Accepted
Commit 8c9556c57d0f907e461e2c4ccf01155f0a7b1244
Headers show
Series "compositor-drm: Remove unnecessary libdrm defines" ( rev: 1 ) in Wayland

Not browsing as part of any series.

Commit Message

Daniel Stone July 20, 2018, 10:06 a.m.
The backend begins with a series of #defines of libdrm tokens, in case
the libdrm we build against is too old.

Commit efdebbc4e82b ("configure.ac: bump libdrm requirement to 2.4.68")
did what it said on the box; since we now depend on a relatively modern
libdrm, we can get rid of most of our compatibility defines.

DRM_CAP_TIMESTAMP_MONOTONIC was added in libdrm 2.4.47 (f8f1f6e37ae2).
DRM_CLIENT_CAP_UNIVERSAL_PLANES was added in libdrm 2.4.55
(8fc62ca8ac01).
DRM_CAP_CURSOR_WIDTH and HEIGHT were added in libdrm 2.4.68
(cc9a53f076d4).

Remove these four fallback definitions.

Signed-off-by: Daniel Stone <daniels@collabora.com>
---
 libweston/compositor-drm.c | 16 ----------------
 1 file changed, 16 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index da9cf5e4f..e3e127a2d 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -91,26 +91,10 @@ 
 #include "linux-dmabuf.h"
 #include "linux-dmabuf-unstable-v1-server-protocol.h"
 
-#ifndef DRM_CAP_TIMESTAMP_MONOTONIC
-#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6
-#endif
-
-#ifndef DRM_CLIENT_CAP_UNIVERSAL_PLANES
-#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2
-#endif
-
 #ifndef DRM_CLIENT_CAP_ASPECT_RATIO
 #define DRM_CLIENT_CAP_ASPECT_RATIO	4
 #endif
 
-#ifndef DRM_CAP_CURSOR_WIDTH
-#define DRM_CAP_CURSOR_WIDTH 0x8
-#endif
-
-#ifndef DRM_CAP_CURSOR_HEIGHT
-#define DRM_CAP_CURSOR_HEIGHT 0x9
-#endif
-
 #ifndef GBM_BO_USE_CURSOR
 #define GBM_BO_USE_CURSOR GBM_BO_USE_CURSOR_64X64
 #endif

Comments

On 2018-07-20 05:06 AM, Daniel Stone wrote:
> The backend begins with a series of #defines of libdrm tokens, in case
> the libdrm we build against is too old.
> 
> Commit efdebbc4e82b ("configure.ac: bump libdrm requirement to 2.4.68")
> did what it said on the box; since we now depend on a relatively modern
> libdrm, we can get rid of most of our compatibility defines.
> 
> DRM_CAP_TIMESTAMP_MONOTONIC was added in libdrm 2.4.47 (f8f1f6e37ae2).
> DRM_CLIENT_CAP_UNIVERSAL_PLANES was added in libdrm 2.4.55
> (8fc62ca8ac01).
> DRM_CAP_CURSOR_WIDTH and HEIGHT were added in libdrm 2.4.68
> (cc9a53f076d4).

Thank you for making this so trivial to review! :)

> Remove these four fallback definitions.
> 
> Signed-off-by: Daniel Stone <daniels@collabora.com>

Reviewed-by: Derek Foreman <derek.foreman.samsung@gmail.com>

> ---
>  libweston/compositor-drm.c | 16 ----------------
>  1 file changed, 16 deletions(-)
> 
> diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
> index da9cf5e4f..e3e127a2d 100644
> --- a/libweston/compositor-drm.c
> +++ b/libweston/compositor-drm.c
> @@ -91,26 +91,10 @@
>  #include "linux-dmabuf.h"
>  #include "linux-dmabuf-unstable-v1-server-protocol.h"
>  
> -#ifndef DRM_CAP_TIMESTAMP_MONOTONIC
> -#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6
> -#endif
> -
> -#ifndef DRM_CLIENT_CAP_UNIVERSAL_PLANES
> -#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2
> -#endif
> -
>  #ifndef DRM_CLIENT_CAP_ASPECT_RATIO
>  #define DRM_CLIENT_CAP_ASPECT_RATIO	4
>  #endif
>  
> -#ifndef DRM_CAP_CURSOR_WIDTH
> -#define DRM_CAP_CURSOR_WIDTH 0x8
> -#endif
> -
> -#ifndef DRM_CAP_CURSOR_HEIGHT
> -#define DRM_CAP_CURSOR_HEIGHT 0x9
> -#endif
> -
>  #ifndef GBM_BO_USE_CURSOR
>  #define GBM_BO_USE_CURSOR GBM_BO_USE_CURSOR_64X64
>  #endif
>