From f83ad09dc04c9f918ee8836bac9d88dac5de6745 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 7 Feb 2022 11:59:54 +0100 Subject: [PATCH] xf86drmMode: constify drmModeAtomicReq functions This acts as an additional ABI guarantee, and improves documentation for users. Signed-off-by: Simon Ser Reviewed-by: Thierry Reding Reviewed-by: Pekka Paalanen --- xf86drmMode.c | 8 ++++---- xf86drmMode.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xf86drmMode.c b/xf86drmMode.c index 87e96603..6b79d768 100644 --- a/xf86drmMode.c +++ b/xf86drmMode.c @@ -1348,7 +1348,7 @@ drm_public drmModeAtomicReqPtr drmModeAtomicAlloc(void) return req; } -drm_public drmModeAtomicReqPtr drmModeAtomicDuplicate(drmModeAtomicReqPtr old) +drm_public drmModeAtomicReqPtr drmModeAtomicDuplicate(const drmModeAtomicReqPtr old) { drmModeAtomicReqPtr new; @@ -1378,7 +1378,7 @@ drm_public drmModeAtomicReqPtr drmModeAtomicDuplicate(drmModeAtomicReqPtr old) } drm_public int drmModeAtomicMerge(drmModeAtomicReqPtr base, - drmModeAtomicReqPtr augment) + const drmModeAtomicReqPtr augment) { uint32_t i; @@ -1411,7 +1411,7 @@ drm_public int drmModeAtomicMerge(drmModeAtomicReqPtr base, return 0; } -drm_public int drmModeAtomicGetCursor(drmModeAtomicReqPtr req) +drm_public int drmModeAtomicGetCursor(const drmModeAtomicReqPtr req) { if (!req) return -EINVAL; @@ -1480,7 +1480,7 @@ static int sort_req_list(const void *misc, const void *other) return first->cursor - second->cursor; } -drm_public int drmModeAtomicCommit(int fd, drmModeAtomicReqPtr req, +drm_public int drmModeAtomicCommit(int fd, const drmModeAtomicReqPtr req, uint32_t flags, void *user_data) { drmModeAtomicReqPtr sorted; diff --git a/xf86drmMode.h b/xf86drmMode.h index 19bf91dd..08557642 100644 --- a/xf86drmMode.h +++ b/xf86drmMode.h @@ -433,18 +433,18 @@ extern int drmModeObjectSetProperty(int fd, uint32_t object_id, typedef struct _drmModeAtomicReq drmModeAtomicReq, *drmModeAtomicReqPtr; extern drmModeAtomicReqPtr drmModeAtomicAlloc(void); -extern drmModeAtomicReqPtr drmModeAtomicDuplicate(drmModeAtomicReqPtr req); +extern drmModeAtomicReqPtr drmModeAtomicDuplicate(const drmModeAtomicReqPtr req); extern int drmModeAtomicMerge(drmModeAtomicReqPtr base, - drmModeAtomicReqPtr augment); + const drmModeAtomicReqPtr augment); extern void drmModeAtomicFree(drmModeAtomicReqPtr req); -extern int drmModeAtomicGetCursor(drmModeAtomicReqPtr req); +extern int drmModeAtomicGetCursor(const drmModeAtomicReqPtr req); extern void drmModeAtomicSetCursor(drmModeAtomicReqPtr req, int cursor); extern int drmModeAtomicAddProperty(drmModeAtomicReqPtr req, uint32_t object_id, uint32_t property_id, uint64_t value); extern int drmModeAtomicCommit(int fd, - drmModeAtomicReqPtr req, + const drmModeAtomicReqPtr req, uint32_t flags, void *user_data);