diff --git a/hw/xfree86/drivers/video/modesetting/drmmode_display.c b/hw/xfree86/drivers/video/modesetting/drmmode_display.c index d340b9818a..6681b63cf7 100644 --- a/hw/xfree86/drivers/video/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/video/modesetting/drmmode_display.c @@ -2692,9 +2692,21 @@ drmmode_crtc_create_planes(xf86CrtcPtr crtc, int num) } case DRMMODE_PLANE_TYPE_PRIMARY: { - /* If this plane is not on this crtc, skip it */ + /* Prefer planes that are on this CRTC already */ if (plane_crtc != drmmode_crtc->mode_crtc->crtc_id) { - drmModeFreePlane(kplane); + /* If this is the only plane we have, it's the best we have */ + if (!best_plane) { + best_plane = plane_id; + best_kplane = kplane; + blob_id = drmmode_prop_get_value(&tmp_props[DRMMODE_PLANE_IN_FORMATS], + props, 0); + async_blob_id = drmmode_prop_get_value(&tmp_props[DRMMODE_PLANE_IN_FORMATS_ASYNC], + props, 0); + drmmode_prop_info_copy(drmmode_crtc->props_plane, tmp_props, + DRMMODE_PLANE__COUNT, 1); + } else { + drmModeFreePlane(kplane); + } drmModeFreeObjectProperties(props); continue; }