From 7f2099b3ca28b140ec8c9eed9a08c83c1e49c241 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 18 Jun 2023 20:48:36 +0200 Subject: Update readme --- kms/server/kms_server.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'kms/server/kms_server.c') diff --git a/kms/server/kms_server.c b/kms/server/kms_server.c index 5aa6590..a15eb2b 100644 --- a/kms/server/kms_server.c +++ b/kms/server/kms_server.c @@ -167,28 +167,29 @@ static int kms_get_plane_ids(gsr_drm *drm) { } for(uint32_t i = 0; i < planes->count_planes && drm->num_plane_ids < GSR_KMS_MAX_PLANES; ++i) { + drmModeFB2Ptr drmfb = NULL; drmModePlanePtr plane = drmModeGetPlane(drm->drmfd, planes->planes[i]); if(!plane) { fprintf(stderr, "kms server warning: failed to get drmModePlanePtr for plane %#x: %s (%d)\n", planes->planes[i], strerror(errno), errno); continue; } - if(!plane->fb_id) { - drmModeFreePlane(plane); - continue; - } + if(!plane->fb_id) + goto next; if(plane_is_cursor_plane(drm->drmfd, plane->plane_id)) - continue; + goto next; // TODO: Fallback to getfb(1)? - drmModeFB2Ptr drmfb = drmModeGetFB2(drm->drmfd, plane->fb_id); + drmfb = drmModeGetFB2(drm->drmfd, plane->fb_id); if(drmfb) { drm->plane_ids[drm->num_plane_ids] = plane->plane_id; drm->connector_ids[drm->num_plane_ids] = get_connector_by_crtc_id(&c2crtc_map, plane->crtc_id); ++drm->num_plane_ids; drmModeFreeFB2(drmfb); } + + next: drmModeFreePlane(plane); } -- cgit v1.2.3