mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	backend/drm: remove workaround for amdgpu DP MST
Closes: https://github.com/swaywm/wlroots/issues/2533
This commit is contained in:
		
							parent
							
								
									12ede67c62
								
							
						
					
					
						commit
						4c363a564f
					
				
					 1 changed files with 5 additions and 36 deletions
				
			
		| 
						 | 
					@ -1209,8 +1209,8 @@ static void realloc_crtcs(struct wlr_drm_backend *drm) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static uint32_t get_possible_crtcs(int fd, drmModeRes *res,
 | 
					static uint32_t get_possible_crtcs(int fd, drmModeRes *res,
 | 
				
			||||||
		drmModeConnector *conn, bool is_mst) {
 | 
							drmModeConnector *conn) {
 | 
				
			||||||
	uint32_t ret = 0;
 | 
						uint32_t possible_crtcs = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (int i = 0; i < conn->count_encoders; ++i) {
 | 
						for (int i = 0; i < conn->count_encoders; ++i) {
 | 
				
			||||||
		drmModeEncoder *enc = drmModeGetEncoder(fd, conn->encoders[i]);
 | 
							drmModeEncoder *enc = drmModeGetEncoder(fd, conn->encoders[i]);
 | 
				
			||||||
| 
						 | 
					@ -1218,33 +1218,12 @@ static uint32_t get_possible_crtcs(int fd, drmModeRes *res,
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ret |= enc->possible_crtcs;
 | 
							possible_crtcs |= enc->possible_crtcs;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		drmModeFreeEncoder(enc);
 | 
							drmModeFreeEncoder(enc);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Sometimes DP MST connectors report no encoders, so we'll loop though
 | 
						return possible_crtcs;
 | 
				
			||||||
	// all of the encoders of the MST type instead.
 | 
					 | 
				
			||||||
	// TODO: See if there is a better solution.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (!is_mst || ret) {
 | 
					 | 
				
			||||||
		return ret;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	for (int i = 0; i < res->count_encoders; ++i) {
 | 
					 | 
				
			||||||
		drmModeEncoder *enc = drmModeGetEncoder(fd, res->encoders[i]);
 | 
					 | 
				
			||||||
		if (!enc) {
 | 
					 | 
				
			||||||
			continue;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if (enc->encoder_type == DRM_MODE_ENCODER_DPMST) {
 | 
					 | 
				
			||||||
			ret |= enc->possible_crtcs;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		drmModeFreeEncoder(enc);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	return ret;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void scan_drm_connectors(struct wlr_drm_backend *drm) {
 | 
					void scan_drm_connectors(struct wlr_drm_backend *drm) {
 | 
				
			||||||
| 
						 | 
					@ -1405,17 +1384,7 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) {
 | 
				
			||||||
				wl_list_insert(&wlr_conn->output.modes, &mode->wlr_mode.link);
 | 
									wl_list_insert(&wlr_conn->output.modes, &mode->wlr_mode.link);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			size_t path_len;
 | 
								wlr_conn->possible_crtc = get_possible_crtcs(drm->fd, res, drm_conn);
 | 
				
			||||||
			bool is_mst = false;
 | 
					 | 
				
			||||||
			char *path = get_drm_prop_blob(drm->fd, wlr_conn->id,
 | 
					 | 
				
			||||||
				wlr_conn->props.path, &path_len);
 | 
					 | 
				
			||||||
			if (path && path_len > 4 && strncmp(path, "mst:", 4) == 0) {
 | 
					 | 
				
			||||||
				is_mst = true;
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			free(path);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			wlr_conn->possible_crtc = get_possible_crtcs(drm->fd, res, drm_conn,
 | 
					 | 
				
			||||||
				is_mst);
 | 
					 | 
				
			||||||
			if (wlr_conn->possible_crtc == 0) {
 | 
								if (wlr_conn->possible_crtc == 0) {
 | 
				
			||||||
				wlr_log(WLR_ERROR, "No CRTC possible for connector '%s'",
 | 
									wlr_log(WLR_ERROR, "No CRTC possible for connector '%s'",
 | 
				
			||||||
					wlr_conn->output.name);
 | 
										wlr_conn->output.name);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue