Skip to content

Commit d22d17d

Browse files
committed
check if planes are possible in combination with selected crtc when adding to atomic req
1 parent a3db1d5 commit d22d17d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

include/modesetting.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ struct drm_crtc {
2323
drmModeCrtc *crtc;
2424
drmModeObjectProperties *props;
2525
drmModePropertyRes **props_info;
26+
uint32_t bitmask;
27+
uint8_t index;
2628
};
2729

2830
struct drm_plane {

src/modesetting.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,13 @@ static int fetch_crtcs(struct drmdev *drmdev, struct drm_crtc **crtcs_out, size_
221221
goto fail_free_crtcs;
222222
}
223223
}
224-
224+
225225
crtcs[i].crtc = crtc;
226226
crtcs[i].props = props;
227227
crtcs[i].props_info = props_info;
228+
229+
crtcs[i].index = i;
230+
crtcs[i].bitmask = 1 << i;
228231
}
229232

230233
*crtcs_out = crtcs;
@@ -820,7 +823,9 @@ int drmdev_new_atomic_req(
820823
req->available_planes = PSET_INITIALIZER_STATIC(req->available_planes_storage, 32);
821824

822825
for_each_plane_in_drmdev(drmdev, plane) {
823-
pset_put(&req->available_planes, plane);
826+
if (plane->plane->possible_crtcs & drmdev->selected_crtc->bitmask) {
827+
pset_put(&req->available_planes, plane);
828+
}
824829
}
825830

826831
*req_out = req;

0 commit comments

Comments
 (0)