diff options
author | Eric Engestrom <eric@engestrom.ch> | 2022-09-02 12:36:49 +0100 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2022-09-02 16:41:51 +0000 |
commit | 3bf6ee1a02334386d87cfe356c3bfb0b24e1fed8 (patch) | |
tree | f2b964eab000937806594694e6827098d2b52251 /drm-common.c | |
parent | 92a523d29d3dcedd8d45b31e9ec04e1c8243aa95 (diff) | |
download | kmscube-3bf6ee1a02334386d87cfe356c3bfb0b24e1fed8.tar.gz |
drm-common: fix return type of find_crtc_for_connector() & find_crtc_for_encoder()
They return -1 on error, so it needs to be signed.
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Diffstat (limited to 'drm-common.c')
-rw-r--r-- | drm-common.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drm-common.c b/drm-common.c index e736922..95a5b92 100644 --- a/drm-common.c +++ b/drm-common.c @@ -124,7 +124,7 @@ struct drm_fb * drm_fb_get_from_bo(struct gbm_bo *bo) return fb; } -static uint32_t find_crtc_for_encoder(const drmModeRes *resources, +static int32_t find_crtc_for_encoder(const drmModeRes *resources, const drmModeEncoder *encoder) { int i; @@ -143,7 +143,7 @@ static uint32_t find_crtc_for_encoder(const drmModeRes *resources, return -1; } -static uint32_t find_crtc_for_connector(const struct drm *drm, const drmModeRes *resources, +static int32_t find_crtc_for_connector(const struct drm *drm, const drmModeRes *resources, const drmModeConnector *connector) { int i; @@ -152,7 +152,7 @@ static uint32_t find_crtc_for_connector(const struct drm *drm, const drmModeRes drmModeEncoder *encoder = drmModeGetEncoder(drm->fd, encoder_id); if (encoder) { - const uint32_t crtc_id = find_crtc_for_encoder(resources, encoder); + const int32_t crtc_id = find_crtc_for_encoder(resources, encoder); drmModeFreeEncoder(encoder); if (crtc_id != 0) { @@ -309,7 +309,7 @@ int init_drm(struct drm *drm, const char *device, const char *mode_str, if (encoder) { drm->crtc_id = encoder->crtc_id; } else { - uint32_t crtc_id = find_crtc_for_connector(drm, resources, connector); + int32_t crtc_id = find_crtc_for_connector(drm, resources, connector); if (crtc_id == -1) { printf("no crtc found!\n"); return -1; |